Get Available Metadata Collection
/documents/api/1.1/metadata
Retrieve all metadata collections available for the current user. The result list includes all global metadata collections for that tenant as well as all personal metadata collections created by the current user. By default, only metadata collection definitions will be retrieved, but all respective field definitions can be obtained as well, if needed.
Request
- application/json
- application/xml
retrieveFields can be used.- retrieveFields
-
Type:
numberRetrieve only collections (0) or retrieve collections and respective field definitions (1).
Example application/json
{
"retrieveFields":"1"
}
Response
- application/json
- application/xml
The request was fulfilled.
- errorCode
-
Type:
numberAn error code of zero (0) indicates no errors. - metadataCollections
-
Type:
arraymetadataCollectionsAdditional Properties Allowed:
array-
Type:
objectCollectionDefinitionAdditional Properties Allowed:Metadata collection definition.
object- isEnabled
-
Type:
stringCollection enable (1) or disable (0) status. - isInherited
-
Type:
stringCollection inherited (1) or directly assigned (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.
Examples
The following example returns all available metadata collections for the current user. By default, only collection information is retrieved. All global collections created by an admin user and all personal collections created by the current user are retrieved. The URL request in the example has the same effect as passing the query parameter "retrieveFields=0".
GET .../metadata
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"errorCode": "0",
"metadataCollections": {
"GlobalCollectionA": {
"isEnabled": "1",
"type": "collection"
},
"GlobalCollectionB": {
"isEnabled": "0",
"type": "collection"
},
"Personal.MyUserAMetadata": {
"isEnabled": "1",
"type": "collection"
}
}
}
Example 2
The following example returns all available metadata collections for the current user. All collections and their respective fields are retrieved, including all global collections created by an admin user and all personal collections created by the current user.
GET .../metadata?retrieveFields=1
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"errorCode": "0",
"metadataCollections": {
"GlobalCollectionA": {
"isEnabled": "1",
"type": "collection",
"items": [
{
"type": "field",
"fieldName": "globalFieldA1",
"fieldType": "string",
"isEnabled": "1"
},
{
"type": "field",
"fieldName": "globalFieldA2",
"fieldType": "string",
"isEnabled": "0"
}
]
},
"GlobalCollectionB": {
"isEnabled": "0",
"type": "collection",
"items": [
{
"type": "field",
"fieldName": "globalFieldB1",
"fieldType": "string",
"isEnabled": "1"
},
{
"type": "field",
"fieldName": "globalFieldB2",
"fieldType": "string",
"isEnabled": "1"
}
]
},
"Personal.MyUserAMetadata": {
"isEnabled": "1",
"type": "collection",
"items": [
{
"type": "field",
"fieldName": "myField1",
"fieldType": "string",
"isEnabled": "0"
},
{
"type": "field",
"fieldName": "myField2",
"fieldType": "string",
"isEnabled": "1"
}
]
}
}
}
Example 3
The following example requests all available metadata collections for the current user. Although an optional parameter, the "retrieveFields" query parameter supports only the values 0 (collections only) and 1 (collections and fields). If any other value is provided, an error is returned.
GET .../metadata?retrieveFields=abc
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 400
JSON Response
{
"errorCode": "-96",
"errorKey": "!csInvalidFieldValue,abc",
"errorMessage": "'abc' is not a valid field value.",
"title": "'abc' is not a valid field value.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}