Import a User to unity api is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2020 04:46 AM - edited 02-26-2020 02:07 AM
I have referred below document from cisco site followed the same but it is not working, so kindly help me on this issue,
Import a User
An important point here is that because these users are imported, almost all values come from the internal database. One exception for an LDAP import is the dtmfAccessId. The dtmfAccessId data is not available in the internal database, so an LDAP import must specify both a pkid and a dtmfAccessId.
POST /vmrest/import/users/ldap?templateAlias=voicemailusertemplate HTTP/1.1 Content-Type: application/json User-Agent: Java/1.6.0_20 Host: cuc-install-69.cisco.com Accept: text/html, image/gif, image/jpeg, \*; q=.2, \*/*; q=.2 Connection: keep-alive Authorization: Basic Y2NtYWRtaW5pc3RyYXRvcjplY3NidWxhYg== Content-Length: 126 \{"alias":"sdavis","firstName":"sonya","lastName":"davis","dtmfAccessId":"12123","pkid":"c2e2bf1c-f249-40e5-b7b8-31a5b0333647"\}
For example:
The POST above would produce the following response:
my code :
URL = 'https://{}/vmrest/import/users/ldap?templateAlias=voicemailusertemplate'.format(server)
UserHeaders = {'Accept':'text/html, image/gif, image/jpeg, \*; q=.2, \*/*; q=.2' , 'content-type':'application/json','connection':'keep_alive'}
data = {
'alias': 'testdevops',
'firstName': 'test',
'lastName': 'devops',
"dtmfAccessId": "1908",
'pkid': '8a15a6ab-965a-de21-c3e1-af48dcaa3f97'
}
try:
response = requests.post(URL, headers = UserHeaders, data= data, auth=(username, password), verify=False)
I was getting this error when tried to make post request using python,
'The HTTP header field "Accept" with value "text/html, image/gif, image/jpeg, \\*; q=.2, \\*/*; q=.2" could not be parsed.'
- Labels:
-
Other Cloud Collaboration Topics
