Get Metadata Collection Definition

get

/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

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.

Response

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

The request was fulfilled.

Body
The response body includes information about a metadata collection definition.
Root Schema : CollectionGetResponse
The response body includes information about a metadata collection definition.
Nested Schema : items
Type: array
List of field definitions.
Nested Schema : CollectionFieldDefinition
Type: object
Metadata fields definition.
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": "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"
}