Metadata APIs

Add 2nd Level Metadata Label

OVERVIEW

Overview

Add 2nd level Metadata label to Publisher for metadata with 2 levels

This API call is used to add an individual Metadata label to an existing metadata node and category within the system. 

Since v5.1

HTTP Request

POST  /api/2/metadata/<ID>/categories/<CATEGORYID>/labels

OR

POST  /api/2/metadata/<NAME>/categories/<CATEGORYID>/labels

URL Parameters
Parameter Description
ID The ID of the metadata to add the new label to
NAME The name of the metadata to add the new label to
CATEGORYID The ID of the 1st level metadata category to add the new label to

 

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. 

  • "application/json"
  • "application/xml"

If no parameter is set, JSON is the default response given.

"application/xml"
Content-Type

The format of the provided content.

  • "application/json"
  • "application/xml"

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

POST http://example.com/context/api/2/metadata/2/categories/34/labels

 

{

    "label": {

        "name": "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"

    }

}

 

 

Comments


0 Comments

Last Updated: Nov 08,2024