Update 1st Level Metadata Category
OVERVIEW
Overview
Update 1st level Metadata Category of Publisher
This API call is used to modify an individual Metadata category that belongs to an existing metadata node in the system. It cannot perform bulk updates, but will simply update a single category.
Since v5.1
HTTP Request
PUT /api/2/metadata/<ID>/categories/<CATEGORYID>
OR
PUT /api/2/metadata/<NAME>/categories/<CATEGORYID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the metadata to update |
NAME | The name of the metadata to update |
CATEGORYID | The ID of the 1st level category to update |
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 summary object for the parent metadata object
(Example below)
Example HTTP Request & Response
Example: Metadata with 1 level
PUT http://example.com/context/api/2/metadata/34/categories/284
{
"category": {
"category": "England",
"status": "active",
"externalmappingname": "Eng",
"internalmappingname": "EN",
"externalids": [
"england",
"eng",
],
"imagename": "england-flag",
"translations": {
"en_GB": "England",
"fr_FR": "Angleterre"
}
}
}
JSON Response
{
"metadata": {
"id": 34,
"name": "Countries",
"link": "http://example.com/context/api/2/metadata/34"
}
}
Example: Metadata with 2 level - update the category node
POST http://example.com/context/api/2/metadata/46/categories/387
{
"category": {
"category": "Africa",
"translations": {
"en_GB": "Africa",
"fr_FR": "Afrique"
}
}
}
JSON Response
{
"metadata": {
"id": 46,
"name": "Countries",
"link": "http://example.com/context/api/2/metadata/46"
}
}
Comments
0 Comments