OpenTV ENTera & OpenTV Platform Documentation
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2

Setting the warning and error versions for a device profile

Overview

The warning and error versions are fields of the device profile. To set them, you update the device profile. For what the versions do, see Managing client application version checks.

You can also set them in OpCon, on the Device Profiles tab (Client Warning Version and Client Error Version fields) – see Creating and managing device profiles in the OpCon documentation.

Request

To set the warning and error versions for a device profile, send a PUT request to:

Bash
https://<host>:<port>/adm/v1/deviceProfiles/{uid}

Use this request, not PUT /adm/v1/deviceProfiles/{uid}/versions. That request is listed in the ADM API reference, but it can’t be called from outside OpenTV Platform – it returns an HTTP 403 status.

Headers

Mandatory arguments

  • uid (in URL) – the ID of the device profile (its _id), for example DEFAULT

Other arguments

All the following arguments are in the request body. Send at least one of them. The other fields of the device profile keep their values.

  • clientWarningVersion – devices with this profile that run this version of the client application, or a lower one, get a warning when they sign in or refresh their tokens. Use the form major.minor.patch, for example 2.0.0.

  • clientErrorVersion – devices with this profile that run this version of the client application, or a lower one, can’t sign in or refresh their tokens. Use the form major.minor.patch, for example 1.5.0.

The versions only take effect when Check Client Version is switched on in OpCon – see Managing client application version checks.

Example

A request with this payload refuses devices running version 1.5.0 or lower, and warns devices running versions from 1.5.1 to 2.0.0:

JSON
{
  "clientWarningVersion": "2.0.0",
  "clientErrorVersion": "1.5.0"
}

Response

A successful request returns an HTTP 200 status. The response body gives the number of device profiles that were matched and updated, for example:

JSON
{
  "matchedCount": 1,
  "modifiedCount": 1
}

If the device profile doesn’t exist, the request still returns an HTTP 200 status, with "matchedCount": 0.

A bad request returns an HTTP 400 status – for example, if a version isn’t in the major.minor.patch format ("errorCode": 4303).

An unauthorised request returns an HTTP 401 status – for example, if the access token is invalid or has expired.

A forbidden request returns an HTTP 403 status – for example, if the access token is missing or the user doesn’t have the right role.

To check the versions that are set, send a GET request to https://<host>:<port>/adm/v1/deviceProfiles/{uid}. The response includes clientWarningVersion and clientErrorVersion as top-level fields, if they are set.

See also

For full details of this API, see the Account and Device Manager (ADM) API documentation.