Richard_Sellwood | 2021-11-24 00:56:22 UTC | #1
Hi I'm looking for a way to query User Skills in batch by passing a list of userid's. It appears that the only API's available for querying user skills are:
/api/v2/users/{userId}/profileskills
/api/v2/users/{userId}/routingskills
So it looks unlikely, but need to be sure, if someone would please advise.
Thanks Richard
Jerome.Saint-Marc | 2021-11-24 08:05:49 UTC | #2
Hello,
I think the closest way would be to search users with POST /api/v2/users/search, using a filter with a list of userIds and specifying profileSkills (for profile skills) and skills (for routing skills) in the expand attribute.
The request body would look like this:
{ "sortOrder": "ASC", "sortBy": "id", "pageSize": 100, "pageNumber": 1, "expand": ["profileSkills", "skills"], "query": [ { "values": ["userId01", "userId02", "userId03"], "fields": ["id"], "type": "EXACT" } ], "enforcePermissions": true }
As far as I know, you can define up to 50 values (userIds) in the filter's values array attribute. I have not tried it myself - I do not have enough users defined in my test environment - but I think that's the correct limit.
Regards,
Eos_Rios | 2021-11-24 13:49:45 UTC | #3
Jerome's answer sounded more like what you were trying not to do (supply a list of users).
If you truly want just everyones skills rather than searching for a subset you can call GET /api/v2/users with skills as an expands too.
Richard_Sellwood | 2021-11-24 18:29:14 UTC | #4
Hi @Jerome.Saint-Marc & @Eos_Rios Thanks for your help. It sounds like it might be achievable, which is great. We'll have a play around.
Cheers Richard
Richard_Sellwood | 2021-11-24 18:38:45 UTC | #5
Just reporting back that I can get this to work using the Expand against /api/v2/users. Thanks, I didn't know about this. Very useful
system | 2021-12-25 18:39:26 UTC | #6
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: 12745