How to turn camera on and off from rest api


From the documentation there is a section is streaming that states

Is streaming
Use the is_streaming field to turn the camera on or off.

Depending on the user’s home network and your implementation, there may be a lag in response time
You must ask the user if it’s ok to change streaming status (turn the camera on/off)

However the documentation does not provide an example of how to do this. How do you turn the camera on and off with is_streaming field.


Use a PUT request to update the is_streaming field to true or false.


Do I use the whole camera object or can I just use one field?

for example





It will depend on what structure you’re using for your URL, but you don’t need the whole thing.

Two main options would be to make a PUT call to:







Also, please keep in mind that any changes to the camera streaming state requires a user confirmation or explicit action by a user.

Also, please avoid placing the authorization as a query parameter in the URL. The preferred way to pass the authorization is as a Bearer token in the request header.


I’m making the call to the url with the python “requests” library in this instance. From what I’ve read, you are required to put the authentication token as a query parameter in the URL for it to work. I initially attempted to add the token as a header but frequently received 401 responses back. Do you know of a way to make a request from python with the authentication token in the header?


Most likely the problem you are having is that the authorization header is being removed upon redirect, thus causing the authorization failure.

Here’s a discussion about this issue with Python.