Edit Fields in a Metadata Collection

put

/documents/api/1.2/metadata/{collectionName}/field

Edit field definitions or status in a metadata collection.

Request

Supported Media Types
Path Parameters
  • Collection name. For a user personal collection, it must start with Personal., such as Personal.MyCollection.
Body ()
The request body defines the details of the enable/disable status for fields in a metadata collection request.
Root Schema : CollectionFieldEditBody
Type: object
The request body defines details of the enable/disable fields in a metadata collection request.
Show Source
Nested Schema : fieldsArray
Type: array
Can be used instead of fields and settings parameters if field definitions need to change in addition to or instead of enabling or disabling the fields.
Show Source
Nested Schema : items
Type: object
Show Source
Example Request (application/json)
{
    "settings":"disable"
}
Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : CollectionEditResponse
Type: object
The response body includes information about edit fields in a metadata collection operation.
Show Source

400 Response

Request parameters are not formatted correctly.

A collection with that name does not exist.

Back to Top

Examples

The following example disables fields B1 and B2 in the CollectionB metadata collection.

PUT .../metadata/CollectionB/field

Request Header

None.

Request Body

{
    "fields": "B1,B2",
    "settings" : "disable"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0"
}

Example 2

The following example modifies the description of FieldB while enabling it and modifies the description of FieldC while disabling it in the Personal.CollectionA metadata collection.

PUT .../metadata/Personal.CollectionA/field

Request Header

None.

Request Body

{
    "fieldsArray":[
        {"fieldName":"FieldB", "fieldDescription":"Enabled Field B", "isEnabled":"1"},
        {"fieldName":"FieldC", "fieldDescription":"Disabled Field C", "isEnabled":"0"}
    ]
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0"
}

Example 3

The following example attempts to disable fields in a metadata collection using an invalid character in the name.

PUT .../metadata/Personal.CollectionA,B/field

Request Header

None.

Request Body

{
    "fields": "A1,A2",
    "settings" : "disable"
}

HTTP Status Code

HTTP_STATUS = 400

JSON Response

{
    "errorCode": "-96",
    "errorKey": "!csCollectionNameInvalidCharacters,Personal.CollectionA\\,B",
    "errorMessage": "Invalid characters in the collection name 'Personal.CollectionA,B'.",
    "title": "Invalid characters in the collection name 'Personal.CollectionA,B'.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Back to Top