Overview
A client can update the device information that OpenTV Platform holds for the device it is running on – for example, after the app or the device's operating system has been upgraded, or when the device's screen or supported DRM systems, codecs or streaming formats change. The device is identified from the client's access token, so a device can only update its own information.
The update is partial: OpenTV Platform merges the arguments that you send into the stored device information, and keeps every stored value that you do not send.
The application version is also updated when the client sends the client-application-version header on a sign-in or token refresh request (except on the device’s first sign-in) – see Handling client application version checks.
How the update is applied:
-
Send only the values that have changed. Anything that you leave out keeps its stored value.
-
Objects are merged field by field. For example, if you send only
device.OS.version, the stored OS type and screen details are kept. -
An array replaces the stored array. For example, to add a DRM system, send the complete list in
securePlayer.DRMs. -
A
nullvalue is ignored, so you cannot usenullto remove a stored value.
You cannot change the device's hardware details (device.hardware: model, manufacturer and type) or its deviceType with this request. If you include them, they are ignored. Updating the device information does not change the device's profile (deviceProfileId).
To change the device's name, see Update device name.
Request
To update the device information for the current device, send a PUT request to:
https://<host>:<port>/adm/v1/user/devices/actions/updateDeviceInformation
Headers
-
Authorization– the client's access token, as a bearer token (Bearer <access token>). This is theaccess_tokenthat the client gets when it signs in – see Authentication token. -
Content-Type: application/json
Mandatory arguments
None. However, the request body must contain a value for at least one of the other arguments.
Other arguments
All these arguments are in the request body:
-
securePlayer– the capabilities of the device's secure player. It can have the following fields:-
DRMs– an array of the DRM systems that the device supports. -
codecs– an array of the codecs that the device supports. -
streamings– an array of the streaming formats that the device supports.
-
-
device– the device's physical characteristics. It can have the following fields:-
screen– the device's screen, with the string fieldsheight,widthanddensity. -
OS– the device's operating system, with the string fieldstypeandversion.
-
-
application– the client application installed on the device. It can have the following fields:-
name– the name of the application. -
version– the version of the application.
-
-
msgPlatform– the messaging platform for the device:fcm,iot,firebase,fireTvorSTB. If you set it, OpenTV Platform no longer works out the messaging platform from the device's details. -
playoutDeviceClass– the playout device class for the device. This should be one of the device classes defined for device-specific products. If you do not send it and the device has no stored value, the device's profile ID is used. It is only stored where device-specific products are enabled.
Examples
A request with this payload records an app upgrade and a new OS version:
{
"application": {
"name": "MyTVApp",
"version": "4.2.0"
},
"device": {
"OS": {
"type": "Android",
"version": "14"
}
}
}
A request with this payload replaces the device's lists of supported DRM systems, codecs and streaming formats:
{
"securePlayer": {
"DRMs": [
"SSP"
],
"codecs": [
"H264",
"H265"
],
"streamings": [
"DASH",
"HLS"
]
}
}
Response
A successful request returns an HTTP 200 status. The response body gives the number of devices that were matched and updated, for example:
{
"matchedCount": 1,
"modifiedCount": 1
}
A bad request returns an HTTP 400 status – for example, if the request body is missing (error code 4002), or if it does not contain a value for any of the arguments (error code 4003):
{
"message": "The request payload does not contain valid device information for updateDeviceInformation.",
"code": 400,
"errorCode": 4003
}
An unauthorised request returns an HTTP 401 status – for example, if the account is not active, or if the device is disabled or not activated.
A forbidden request returns an HTTP 403 status – for example, if the access token is missing, invalid, or has expired.
If the update cannot be merged with the stored device information, the request returns an HTTP 500 status (error code 4004).
See also
For full details of this API, see the Account and Device Manager (ADM) API documentation.