Click here to view code image
$ python3 sess.py
SessionId=031033bebe67130d4d94747b6b9d4e4f6bd29
65162ed542f22d32d75a9f238f9; Path=/;
HttpOnly
Getting the Current Device Status
After a session is established, the session cookie is used
in each of the interactions. Example 10-20 shows how to
use the cookie to get the current status of the device by
issuing a simple Python GET request to get the status.
Example 10-20 Python Script to Get Endpoint Status
Click here to view code image
""" Webex Device - Endpoint Status """
import requests
URL = "http://10.10.20.159/status.xml"
HEADERS = {
'Cookie':
"SessionId=c6ca2fc23d3f211e0517d4c603fbe4205c77d13dd6913c7bc12eef4085b
7637b"
}
RESPONSE = requests.request("GET", URL,
headers=HEADERS)
print(RESPONSE.text)
Setting Device Attributes
When a session is established, the session cookie is used
in each of the interactions. Example 10-21 shows how to
use the cookie to set the camera position with certain pan
and tilt values.
Example 10-21 Python Script to Send a Command to
Set the Camera Position
Click here to view code image