Creating product links
Request
To create one or more product links (that is, to associate one or more entities (editorial contents, editorial channels, content groups, etc.) to one or more products), send a PUT request to:
https://<host>:<port>/metadata/content/v1/productLinks
Headers
Content-Type: application/json
Mandatory arguments
All of the following arguments are part of the request body:
A
productLinkSet
block containing one or more blocks, each of which represents one product like, and that contains the following:A
validityPeriodSet
that specifies one or more validity periods for the product link. This block contains one or more blocks that contain:start
– validity period start date in ISO 8601 formatend
– validity period end date in ISO 8601 format
A
productRef
block that specifies the product to which entities are being linked. This block contains:Either:
id
– the ID of the product, orBoth
providerId
andproviderResourceId
A
marketableRef
that specifies the entity being linked to the product. This block contains:Either:
id
– the ID of the entity, orBoth
providerId
andproviderResourceId
type
– the entity type. It must be one of the following:technicalChannel
node
event
editorialContent
editorialChannel
contentGroup
The specified validity period(s) is not enforced. The validity periods on the product and on individual editorials and technicals determine the visibility of individual items.
Other arguments
The following parameter can be specified within a block within productLinkSet
(that is, as a sibling element to productRef
, marketableRef
, and so on):
published
– a flag (true or false) that allows you to indicate whether the resources should be published (displayed) to the end user or not.
Example
A PUT request with this payload links the specified editorial content to the specified product:
{
"productLinkSet": [
{
"validityPeriodSet": [{
"start": "2020-06-10T00:00:00Z",
"end": "2025-07-01T00:00:00Z"
}],
"productRef": {
"id": "PROD19666667-F-SUB-SD"
},
"marketableRef": {
"type": "editorialContent",
"id": "9462470"
}
}
]
}
Response
A successful request returns an HTTP 200 status. The response body contains the URIs of the created product links.
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.