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:
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
-
Authorization– Keycloak access token for an operator user (see Accessing operator APIs using Keycloak) -
Content-Type: application/json
Mandatory arguments
-
uid(in URL) – the ID of the device profile (its_id), for exampleDEFAULT
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 formmajor.minor.patch, for example2.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 formmajor.minor.patch, for example1.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:
{
"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:
{
"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.