Get Metadata Node
OVERVIEW
Overview
Get a Metadata Node from Publisher. This API call is used to retrieve a Metadata Node from the system. The metadata node identifier is either it's id or it's name.
Since v5.0
Enhanced v5.1
HTTP Request
GET /api/2/metadata/<ID>
OR
GET /api/2/metadata/<NAME>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the metadata node to retrieve |
NAME | The name of the metadata node to retrieve |
HTTP Headers
HTTP Request Header | Description | Example |
---|---|---|
Authorization | The API Authorisation token | "Bearer XXXXXXXXXXXXX" |
Accept |
The format of the expected response
If no parameter is set, JSON is the default response given. |
"application/xml" |
Content-Type |
The format of the provided content
If no parameter is set, JSON is the expected content by default. |
"application/json" |
HTTP Response
Success
HTTP response 200 with Metadata Node object
(Example below)
Metadata doesn't exist Error
If the requested Metadata node does not exist:
HTTP response 404
{
"error": {
"summary": "The requested metadata does not exist",
"ref": "176",
"link": "https://example.com/context/api/2/error/16598"
}
}
Example HTTP Request & Response
Example: Metadata with 1 level
GET http://example.com/context/api/2/metadata/4
OR
GET http://example.com/context/api/2/metadata/UK%20Countries
JSON Response
{
"metadatanodes": {
"id": 4,
"name": "UK Countries",
"displayname": {
"en_GB": "UK Countries",
"fr_FR": "Pays du Royaume Uni"
},
"status": "active",
"issystemnode": false,
"visibility": {
"
"
"
"
},
"selectionmode": "multi",
"categories": [
{
"id": 10,
"metadata": [
{
"id": 292,
"name": "England",
"status": "active",
"externalmappingname": "Eng",
"internalmappingname": "EN",
"externalids": [
"england",
"eng",
},
"image": "https://example.com/context/image.jpg",
"imagename": "england-flag",
"translations": {
"en_GB": "England",
"fr_FR": "Angleterre"
}
},
{
...
}
]
}
]
}
}
Example: Metadata with 2 level
GET http://example.com/context/api/2/metadata/1
OR
GET http://example.com/context/api/2/metadata/Countries
JSON Response
{
"metadatanodes": {
"id": 4,
"name": "Countries",
"displayname": {
"en_GB": "Countries",
"fr_FR": "Des pays"
},
"status": "active",
"issystemnode": true,
"visibility": {
"
"
"
"
},
"selectionmode": "single",
"categories": [
{
"id": 1,
"category": "Africa",
"translations": {
"en_GB": "Africa",
"fr_FR": "Afrique"
},
"metadata": [
{
"id": 1,
"name": "Algeria",
"status": "active",
"externalmappingname": "Alg",
"internalmappingname": "DZ",
"externalids": [
"algeria",
"alg",
},
"image": "https://example.com/context/image.jpg",
"imagename": "algeria-flag",
"translations": {
"en_GB": "Algeria",
"fr_FR": "Algérie"
}
},
{
"id": 2,
"name": "Angola",
"status": "active",
"externalmappingname": "Ang",
"internalmappingname": "AO",
"externalids": [
"angola",
"ang",
},
"image": "https://example.com/context/image.jpg",
"imagename": "angola-flag",
"translations": {
"en_GB": "Angola",
"fr_FR": "Angola"
}
},
...
]
},
{
"id": 2,
"category": "Americas",
"translations": {
"en_GB": "Americas",
"fr_FR": "Amérique"
},
"metadata": [
{
"id": 59,
"name": "Anguilla",
"status": "active",
"externalmappingname": "Agu",
"internalmappingname": "AI",
"externalids": [
"anguilla",
"agu",
},
"image": "https://example.com/context/image.jpg",
"imagename": "anguilla-flag",
"translations": {
"en_GB": "Anguilla",
"fr_FR": "Anguilla"
}
},
...
]
},
{
"id": 3,
"category": "Asia",
"translations": {
"en_GB": "Asia",
"fr_FR": "Asie"
},
"metadata": [
...
]
},
...
]
}
}
Comments
0 Comments