dkprado | 2017-12-13 13:46:31 UTC | #1
Hi there. I need to grab a list of users through /api/v2/users/ and then bring the roles for each one. Is there a way I can bring all the roles joined to the results to the first query?
anon28066628 | 2017-12-13 14:00:34 UTC | #2
To do this, you'll need to cache the userIds from your user list and then use the Roles endpoint for each one of them. The Roles aren't included with the response from the Users endpoint.
dkprado | 2017-12-13 15:25:58 UTC | #3
Thanks Smith, That's exactly what I'm doing now. I was just afraid that would have better way of doing it. Thanks again.
anon28066628 | 2017-12-13 15:46:45 UTC | #4
Thanks for the question! FYI the supported expand query options for Users are:
expand params Values: routingStatus, presence, conversationSummary, outOfOffice, geolocation, station, authorization, profileSkills, locations, groups
dkprado | 2017-12-13 16:07:27 UTC | #5
Yeah, it would be great to have the "roles" there. But I can get it by crawling each Operator. I'm just afraid of the API REST call limits (number of calls).
tim.smith | 2017-12-13 17:39:20 UTC | #6
You can use the query parameter expand=authorization to have the roles included with the user.
dkprado | 2017-12-13 17:54:18 UTC | #7
tim.smith, post:6, topic:2231
expand=authorization
That's exactly what I need. I didn't figure -- authorization == roles. Thanks Tim. Thanks Smith_Rj
anon28066628 | 2017-12-13 22:03:10 UTC | #8
That's right, I didn't realize authorization == roles in this context -- thanks Tim!
system | 2018-01-13 22:14:38 UTC | #9
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 2231