Creating a Custom Object
Function
This API is used to create a custom object.
URI
POST Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Explanation Name of the custom object. Constraints The value cannot be changed after being specified. Value The value must start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_) and can contain a maximum of 63 characters. Default value None |
label |
No |
String |
Explanation Alias of an object, which can be modified after being created. Constraints None Value 1–80 characters Default value None |
description |
No |
String |
Explanation Description of the object. Constraints None Value 1–80 characters Default value None |
fields |
Yes |
Array of field object |
Explanation Object fields. For details about the field parameters, see Table 2. Constraints None |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
label |
Yes |
String |
Explanation Label of the new field. Constraints None Value 1–80 characters Default value None |
name |
Yes |
String |
Explanation Name of the new field. Constraints The value cannot be changed after being specified. Value The value must start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_) and can contain a maximum of 63 characters. Default value None |
dataType |
Yes |
String |
Explanation Type of the new field. Constraints The value cannot be changed after being specified. Value
Default value 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 |
string |
Explanation If the request is successful, an ID is returned. Value None |
Example Request
To create an object instance, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object { "label": "VehicleType", "name": "VehicleType__CST", "description": "", "fields": [ { "label": "Name", "name": "name", "dataType": "Name" } ] }
Example Response
{ "resCode":"0", "resMsg": "Success", "result":"cust***aKtFZpERvc" }
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