Diagnostic Web Server APIs
Local DWS APIs
8min
you can use the apis locally with the dws (to use the bsn control apis for interacting with a player, see remote dws apis docid\ kku9e7f7chc5lwofxs9e0 ) there are two ways to access these apis you can choose to use no authentication you can choose to use digest authentication digest authentication uses a username and a password the username is always “admin” the password can be set in three ways use the default, which is the player serial number set it through the setup package set it using a custom script once the password is set, you need to authenticate to access the local dws apis to do this use brightsignos 8 1 21 or higher, such as 8 2, and 8 3 (except 8 3 39 x) note that bos 8 3 39 3 and 8 4 6 and higher may have some unexpected behaviors turn on the local dws in brightauthor\ connected in the control tab of the remote dws see diagnostic web server (dws) docid\ qxt4yhey7iej m9dh73wm for more information call the desired api using digest authentication with the local dws username and password note that digest authentication is fairly insecure when used over an insecure transport (http) the url prefix is always http //player ip/api advanced usage if you choose to set the registry "bbhf" directly instead of through the brightauthor\ connected ui (described in step 2, above), note that bbhf is in the networking section of the registry if bbhf is set, the bsn cloud dws is enabled, and all dws apis are enabled if bbhf is unset, only the "legacy" dws and the "legacy" dws apis are enabled the legacy dws is pre bsn cloud and does not use bsn cloud functions all post and put api calls have response and request bodies of type json api definitions the listed apis are prefixed with the version /v1 to preserve backwards compatibility, brightsign will create a /v2 version for any api changes and attempt to retain the semantics and behavior of /v1 but this may not be possible we can not guarantee that this document will be current in every case /packet capture/ downloading a file from player storage to directly download a file from player storage, add ?contents\&stream to the end of the url here is a sample workflow (assuming a base url of http //192 168 0 12/api/v1 ) create a snapshot on the sd card under the remote snapshots using post /v1/snapshot the response will be the name of the snapshot (for example, img 2021 12 29 10 49 27 jpg ) to directly download the snapshot created on the player get http //192 168 0 12/api/v1/files/sd/remote snapshots/img 2021 12 29 10 49 27 jpg?contents\&stream if you enter only ?contents , you get the file in the base64 encoding using https with the local dws you can use either a valid certificate or a self signed certificate generating a self signed certificate and key to do this, choose one of the following two methods run this code openssl req nodes new x509 keyout dws key out dws crt or run the following code and use the 'dws key' and 'dws crt' files the other files can be deleted later openssl req newkey rsa 4096 keyform pem keyout ca key x509 days 3650 outform pem out ca cer openssl genrsa out dws key 4096 openssl req new key dws key out client req openssl x509 req in client req ca ca cer cakey ca key set serial 101 extensions client days 365 outform pem out dws crt making the certificate and key files accessible the operating system will look for files with known names at the root of the default storage to make the certificate and key files you generated findable, either name the files dws crt and dws key , or put the names of the files in the networking registry using the keys ldws cert file name , ldws key file name then put the files at the root of the default storage