pjain Posted December 20, 2022 Report Share Posted December 20, 2022 I am trying to insert a record in one of the tables using Caspio API endpoint rest/v2/tables/{Table}/records I am getting below error while inserting record - { "Code": "AlterReadOnlyData", "Message": "Cannot perform operation because one or more fields are read-only.", "Resource": "https://XXXXX.caspio.com/rest/v2/tables/XXXXXXXXX/records", "RequestId": "C6EBCC49-4218-4028-B83E-7A0031E3042F" } I am suspecting this is coming due to our unique identifier which is auto-generated by Caspio. It's definition is - { "Format": "1", "Prefix": "OBR", "Name": "OB_Record_ID", "Type": "PREFIXED AUTONUMBER", "Unique": true, "Description": "Unique identifier for record.", "DisplayOrder": 1, "Label": "Record ID", "UniqueAllowNulls": false, "IsFormula": false } How do we provide this kind of field in API request. We tried following options but no luck. "OB_Record_ID": "OBR1" "OB_Record_ID": "" "OB_Record_ID": "*" "OB_Record_ID": null Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted December 20, 2022 Report Share Posted December 20, 2022 Hello @pjain, Usually this error occurs when the field with the auto-generated data type is used in the request body. To solve this just skip the OB_Record_ID field and don`t mention it in the request body. It will be populated automatically. For example, there is a table with the following fields: Request: Result: Quote Link to comment Share on other sites More sharing options...
0 pjain Posted December 20, 2022 Author Report Share Posted December 20, 2022 Hi @CoopperBackpack Thanks for responding to my question. I tried skipping OB_Record_ID but I am still getting this error. Also, I am not able to see images you have uploaded. Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted December 21, 2022 Report Share Posted December 21, 2022 Hello @pjain, It is strange that images are not visible on your side. I mentioned the following Table design in my example: Field name: Data type: OB_Record_ID Prefixed Autonumber Status Text(255) Price Number So, the request body example is: { "Status": "In progress", "Price": 5 } Could you specify the data types of the fields that you use in your request? Do you have Formula, Autonumber, Random ID, GUID? Quote Link to comment Share on other sites More sharing options...
Question
pjain
I am trying to insert a record in one of the tables using Caspio API endpoint rest/v2/tables/{Table}/records
I am getting below error while inserting record -
"Format": "1",
"Prefix": "OBR",
"Name": "OB_Record_ID",
"Type": "PREFIXED AUTONUMBER",
"Unique": true,
"Description": "Unique identifier for record.",
"DisplayOrder": 1,
"Label": "Record ID",
"UniqueAllowNulls": false,
"IsFormula": false
}
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.