B-Deploy Device Endpoints (v2)

 

These endpoints allow users to automatically provision BrightSign players over the internet. This endpoint handles everything regarding individual players if you add your serial number to BrightSign’s cloud storage with an associated player name, provisioning package name, and the URL where the provisioning package is hosted. The URL is optional - it can be left blank if using a setup package.

Base URL for these endpoints:  https://provision.bsn.cloud/rest-device/v2/device/


GET 

Retrieves a device object associated with the B-Deploy account.

URL Parameters

  • _id string: The unique identifier of the device object to retrieve. If this parameter is not included in the URL, the GET request will return all device objects associated with the account

___________________________________________________

Request Example

  • _id is set to abcd123456789

GET /rest-device/v2/device/?_id=abcd123456789 HTTP/1.1 Host: provision.bsn.cloud Content-Type: application/json Authorization: {{Bearer Token}}

___________________________________________________

Success Response Body

200: Contains a single device object if the _id is specified in the URL; otherwise, this property contains the following:

  • total int: The total number of device objects that belong to the B-Deploy account

    • matched int: The number of device objects contained in the response

    • Players device[ ]: An array of device objects. Each device object can contain the following properties:

      • _id string: The unique identifier of the device object 

      • setupId string: The id of the device setup object associated with the device object. The player will use the associated device setup to provision itself.

      • serial string: The serial number of the player represented by the device object

      • createdAt string: A UTC timestamp indicating when the device setup object was created. The date/time is formatted as yyyy-mm-ddThh:mm:ss.sssZ

      • updatedAt string: A UTC timestamp indicating when the device setup object was last modified. The date/time is formatted as yyyy-mm-ddThh:mm:ss.sssZ

      • url string: An optional value of the Partner Application URL specified for a device to use when finding the application to download.

      • client string

      • __v string

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

403: The supplied access token, though valid, doesn't provide access to this method.

5XX: Any 500 code is an internal server error

POST 

Adds a device object to the B-Deploy account. You must either pass an application package url or a setupId:

  • If you want to use setupId, you must add a setup record and then run POST /setup/ to get the id.

  • If you want to directly download an application package to your device without worrying about setup, use url

Request example bodies for both request types are below.

Request Body

  • username string: The BSN.Cloud username

  • serial string: The serial number of the player represented by the device object

  • name string: The name of the setup file

  • NetworkName string: The name of the network

  • model string optional: The player model

  • desc string: The player description

  • userdata string optional: Allows you to send additional header information with your setup or application package.

  • url string optional: The URL from which the player will download its presentation as part of the final provisioning step

  • setupId string optional: The id of the device setup object associated with the device object. The player will use the associated device setup to provision itself.

Request Example

POST /rest-device/v2/device HTTP/1.1 Host: provision.bsn.cloud Content-Type: application/json Authorization: {{Bearer Token}} Content-Length: 252

This is an example request body with a url:

{ "username": "JaneDoe@brightsign.biz", "serial": "ABCD00000001", "name": null, "NetworkName": "Test", "model": "", "desc": "Jane's player", "userdata": "", "url": "https://provisiondemo.brightsignnetwork.com/autorun.zip" }

This is an example request body with a setupId:

___________________________________________________

Success Response

201: The unique identifier of the device object

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

403: The supplied access token, though valid, doesn't provide access to this method 

415: The server cannot accept the data representation that you sent (as specified in the header)

5XX: Any 500 code is an internal server error

PUT 

Modifies a device object associated with the B-Deploy account.

Request Body

  • _id string: The unique identifier of the device object to retrieve

  • username string: The BSN.Cloud username

  • serial string: The serial number of the player represented by the device object

  • name string: The name of the setup file

  • NetworkName string: The name of the network

  • model string optional: The player model

  • desc string: The player description

  • setupId string: The id of the device setup object associated with the device object.

  • userdata string optional: Allows you to send additional header information with your setup or application package.

___________________________________________________

Request Example

  • _id is set to 123456789

This is the example request body:

___________________________________________________

Success Response

200: The existing device setup has been updated

Failure Response

400: Either the request or request body is malformed and therefore invalid

401: The access token is invalid or not specified

403: The supplied access token, though valid, doesn't provide access to this method 

415: The server cannot accept the data representation that you sent (as specified in the header)

5XX: Any 500 code is an internal server error

DELETE 

Removes a device object from the B-Deploy account.

URL Parameters

You can pass either the id or the serial number of the player:

  • _id string optional: The player database record identifier

  • serial string optional: The unique identifier of the player

___________________________________________________

Request Example

___________________________________________________

Success Response

200: The specified device object has been removed

Failure Response

400: The request is malformed and therefore invalid

401: The access token is invalid or not specified

403: The supplied access token, though valid, doesn't provide access to this method 

5XX: Any 500 code is an internal server error

 

 

Â