Adding Data to an Object
Function
This API is used to add data to an object. It is a synchronous API. (Invocation result is returned only after the function execution is complete.)
Before adding data to an object, you must create an object.
URI
POST Huawei Cloud Astro Zero domain name/u-route/baas/data/v1.0/bobject/{objectName}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
objectName |
Yes |
String |
Explanation Name of the data object to be created Constraints None Value 1–80 characters Default value None |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
records |
Yes |
Array |
Explanation An object array consisting of attributes and values. Constraints None |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
resCode |
String |
Explanation Return code. Value If the request is successful, 0 is returned. For details about other error codes, see Error Codes. |
resMsg |
String |
Explanation Message returned. Value If the request is successful, "Success" is returned. In other cases, an error message is returned. |
result |
Array |
Explanation An object array of record IDs. |
Example Request
To add two records to the TestProject__testForObject__CST object, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/data/v1.0/bobject/TestProject__testForObject__CST { "records": [ { "name": "name1" }, { "name": "name2" } ] }
Example Response
{ "resCode": "0", "resMsg": "Success", "result": [ { "id": "cfw0000000aKmGskAsDo" }, { "id": "cfw0000000aKmGskAsDp" } ] }
Status Code
See Status Codes.
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot