Edit Status or Fields in a Metadata Collection
/documents/api/1.1/metadata/{collectionName}
Add or remove fields in a specified metadata collection.
Enable or disable 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
.
Description of fields available to edit fields in a metadata collection request. There are no required attributes.
- addFields
-
Type:
string
Add one or more field names, separated by commas. You can add and remove fields after the collection is created. Field names must be unique within the collection.
The following restrictions apply to collection and field names:
- Collection and field names can't start or end with a space.
- The combined length of the collection and field name can't exceed 240 characters.
- Collection and file names aren't case-sensitive; that is,
Field Name
andfield name
are considered identical.
Don't use the following characters in collection or field names:
/ \ < > [ ] { } = $ % ' * " ? : # & ^ . , | The following strings are also not allowed in collection or field names:
- NUL
- NULL
- xSystem
- xUser
- xAF
- dMetadataUnitID
- dParentMetadataUnitID
- dMetadataInheritLevel
- dAssignedMetaCollection
- dMetaCollection
- dMetaCollections
- dMetadataCollectionID
- dMetadataID
- removeFields
-
Type:
string
Specify the names of one or more fields to delete, separated by commas. - settings
-
Type:
string
Enable or disable a metadata collection.
Possible values are:
- enable
- disable
Example application/json
{
"addFields":"FieldX,FieldY,FieldZ",
"removeFields":"FieldA,FieldB",
"settings":"enable"
}
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 adds two fields, B3
and B4
, and removes field B2
from the CollectionB
metadata collection. Also, it disables CollectionB
.
PUT .../metadata/CollectionB
Request Header
None.
Request Body
{ "addFields": "B3,B4", "removeFields": "B2" "settings" : "disable" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0" }
Example 2
The following example adds two fields, A3
and A4
, and removes field A2
from the Personal.CollectionA
metadata collection. Also, it disables Personal.CollectionA
.
PUT .../metadata/Personal.CollectionA
Request Header
None.
Request Body
{ "addFields": "A3,A4", "removeFields": "A2" "settings" : "disable" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0" }
Example 3
The following example attempts to edit the definition of a collection that does not exist.
PUT .../metadata/Personal.CollectionAB
Request Header
None.
Request Body
{ "addFields": "A3,A4", "removeFields": "A2" "settings" : "disable" }
HTTP Status Code
HTTP_STATUS = 404
JSON Response
{ "errorCode": "-16", "errorKey": "!csUnableToEditMetaColDef!csMetaCollectionDoesntExist,Personal.CollectionAB", "errorMessage": "Unable to edit metadata collection definition. Metadata Collection 'Personal.CollectionAB' is not defined.", "title": "Unable to edit metadata collection definition. Metadata Collection 'Personal.CollectionAB' is not defined.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 4
The following example attempts to edit the definition of a collection using invalid characters in the name.
PUT .../metadata/Personal.CollectionA,B
Request Header
None.
Request Body
{ "addFields": "A3,A4", "removeFields": "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" }