Edit Field Status in a Metadata Collection

put

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

Enable or disable fields in a metadata collection.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
collectionName
Type: string
Required: true
Collection name. For a user personal collection, it must start with Personal., such as Personal.MyCollection.
Body Parameter
The request body defines the details of the enable/disable status for fields in a metadata collection request.
Root Schema : CollectionFieldEditBody
The request body defines details of the enable/disable fields in a metadata collection request.
Example application/json

{
    "settings":"disable"
}

Response

Supported Media Types
  • application/json
  • application/xml
200 Response

The request was fulfilled.

Body
The response body includes information about edit fields in a metadata collection operation.
Root Schema : CollectionEditResponse
The response body includes information about edit fields in a metadata collection operation.
400 Response

Request parameters are not formatted correctly.

A collection with that name does not exist.

Examples

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

PUT .../metadata/CollectionB/field

Request Header

None.

Request Body

HTTP Status Code

{
    "fields": "B1,B2",
    "settings" : "disable"
}
HTTP_STATUS = 200

JSON Response

{
    "errorCode": "0"
}

Example 2

The following example disables fields A1 and A2 in the Personal.CollectionA metadata collection.

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

Request Header

None.

Request Body

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

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"
}