Nate Breeden avatar image
Nate Breeden asked Nate Breeden commented

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)

rest apipresence
1 |3000

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

1 Answer

Anirban avatar image
Anirban answered Nate Breeden commented

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


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


1 comment
1 |3000

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

Nate Breeden avatar image Nate Breeden commented ·

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 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys