rDWS Remoteview Endpoints
12 min
these apis are exposed on the websocket server but are a separate set of apis using remoteview, you can control the player remotely through the websocket channel this is a route between each configured player and the bsn network to use these apis, you must have confirmed access to a webrtc signaling server, and access to that server through a browser so you can use the necessary url endpoints you must also be authenticated with the necessary bsn server and the player must be registered with that same network the web server must provide its content over an https connection (this is part of the webrtc specification) if you do not have access to such a service, you can proxy a local (non https) server through a remote service this service is not part of bsn cloud establishing a remoteview player connection acquire an accessurl for a rendezvous service to use with remoteview use put /remoteview/config to add the accessurl to the player configuration in bsn cloud confirm the setting with the get /remoteview/config endpoint use the post /remoteview/{\ source}/view endpoint to start a session go to a chrome browser and enter the rendezvous forwarding address and add webrtc client html to the end of the address (for example 7a24dceefaa4 ngrok io/webrtc client html) enter the player serial number that you wish to view you can check to make sure everything is working by using get /remoteview/{\ source}/view it should return a session id use delete /remoteview/{\ source}/view/{\ id} to remove a session get /remoteview/config/ use the put endpoint to configure the player with an access url you can then use this endpoint to check that the configuration is correct success response body \<font color="#15803d">200\</font> this will return the access url example {“accessurl” “http //test server url/”} failure response \<font color="#b91c1c">400\</font> the request is malformed and therefore invalid \<font color="#b91c1c">401\</font> the access token is invalid or not specified \<font color="#b91c1c">5xx\</font> any 500 code is an internal server error put /remoteview/config/ configures the player with the access url request body accessurl \<font color="#704ae0">string \</font> the remote view server url request example {"data" {“accessurl” “http //test server url/”}} success response body \<font color="#15803d">200\</font> this returns the access url the same value that you passed in the request body to the player failure response \<font color="#b91c1c">400\</font> either the request or request body is malformed and therefore invalid \<font color="#b91c1c">401\</font> the access token is invalid or not specified \<font color="#b91c1c">5xx\</font> any 500 code is an internal server error get /remoteview/{\ source}/view/ returns the information about all the active remote view sessions request body source \<font color="#704ae0">string \</font> this value will always be "desktop" success response body \<font color="#15803d">200\</font> returns an array of session objects each object contains the following parameters id \<font color="#704ae0">string\</font> the session id mediasource \<font color="#704ae0">string\</font> the value is always "desktop" available \<font color="#704ae0">bool\</font> this value is always true when the session is active viewing \<font color="#704ae0">bool\</font> this indicates that the session is active the value will always be true example { id "9e61ac20 2014 11ee a14d 73a9c31db7cd", mediasource "desktop", available true, viewing true } failure response \<font color="#b91c1c">400\</font> the request is malformed and therefore invalid \<font color="#b91c1c">401\</font> the access token is invalid or not specified \<font color="#b91c1c">5xx\</font> any 500 code is an internal server error get /remoteview/{\ source}/view/\ id/ returns information about the specified remote view session using its session id request body source \<font color="#704ae0">string \</font> this value will always be "desktop" id \<font color="#704ae0">string \</font> the unique identifier for the session success response body \<font color="#15803d">200\</font> returns the following specified session object id \<font color="#704ae0">string\</font> the session id mediasource \<font color="#704ae0">string\</font> this value is always "desktop" available \<font color="#704ae0">bool\</font> this value is always true when the session is active viewing \<font color="#704ae0">bool\</font> this indicates that the session is active the value will always be true example { id "9e61ac20 2014 11ee a14d 73a9c31db7cd", mediasource "desktop", available true, viewing true } failure response \<font color="#b91c1c">400\</font> the request is malformed and therefore invalid \<font color="#b91c1c">401\</font> the access token is invalid or not specified \<font color="#b91c1c">404\</font> the specified session id was not found \<font color="#b91c1c">5xx\</font> any 500 code is an internal server error post /remoteview/{\ source}/view/ starts a new session and returns an id for the session (at this point, the signaling server has been initialized and has made a websocket connection to the player) request body source \<font color="#704ae0">string \</font> this value will always be "desktop" success response body \<font color="#15803d">200\</font> a successful response returns the session id example {sessionid "9e61ac20 2014 11ee a14d 73a9c31db7cd"} failure response \<font color="#b91c1c">400\</font> the request or request body is malformed and therefore invalid \<font color="#b91c1c">401\</font> the access token is invalid or not specified \<font color="#b91c1c">5xx\</font> any 500 code is an internal server error delete /remoteview/{\ source}/view/\ id/ stops the specified remote view session using its session id request body source \<font color="#704ae0">string \</font> this value will always be "desktop" id \<font color="#704ae0">string \</font> the unique identifier for the session you want to stop success response body \<font color="#15803d">200\</font> the specified session was stopped example { stopped true } failure response \<font color="#b91c1c">400\</font> the request is malformed and therefore invalid \<font color="#b91c1c">401\</font> the access token is invalid or not specified \<font color="#b91c1c">404\</font> the specified session id was not found \<font color="#b91c1c">5xx\</font> any 500 code is an internal server error