OpenTV ENTera & OpenTV Platform Documentation

Ingesting a product link

Request

To ingest one or more product links, that is, to associate one or more marketables (for example, contents and/or channels) with one or more products, send a PUT request to:

Bash
http://<server>:<port>/cpm/content/v1/productLinks

Mandatory fields

  • productRef

    • id – the ID of the product to which to associate the marketable

  • marketableRef

    • type – the marketable type. One of:

      • editorialChannel

      • technicalChannel

      • event

      • editorialContent

      • contentGroup

      • node

      • nodeLink

    • id – the ID of the marketable to associate with the product

Example

A request with this payload links the specified channel to the specified product:

JSON
{
    "productLinkSet": [
        {
            "productRef": {
                "_id": "PROVIDER_ID_001_PROVIDER_RESOURCE_ID_001"
            },
            "marketableRef": {
                "type": "technicalChannel",
                "_id": "tchp01_tchpr01"
            }
        }
    ]
}

Response

A successful request returns an HTTP 200 status and the URIs of the product links.

A bad request returns an HTTP 400 status.

All PUT and POST calls to CPM are validated by the Validation Service. If there is a problem with the data you are submitting, you will receive one of the following:

  • Error – the data is invalid, so the request fails.
    The error message will indicate which data is invalid and why.

  • Warning – there is an issue with the data that does not prevent it from being added/updated in CPM, but that you need to be aware of.
    For example, if a mandatory field has no value for a non-primary locale (but the same field for the primary locale does have a value), you will get a warning rather than an error.
    The warning message will indicate which data is invalid and why.

Note that there are still conditions where a request can pass validation, but fail when it reaches CPM, so you must handle such responses in an appropriate way too.

In addition, all such errors and warnings:

  • Are available as a report in Data Warehouse (errors only).

  • Generate alert emails that are sent to the email addresses that were configured when the system was deployed.

Note: this data only becomes available in the report 60–90 minutes after the error occurs (and the email is sent).




Example

A successful request returns a payload that looks like this:

JSON
{
    "totalRecords": 1,
    "selfSet": [
        "http://api.demo.otv-se.com/rest/api/content/v1/productLinks/technicalChannel/tchp01_tchpr01/product/PROVIDER_ID_001_PROVIDER_RESOURCE_ID_001"
    ]
}

See also

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