Get Metadata Collection Definition
/documents/api/1.2/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: string
Collection name. For a user personal collection, it must start with
Personal.
, such asPersonal.MyCollection
.
Response
- application/json
- application/xml
200 Response
The request was fulfilled.
object
-
errorCode(optional):
number
An error code of zero (0) indicates no errors.
-
isEnabled(optional):
string
Metadata collection enable (
1
) or disable (0
) status. -
items(optional):
array items
List of field definitions.
-
type(optional):
string
Item type
collection
.
array
-
Array of:
object CollectionFieldDefinition
Metadata fields definition.
object
-
fieldDescription(optional):
string
Field description.
-
fieldName(optional):
string
Field name.
-
fieldType(optional):
string
Field type.
-
isEnabled(optional):
string
Field enable (1) or disable (0) status.
-
type(optional):
string
Item type
field
.
400 Response
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": "FieldA", "fieldDescription": "Field A", "fieldType": "text", "isEnabled": "1" }, { "type": "field", "fieldName": "FieldB", "fieldDescription": "Field B", "fieldType": "number", "isEnabled": "1" }, { "type": "field", "fieldName": "FieldC", "fieldDescription": "Field C", "fieldType": "date", "isEnabled": "1" }, { "type": "field", "fieldName": "FieldD", "fieldDescription": "Field D", "fieldType": "boolean", "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" }