08-17-2018 08:49 AM - edited 03-01-2019 02:59 AM
I am trying to modify a voicemail user's COS in Unity Connection with Python. I have been able to create users and edit other settings such as alternate extension but a simple modify is stumping me. Running my code results in a <response [204]> which is a success but the COS did not update.
import requests
import json
baseUrl = "https://unity.loves.com/vmrest/"
end_user_objectid = '527aad83-6739-409c-a70c-792a8ca55536' headers_edit = {'Accept': 'application/json', 'Content_type': 'application/json', 'Connection': 'keep_alive'} cos = {'CosObjectId': 'c33d4edd-79e3-44fa-bb57-20b8d2d39998'} s = requests.post(baseUrl + "users/" + end_user_objectid, auth=(apiUser, apiPassword), headers=headers_edit, json=cos, verify=False) print(s) print(s.text)
Solved! Go to Solution.
08-18-2018 06:34 AM
Figured it out. Just needed to change POST to PUT.
s = requests.put(baseUrl + "users/" + end_user_objectid, auth=(apiUser, apiPassword), headers=headers_edit, json=cos, verify=False)
08-18-2018 06:34 AM
Figured it out. Just needed to change POST to PUT.
s = requests.put(baseUrl + "users/" + end_user_objectid, auth=(apiUser, apiPassword), headers=headers_edit, json=cos, verify=False)
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