OpenTV ENTera & OpenTV Platform Documentation

Use case test page

Request

To create a bundle of products, send a POST request to:

http://<host>:<port>/commercial/v1/bundles

Note that a bundle is an entity that only exists within Orders. A bundle can only be created and managed through the Orders APIs – it cannot be created via ingest or using the CPM APIs.

Mandatory fields (in body)

  • metadata

    • title – bundle title

    • description – bundle description

  • recurrence – the units for minDuration (DAILY, WEEKLY, MONTHLY, or YEARLY)

  • minDuration – the minimum duration for the bundle (that is, the minumum period during whihc its content is available to the customer). For example, if recurrence is MONTHLY and minDuration is 1, the minumum duration is one month.

  • availability

    • start – the start date from which the bundle is available (in ISO-8601 UTC format)

    • end – the end date, after which the bundle will no longer be available (in ISO-8601 UTC format)

For all available fields, see Orders API documentation.

Example

A request with this payload creates a bundle containing the specified products:

{
  "metadata": {
    "en_GB": {
      "title": "Gold",
      "description": "Premier content"
    },
    "fr_FR": {
      "title": "d'Or",
      "description": "Le meilleur"
    }
  },
  "products": [
    "entertainment_1",
    "movies_7",
    "sport_3"
  ],
  "price": 12.99,
  "currency": "GBP",
  "recurrence": "monthly",
  "minDuration": 1,
  "availability": {
    "start": {},
    "end": {}
  },
  "external": {
    "externalId": "310-772-7393",
    "url": "http://crm.mpp.co.uk/products/310-772-7393"
  }
}

Response

A successful request returns an HTTP 201 status. The response includes the complete bundle object.

An unsuccessful request returns an HTTP 400 request if there was a problem with the request.

See also

For full details of this API, see Orders API documentation.

Important

Access and authentication information

There are three categories of API:

  • Client APIs – used by client applications

  • Operator APIs – used by operators

  • Admin APIs – used for communication between modules

The categorised lists of APIs are available in Service endpoint categories.

The subdomain used for API calls is different for each external-facing API category:

  • Client APIs use the api subdomain.

  • Operator APIs use the operator subdomain.

Both client and operator APIs require authentication – these are detailed in the Client APIs and Operator APIs sections below.

Client APIs

OpenTV Platform uses NGINX to ensure that only authenticated clients can use client-facing APIs. It expects the client to supply the token that it received at signon, as:

  • An authorization header with prefix in the value of Bearer,

  • A Client-token header,

  • A query string parameter in the URL, or

  • If the request is a POST, token in the post arguments.

For backward-compatibility, the older MediaLive Identity Token is still supported.

NGINX validates and decodes the token and passes it on to the module as a token in the header – which is why the following API documentation may refer to token rather than the options mentioned above.

Operator APIs

All operator APIs use Keycloak to authenticate the caller before requests can be made. This is explained in detail in Accessing operator APIs using Keycloak.

See also

Open API Spec