DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
""" Webex Device - Set Camera Position """
import requests
URL = "http://10.10.20.159/put.xml"
PAYLOAD = (
'<Command>' +
' <Camera>' +
' <PositionSet command="True">' +
' <CameraId>1</CameraId>' +
' <Pan>150</Pan>' +
' <Tilt>150</Tilt>' +
' </PositionSet>' +
' </Camera>' +
'</Command>'
)
HEADERS = {
'Content-Type': "application/xml",
'Cookie':
"SessionId=c6ca2fc23d3f211e0517d4c603fbe4205c77d13dd6913c7bc12eef4085b
7637b"
}
RESPONSE = requests.request("POST", URL,
data=PAYLOAD, headers=HEADERS)
print(RESPONSE.text)

Registering an Event Notification Webhook


You can get a device or an endpoint to post HTTP event
notifications (via webhook) on changes to the API state
(for example, statuses, events, configuration updates).
These events are sent to the specified server URL. You
can choose between events being posted in either XML
or JSON format. You can subscribe to changes on
multiple parts of the API by registering up to 15 different
feedback expressions. The command for registering is
xCommand HttpFeedback.


The HttpFeedback Register syntax is as follows:


Click here to view code image

Free download pdf