Get Metadata Collection Definition
/documents/api/1.1/metadata/{collectionName}
Retrieve metadata collection definition information along with metadata fields information.
Enable (1) or disable (0) status will be displayed individually for a metadata collection and all its fields.
Request
- application/json
- application/xml
- collectionName
-
Type:
stringRequired:trueCollection name. For a user personal collection, it must start withPersonal., such asPersonal.MyCollection.
Response
- application/json
- application/xml
The request was fulfilled.
- errorCode
-
Type:
numberAn error code of zero (0) indicates no errors. - isEnabled
-
Type:
stringMetadata collection enable (1) or disable (0) status. - items
-
Type:
arrayitemsAdditional Properties Allowed:List of field definitions. - type
-
Type:
stringItem typecollection.
array-
Type:
objectCollectionFieldDefinitionAdditional Properties Allowed:Metadata fields definition.
object- fieldName
-
Type:
stringField name. - fieldType
-
Type:
stringField type. - isEnabled
-
Type:
stringField enable (1) or disable (0) status. - type
-
Type:
stringItem typefield.
Request parameters are not formatted correctly.
A collection with that name does not exist.
Examples
The following example retrieves the definition of the CollectionB metadata collection.
GET .../metadata/CollectionB
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"errorCode": "0",
"isEnabled": "1",
"type": "collection",
"items": [
{
"type": "field",
"fieldName": "B1",
"fieldType": "string",
"isEnabled": "0"
},
{
"type": "field",
"fieldName": "B2",
"fieldType": "string",
"isEnabled": "1"
}
]
}
Example 2
The following example retrieves the definition of the Personal.CollectionA metadata collection.
GET .../metadata/Personal.CollectionA
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"errorCode": "0",
"isEnabled": "1",
"type": "collection",
"items": [
{
"type": "field",
"fieldName": "A1",
"fieldType": "string",
"isEnabled": "1"
},
{
"type": "field",
"fieldName": "A2",
"fieldType": "string",
"isEnabled": "1"
}
]
}
Example 3
The following example attempts to retrieve the definition of a collection that does not exist.
GET .../metadata/Personal.CollectionAB
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 404
JSON Response
{
"errorCode": "-16",
"errorKey": "!csUnableToGetMetaColDef!csMetaCollectionDoesntExist,Personal.CollectionAB",
"errorMessage": "Unable to get metadata collection definition. Metadata Collection 'Personal.CollectionAB' is not defined.",
"title": "Unable to get 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 retrieve the definition of a collection using invalid characters in the collection name.
GET .../metadata/Personal.CollectionA,B
Request Header
None.Request Body
None.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"
}