Updating Data by Record ID
Function
This API is used to update data by record ID. It is a synchronous API. (Invocation result is returned only after the function execution is complete.)
Before calling this API, you must create an object and data records.
URI
PUT Huawei Cloud Astro Zero domain name/u-route/baas/data/v1.0/bobject/{objectName}/{recordId}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
objectName |
Yes |
String |
Explanation Object name. For details, see Logging In to the Application Designer. You can access the application designer and choose Data > Object to view object names. Constraints None Value 1–80 characters Default value None |
recordId |
Yes |
String |
Explanation Record ID, which can be obtained by calling the API of Querying Data by Condition (id in the response message). Constraints None Value None Default value None |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
setValue |
Yes |
Object |
Explanation An object consisting of the changed attributes and their new 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 |
Number |
Explanation Number of updated records. This parameter is carried when the request is successful. Value Number. Generally, the value is 1 if the update is successful. |
Example Request
PUT https://Huawei Cloud Astro Zero domain name/u-route/baas/data/v1.0/bobject/TestProject__testForObject__CST/cfw0000000aKin6AQgfQ { "setValue": { "name": "newName" } }
Example Response
{ "resCode": "0", "resMsg": "Success", "result": 1 }
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