News & Announcements User Community Developer Community

Welcome to the RingCentral Community

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

Search
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
Get User Groups for a Group Manager
Tags: rest api
Dec 12, 2019 at 3:51pm   •   1 replies  •  1 likes
Tyler Kocheff

Is there an API to pull in extensions only that a manager has authorization over? This is in regards to User Groups (Users > User Groups in the Admin Portal) I'm looking to pull in a Group Manager's group and then display all the extensions in the group to allow viewing and modifying their DND status.

I had incorrectly assumed that when pulling the list of extensions, that a manager would only see the users' they manage, but it winds up pulling all extensions from our 1000's of users. I don't see any API relating to User Groups.

1 Answer
answered on Dec 13, 2019 at 9:27am  

You are right about a User group's purpose. But any user/extension can see other's user/extension presence status. So does the group manager! That's why when you send a GET request to "account/~/presence", you will see the entire company's user presence status.

The privilege of a group manager is to update/modify a presence status of its group members without the need of being a super admin.

So in your case, you have to keep track of a list of a group's members, then let the group manager to read only those members and modify their presence status as you need. You can do something like this in Node JS:

var members = ["120", "121", "122"]
function read_user_presence(){
  platform.get('/account/~/presence', {
          sipData: true
      })
      .then(function (resp) {
        var jsonObj = resp.json()
        for (var record of resp.json().records){
          const member = (element) => element === record.extension.extensionNumber;
            if (members.some(member)){
              console.log(JSON.stringify(record))
              console.log("=======")
              // check a member's status then modify it accordingly
              update_user_presence(record.extension.id)
              }
         }
      });
}

function update_user_presence(id){
  platform.put('/account/~/extension/' + id + '/presence', {
          dndStatus: "DoNotAcceptAnyCalls"
      })
      .then(function (resp) {
        var jsonObj = resp.json()
        console.log(jsonObj)
      });
}



 0



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

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