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

Handling client application version checks

Overview

An operator can make OpenTV Platform warn or refuse devices that run an old version of the client application, so that users upgrade. The operator sets a warning version and an error version for each device profile – see Managing client application version checks in the Subscriber management integration guide.

For this to work, the client application must send its version every time it signs in or refreshes its tokens, and handle the responses described on this page.

Sending the application version

Send the client-application-version header with the version of the client application, for example:

Bash
client-application-version: 4.2.0

The version must be in the form major.minor.patch – three whole numbers separated by full stops, with nothing else (for example 4.2.0, not 4.2, v4.2.0 or 4.2.0-beta). If the header has any other value, the request is refused with an HTTP 400 status ("errorCode": 6011), even on a platform where the version check is switched off. If the client application can’t send a valid version, it mustn’t send the header.

Send the header on all these requests:

  • The sign-in requests – POST /ias/v3/token/actions/signOnByUserNamePassword, signOnByCasn, dasSignOnByCasn, signOnBySmartCardId, signOnByTVKeyActivation, signOnByAccountId and signOnBySignOnActivationToken (see Authentication token)

  • The token refresh request – POST /ias/v3/token/actions/refresh (see Refresh token)

  • Guest sign-in – POST /ias/v3/guestSignOn and POST /ias/v2/anonymoustoken

  • DAS sign-in – POST /ias/v3/das-token

The header is ignored on the other IAS requests, for example switching user profile or getting a content token.

On the first sign-in on a device (a request with deviceInformation and no clientId), OpenTV Platform checks the header but doesn’t store it. So also send the version, and the application’s name, in deviceInformation, in the application object (name and version). On later sign-ins and refreshes, a valid header updates the stored version.

Handling the response

How the client application should react depends on the response:

  • HTTP 200 status, no client-application-version-warning header – the application is up to date, or the platform doesn’t check versions.

  • HTTP 200 status with a client-application-version-warning header – the sign-in or refresh has worked, and the client gets its tokens as usual, but the application is out of date. Ask the user to upgrade, and let them carry on using the application. Check whether the header is there – don’t rely on its text (currently Client application version is outdated and should be updated).

  • HTTP 403 status with "code": 20017 – the application is too old to sign in or refresh its tokens. Tell the user that they must upgrade, for example with a link to the app store. Don’t retry the request with the same version.

  • HTTP 400 status with "errorCode": 6010 – the platform requires the client-application-version header, and the request didn’t send it.

  • HTTP 400 status with "errorCode": 6011 – the client-application-version header isn’t in the major.minor.patch format.

For example, a refused request returns this response body:

JSON
{
  "code": 20017,
  "errorCode": 6060,
  "message": "Invalid request"
}

Use code to recognise a refused request. The message is generic, and "errorCode": 6060 is also used for other sign-in errors.

signOnByTVKeyActivation refuses an old application version with an HTTP 403 status, but with "code": 403 and "errorCode": 4502 instead of "code": 20017.

Tokens that the client already has aren’t withdrawn when its version is refused. They stay valid until they expire, but the client can’t refresh them.

See also