News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Presence Does Not Change When Using API Call
Tags: rest api, presence
Nov 19, 2020 at 1:38pm   •   1 replies  •  0 likes
Nate Breeden

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)

1 Answer
answered on Nov 21, 2020 at 3:30am  

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


on Nov 22, 2020 at 1:20pm   •  0 likes

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

A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

Developer Platform
Integrated Apps
App Gallery
Developer support
Games and rewards

Resource center
Product Releases
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us