12-08-2019 06:30 PM
Hi Guys,
I want to activate the home cluster and associate end device on the end user menu. I managed to get it working using Postman. Below are the code.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">
<soapenv:Header/>
<soapenv:Body>
<ns:updateUser>
<userid>TST User100</userid>
<associatedDevices>
<device>CSFTESTADD</device>
</associatedDevices>
<homeCluster>true</homeCluster>
<imAndPresenceEnable>true</imAndPresenceEnable>
</ns:updateUser>
</soapenv:Body>
</soapenv:Envelope>
But when I tried to 'translate' it to Python using the code below, it got "TypeError: Choice elements only work with keyword arguments" error notification.
Solved! Go to Solution.
12-09-2019 03:51 PM
The data for the updateUser() method is not a single object, but consists of multiple values/objects passed in as individual parameters (in the case where you have the option of using one key or another - such as 'userid' vs. 'uuid' - you must use the actual key name:)
# Create an associated devices object devices = { 'device': [] } devices['device'].append( 'CSFTESTPHONE' ) # Execute the updateUser request try: resp = service.updateUser( userid = 'testEndUser', associatedDevices = devices, homeCluster = True, imAndPresenceEnable = True )
See the sample available here: https://github.com/CiscoDevNet/axl-python-zeep-samples/blob/master/axl_add_update_User.py
12-09-2019 03:51 PM
The data for the updateUser() method is not a single object, but consists of multiple values/objects passed in as individual parameters (in the case where you have the option of using one key or another - such as 'userid' vs. 'uuid' - you must use the actual key name:)
# Create an associated devices object devices = { 'device': [] } devices['device'].append( 'CSFTESTPHONE' ) # Execute the updateUser request try: resp = service.updateUser( userid = 'testEndUser', associatedDevices = devices, homeCluster = True, imAndPresenceEnable = True )
See the sample available here: https://github.com/CiscoDevNet/axl-python-zeep-samples/blob/master/axl_add_update_User.py
12-09-2019 06:27 PM
Hi dstaudt,
That works like a charm. I did not realize the device had to be processed separately. Thank you for the help.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide