question

Nate Breeden avatar image
Nate Breeden asked ·

Presence Does Not Change When Using API Call

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)


apidnddevelopers
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

· Write an Answer
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered ·

In your Api call, in the body make sure while updating the presence status you have

"allowSeeMyPresence":true

If 'True' enables other extensions to see the extension presence status and change will be reflected after update

ref: https://developers.ringcentral.com/api-reference/Presence/readUserPresenceStatus

1 comment Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hey Anirban, I do have that in the body, it still does not show the user as available and the users app still shows them in DND - but they can receive calls so I know it does actually take them out of DND, just doesn't update the presence for the user or for other users to see

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.