Updated on 2025-05-13 GMT+08:00

Adding a Layout for an Object Instance

Function

This API is used to add a layout for an object instance. Field values can be visualized through layouts. When creating a field, you can add the field to a specific layout for visualization.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object/{object_id}/Layout

Table 1 URI parameter

Parameter

Mandatory

Type

Description

Object_id

Yes

String

Explanation

Object instance ID, which can be queried by calling the API of Querying All Custom Objects (id in the response message).

Constraints

None

Value

None

Default value

None

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Explanation

Name of the table object to be created.

Constraints

The value cannot be changed after being specified.

Value

The name must start with a letter and cannot contain special characters, underscores (_), and consecutive spaces. A maximum of 64 characters are allowed.

Default value

None

viewName

No

String

Explanation

Alias of an object. The format is __layout__ + Object name + __Layout name. Layout name is the name in the request body, and Object name can be obtained by calling the API in Querying All Custom Objects (that is, name in the response message).

Constraints

None

Value

None

Default value

None

existingPageLayout

Yes

String

Explanation

ID of the existing page layout.

Constraints

None

Value

None

Default value

None

Response Parameters

Table 3 describes the response parameters.

Table 3 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 add a layout for an object instance, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object/cust000000aKoa6I4E6K/Layout
{
    "name": "dsaf",
    "existingPageLayout": "000D000000aKoa6OJOxl",
    "viewName": "dsaf"
}

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": "000D000000aL60EyXgUS"
}

Status Code

See Status Codes.

Error Code

See Error Codes.