GET /re-provision/
Calling this endpoint will re-provision the player (in other words, the B-Deploy setup currently associated with the player will be downloaded, and the device will go through setup again). The BrightAuthor:connected UI feature that uses this functionality is Reprovision Player.
The re-provision process involves the following steps:
If the “networking” section of the player’s registry contains the access and refresh tokens, it is assumed that the player was previously set up for BSN.cloud. So BrightSign keeps some setup-related keys in the networking section (these keys are listed in the expander below) and deletes the rest of the registry entries. If the networking section does not include access and refresh tokens, it will empty the whole networking section, format the SD card, and reboot to try to provision the player.
BrightSign also sets the “deviceSetupComplete“ parameter in the “autorun” section to null, so that the player can set up again. This key is set to 1 only if the player was previously set up through the on-device setup option.
The code removes all files from the default storage device (this is almost always the SD card). You do not need to format the storage separately.
The player reboots, fetches the setup package from B-Deploy, and re-provisions itself.
Setup-Related Keys
Request Example
GET /rest/v1/re-provision/?destinationType=player&destinationName={{deviceSerial}} HTTP/1.1 Host: ws.bsn.cloud Authorization: Bearer {{UserAccessToken}} Accept: application/json, application/vnd.bsn.error+json
Response Body
success
bool:True
means that the operation succeeded and the player will reboot.False
means that the operation failed.
Response Example
{ "route": "/v1/re-provision", "method": "GET", "data": { "result": { "success": true } } }
POST /snapshot/
Takes a screenshot of the current screen contents and saves it to storage. See Remote DWS APIs#RequestMessageFormat for the Query String Parameters.
Request Example
POST /rest/v1/snapshot/?destinationType=player&destinationName={{deviceSerial}} HTTP/1.1 Host: ws.bsn.cloud Authorization: Bearer {{UserAccessToken}}
Response Body
remoteSnapshotThumbnail
string: A snapshot image thumbnail in Base64 formatfilename
string: The name and path of the snapshot image file. CallGET /file/{:path
} to retrieve the full-resolution image.timestamp
string: The date and time the snapshot was taken. The date/time is formatted as "yyyy-mm-dd hh:mm:ss <timezone>"
.
Response Example
{ "route": "/v1/snapshot", "method": "POST", "data": { "result": { "remoteSnapshotThumbnail": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4QDeRXhpZgAASUkqAAgAAAABAGmHBAABAAAAGgAAAAAAAAAKAA8BAgALAAAAtAAAAB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KACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKAP8A/9k=", "filename": "/sd/remote_snapshots/img-2024-02-07-11-36-30.jpg", "timestamp": "2024-02-07 11:36:33 PST", "devicename": "XD5-RE433D006644", "width": 1920, "height": 1080 } } }
PUT /custom/
Sends custom data to the player. The player in turn sends the data as a message (in JSON string format) on UDP port 5000, which can then be captured by the autorun.brs or a JavaScript application on the player.
Request Body
command
string: The custom data to sendreturnImmediately
bool: A flag specifying whether the server should respond to the PUT request immediately (true
) or wait on a response to the UDP message from the BrightScript/JavaScript application (false
).
Request Example
PUT /rest/v1/custom/?destinationType=player&destinationName={{deviceSerial}} HTTP/1.1 Host: ws.bsn.cloud Authorization: Bearer {{UserAccessToken}} Accept: application/json, application/vnd.bsn.error+json Content-Type: application/json Content-Length: 89
This is the example request body:
{ "data": { "command": "next", "returnImmediately": true } }
Response Body
If the returnImmediately
property is true
, the server will return a success or error message. If the property is false
, the server will wait for a response from UDP port 5000 on the player and send it as the response to the PUT request.
Response Example
{ "data": { "result": { "success": true } }, "route": "/v1/custom", "method": "PUT" }
GET /download-firmware/
Instructs the player to download and apply a firmware update.
Query String Parameter
url
string: The public URL for downloading the firmware-update file.
Request Example
GET /rest/v1/download-firmware/?url=https://bsncloud.s3.amazonaws.com/public/cobra-9.0.110-update.bsfw&destinationType=player&destinationName={{deviceSerial}} HTTP/1.1 Host: ws.bsn.cloud Authorization: Bearer {{UserAccessToken}} Accept: application/json, application/vnd.bsn.error+json
Response Body
success
bool: A flag indicating whether the download was successfulreboot
bool: A flag indicating whether the player will reboot when applying a firmware update
Response Example
{ "route": "/v1/download-firmware", "method": "GET", "data": { "result": { "success": true, "reboot": true } } }