Add Metadata Node
OVERVIEW
Overview
Add a Metadata Node to Publisher
This API call is used to add a Metadata Node to the system.
Since v5.1
HTTP Request
POST /api/2/metadata/
HTTP Request Object
Metadata object, either in JSON or XML format.
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 summary object
(Example below)
Example HTTP Request & Response
Example: Metadata with 1 level
POST http://example.com/context/api/2/metadata/
{
"metadatanodes": {
"name": "Department"
"displayname": {
"en_GB": "Department",
"fr_FR": "Département"
}
"status": "active",
"issystemnode": false,
"visibility": {
"
"
"
"
},
"selectionmode": "single",
"categories": [
{
"metadata": [
{
"name": "Marketing",
"status": "active",
"externalmappingname": "",
"internalmappingname": "",
"externalids": [],
"image": null,
"imagename": "",
"translations": {
"en_GB": "Marketing",
"fr_FR": "Département Commercial"
}
},
{
"name": "Finance",
"status": "active",
"externalmappingname": "finance",
"internalmappingname": "",
"externalids": [],
"image": null,
"imagename": "",
"translations": {
"en_GB": "Finance",
"fr_FR": "Département Financier"
}
}
]
}
]
}
}
JSON Response
{
"metadata": {
"id": 36,
"name": "Department",
"link": "http://example.com/context/api/2/metadata/36"
}
}
Example: Metadata with 2 level
POST http://example.com/context/api/2/metadata/
{
"metadatanodes": {
"name": "Colours"
"displayname": {
"en_GB": "Colours",
"fr_FR": "Les couleurs"
}
"status": "active",
"issystemnode": false,
"visibility": {
"
"
"
"
},
"selectionmode": "single",
"categories": [
{
"category": "Pink",
"translations": {
"en_GB": "Pink",
"fr_FR": "Rose"
},
"metadata": [
{
"name": "Magenta",
"status": "active",
"translations": {
"en_GB": "Magenta",
"fr_FR": "Magenta"
}
},
{
"name": "Peach",
"status": "active",
"translations": {
"en_GB": "Peach",
"fr_FR": "Pêche"
}
}
]
},
{
"category": "Blue",
"translations": {
"en_GB": "Blue",
"fr_FR": "Bleu"
},
"metadata": [
{
"name": "Navy",
"status": "active",
"translations": {
"en_GB": "Navy",
"fr_FR": "Marin"
}
},
{
"name": "Teal",
"status": "active",
"translations": {
"en_GB": "Teal",
"fr_FR": "Sarcelle"
}
}
]
},
{
"category": "Green",
"translations": {
"en_GB": "Green",
"fr_FR": "Vert"
},
"metadata": [
{
"name": "Emerald",
"status": "active",
"translations": {
"en_GB": "Emerald",
"fr_FR": "Émeraude"
}
}
]
}
]
}
}
JSON Response
{
"metadata": {
"id": 37,
"name": "Colours",
"link": "http://example.com/context/api/2/metadata/37"
}
}
Comments
0 Comments