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
andproviderResourceId
name
– the name of the nodeparentRef
– 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
andproviderResourceId
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
andproviderResourceId
orderingFields*
– specifies the return order of the node's itemstimeShifting*
– specifies whether timeshifting is enabled for the node. It contains:shortTermCatchUpSupport*
– whether STCU is enabled or notlongTermCatchUpSupport
*
– whether LTCU is enabled or notstartOverSupport
– whether start-over is enabled or notnetworkPvrSupport
– whether NPVR is enabled or not
start
– the node's validity start date in ISO 8601 formatend
– the node's validity end date in ISO 8601 formatmetadataSet
– a set of locale-specificmetadata
blocks, each of which has:locale*
– the locale for themetadata
element. If locale is set to none, themetadata
block that it applies to is the default – it is the one that is used if there is nometadata
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 titleRating
– the node's rating
Examples
A POST request with this payload creates a root node:
{
"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:
{
"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.