Get queues for user API

Hello everyone,

I'm using Python SDK to get list of available users (/api/v2/users) and then, queues associated with each user (/api/v2/users/{userId}/queues) and I'm using Client Credentials grant for authorization. From API explorer, I was able to get list queues for the user by passing UserId as input. When I pass the same user ID in below manner, I'm getting empty entites in response which is supposed to contain list of queues.

api_response = api_instance.get_user_queues(user_id=user_id, joined=joined)
print(api_response)

Output:
{'entities': [],
'first_uri': '/api/v2/users/xxxxxxxxxxxxxxxxxxxx/queues?pageSize=25&pageNumber=1',
'last_uri': '/api/v2/users/xxxxxxxxxxxxxxxxxxxx/queues?pageSize=25&pageNumber=1',
'next_uri': None,
'page_count': 0,
'page_number': 1,
'page_size': 25,
'previous_uri': None,
'self_uri': '/api/v2/users/xxxxxxxxxxxxxxxxxxxx/queues?pageSize=25&pageNumber=1',
'total': 0}

I don't know what I'm missing here.. Please help with this.

Thanks

Hello,

You could probably check that your OAuth client (Client Credentials) has its roles assigned on the necessary/appropriate Divisions (ex: divisions to which the queue(s) belong to).

Regards,

Hi,

I have assigned both permissions(routing:queue:view and routing:queue:join) as given in below link
https://developer.mypurecloud.com/api/rest/client-libraries/python/UsersApi.html#get_user_queues.

Also we have only one division(Home) in our account. Is there anything else I should look for? Please suggest.

Thanks

Hello,

It could be worth checking if the userId you have set in your code is valid and set properly - user_id = 'your_user_id_example_as_a_string'
The request will bring a similar empty response if the userId you have provided for the request is incorrect (if it doesn't correspond to an existing user).

If it is not the reason of your issue, then I don't know. We cannot investigate customer data via this forum. So I would suggest to open a case with Genesys Care.

Regards,

Hi,

I tried the same user ID in API explorer and I'm getting response in entities. Only through code I'm getting empty list. Anyway, I'll open a case with Genesys Care as you suggested. Thanks for your time.

Hi Ragavi, could you also confirm if the joined parameter is set to True. I think that's one of the other possible scenarios where it will give you a response but with 0 results.

Hello,

Yes, I have assigned joined as True.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.