Hi Tanvi!
The documentation for the Admin API can be confusing, given all the variations of “GET Users” available (we’re working on it). They do have different functionality, though. For example, this just returns a list of users that you have permissions to see based on your user role:
GET https://admin.dev.api.mitel.io/2017-09-01/accounts/{account_id}/users
This call does the same thing, but it expands the tags associated with the users:
GET https://admin.dev.api.mitel.io/2017-09-01/accounts/{account_id}/users/tags
To get the information that you’re looking for, you will want to use the first call above to retrieve the basic user info (Documentation).
From there, we need to lookup presence using a “principalid”. How we get that depends on what you’re trying to do. Are you looking for just user presence, chat presence, presence of a device associated with them on a PBX(i.e. an extension), or something else?
To just get the user presence, you can use this call, using the UserID from GET Users as the PrincipalID the GET a Presentity call asks for:
GET https://presence.us.dev.api.mitel.io/2017-09-01/presentities/{userID}
You can also get Presence for all users with the following call, although it only returns 10 records at a time by default:
GET https://presence.us.dev.api.mitel.io/2017-09-01/presentities/
It’s worth noting that the PrincipalID is a GUID without dashes, whereas the UserID which you will use as the PrincipalID is a GUID with dashes…so in certain cases you may need to account for that.