Get Metadata Collection Definition

get

/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

Supported Media Types
Path Parameters
  • Collection name. For a user personal collection, it must start with Personal., such as Personal.MyCollection.
Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : CollectionGetResponse
Type: object
The response body includes information about a metadata collection definition.
Show Source
Nested Schema : items
Type: array
List of field definitions.
Show Source
Nested Schema : CollectionFieldDefinition
Type: object
Metadata fields definition.
Show Source

400 Response

Request parameters are not formatted correctly.

A collection with that name does not exist.

Back to Top

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"
}
Back to Top