Creating a node link
Request
To create a node link (that is, an entity that allows you to associate multiple nodes with a single editorial content or content group), send a POST request to:
https://<host>:<port>/metadata/content/v1/nodeLinks
A POST request creates a single node link. A PUT request can create multiple node links as a single request.
Headers
Content-Type: application/json
Mandatory arguments
All of the following arguments are part of the request body:
nodeRef
– the node the node link applies to. Either:id
– the ID of the node, or- Both
providerId
andproviderResourceId
resourceRef
– the entity (editorial or content group) being linked to the node.- Either:
id
– the ID of the editorial/content group, or- Both
providerId
andproviderResourceId
type
– the type of the entity, one of:editorialContent
contentGroup
- Either:
Other arguments
All of the following arguments are part of the request body:
- Either:
id
– the ID of the node link, or- Both
providerId
andproviderResourceId
publishToEndUser
– flag to indicate to a client app whether it should display the content to the user or not (true or false)start
– node link validity start dateend
– node link validity end datepreviewDate
– preview date for use by client appstechnicalType
– the technical type of the node linkmetadataSet
– 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>"
}]
Example
A POST request with this payload creates a node link that links the specified editorial content to the specified node:
{
"nodeRef": {
"id": "NODE_1"
},
"resourceRef": {
"type": "editorialContent",
"id": "9462470"
}
}
Response
A successful request returns an HTTP 200 status.
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.