Trying to change the users presence from DND to accept all calls using the below script, it successfully takes them out of DND but on the RingCentral app it shows "Do Not Disturb is ON" and other users still see the users presence as "Do Not Disturb"? Is there a param in "Body" that I'm missing in my script, or is this the intended results using this API call?
def turn_off_dnd(*args):
accountId = "~"
queryParams = {
'extensionNumber': _extension.get()
}
r = platform.get(f'/restapi/v1.0/account/{accountId}/extension', queryParams)
_extJson = json.loads(r.text())
_extId = _extJson['records'][0]['id']
extensionId = _extId
body = {
'userStatus': 'Available',
'dndStatus': 'TakeAllCalls',
'allowSeeMyPresence': True,
'presenceStatus': 'Available',
}
r = platform.put(f'/restapi/v1.0/account/{accountId}/extension/{extensionId}/presence', body)
queryParams = {
}
r = platform.get(f'/restapi/v1.0/account/{accountId}/extension/{extensionId}/presence', queryParams)
_newStatJson = json.loads(r.text())
_newStat = _newStatJson['dndStatus']
messagebox.showinfo("New DND Status", "New DND status for " + _extension.get() + ": " + _newStat)