Edit Field Status in a Metadata Collection
/documents/api/1.1/metadata/{collectionName}/field
Enable or disable fields in a metadata collection.
Request
- application/json
- application/xml
- collectionName
-
Type:
string
Required:true
Collection name. For a user personal collection, it must start withPersonal.
, such asPersonal.MyCollection
.
- fields
-
Type:
string
Field names, separated by commas. - settings
-
Type:
string
Enable or disable metadata fields specified in fields.
Possible values are:
- enable
- disable
Example application/json
{
"settings":"disable"
}
Response
- application/json
- application/xml
The request was fulfilled.
- errorCode
-
Type:
number
An error code of zero (0) indicates no errors.
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" }