Skip to main content
Skip table of contents

Creating a node

Request

To create a node, send a POST request to:

https://<host>:<port>/metadata/content/v1/nodes

Headers

  • Content-Type: application/json

Mandatory arguments

All of the following arguments are part of the request body:

  • Either:
    • id – the ID of the node, or
    • Both providerId and providerResourceId
  • name – the name of the node
  • parentRef – the parent node ID (not required if this is a root node). This is expressed as either:
    • id – the ID of the parent node, or
    • Both the providerId and providerResourceId of the parent node

Other arguments

The following arguments (all in the request body) are all optional.

However, they may be required by ION (if you are using it). These are indicated with an asterisk (*).

  • position – the node's position relative to its siblings. A node with a lower value is higher in the list than one with a higher value. Two nodes can have the same value for position, but in this case, the order is not guaranteed.
  • preferenceSet* – reference to editorial contents and/or content groups that belong to the node. This contains one or more blocks, each of which contains either:
    • id – the ID of the editorial content/content group, or
    • Both providerId and providerResourceId
  • orderingFields* – specifies the return order of the node's items
  • timeShifting* – specifies whether timeshifting is enabled for the node. It contains:
    • shortTermCatchUpSupport* – whether STCU is enabled or not
    • longTermCatchUpSupport* – whether LTCU is enabled or not
    • startOverSupport – whether start-over is enabled or not
    • networkPvrSupport – whether NPVR is enabled or not
  • start – the node's validity start date in ISO 8601 format
  • end – the node's validity end date in ISO 8601 format
  • metadataSet – a set of locale-specific metadata blocks, each of which has:
    • locale* – the locale for the metadata element. If locale is set to none, the metadata block that it applies to is the default – it is the one that is used if there is no metadata block for the user's locale.
    • metadata* – a block containing one or more key/value pairs in the following form:
      [{
      "key": "<key_name>",
      "value": "<value>"
      }]

      You can add whatever keys you require. However, the following values have significance in OpenTV Platform:

      • Title* – the node's title
      • Rating – the node's rating

Examples

A POST request with this payload creates a root node:

CODE
{
    "position": null,
    "parentRef": null,
    "preferenceSet": [],
    "orderingFields": null,
    "timeShifting": null,
    "id": "CAT_OPERATOR_API",
    "providerId": "OPERATOR",
    "providerResourceId": "CAT_OPERATOR_API",
    "name": "CAT_OPERATOR_API_DefaultCatalog",
    "start": null,
    "end": null,
    "metadataSet": [{
        "locale": "none",
        "metadata": [{
            "key": "CMS4MigratedData",
            "value": "true"
        }]
    }]

}}

A POST request with this payload creates a second-level node:

CODE
{
    "position": 2,
    "parentRef": {
        "id": "CAT_OPERATOR_API"
    },
    "preferenceSet": [],
    "orderingFields": null,
    "timeShifting": null,
    "id": "NODE_OPERATOR_API",
    "providerId": "OPERATOR",
    "providerResourceId": "NODE_OPERATOR_API",
    "name": "Operator node for API",
    "start": null,
    "end": null,
    "metadataSet": [{
            "locale": "en_AU",
            "metadata": [{
                    "key": "Title",
                    "value": "Operator api"
                },
                {
                    "key": "CUST_PublishToSDDevice",
                    "value": "true"
                },
                {
                    "key": "CUST_VisibleToRelease",
                    "value": "7"
                },
                {
                    "key": "CUST_ContentProvider",
                    "value": "BBK"
                }

            ]
        },
        {
            "locale": "none",
            "metadata": [{
                    "key": "CMS4MigratedData",
                    "value": "true"
                },
                {
                    "key": "Regions",
                    "value": "DefaultRegion"
                },
                {
                    "key": "Rating",
                    "value": "0"
                }
            ]
        },
        {
            "locale": "xx_xx",
            "metadata": [{
                "key": "Title",
                "value": "x"
            }]
        }
    ]

}

Response

A successful request returns an HTTP 201 status. The response body contains the URI of the newly-created node.

A bad request returns an HTTP 400 status.

See also

For full details of this API, see Content and Product Manager (CPM) API documentation: content v1.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.