balamurugan.dhesingu | 2023-04-26 13:46:44 UTC | #1
Hi All,
Is it possible to add set of Queues for a user using API?
POST /api/v2/routing/queues/{queueId}/members I tried the above POST to add users to a Queue, but we are looking to assign multiple queues(bulk) for a user(user ID) using API.
Any idea please?
Regards, Bala
tim.smith | 2023-04-26 13:53:17 UTC | #2
PATCH /api/v2/users/{userId}/queues
balamurugan.dhesingu | 2023-04-26 14:34:19 UTC | #3
Thanks Tim!!
Based on this discussion topic https://developer.genesys.cloud/forum/t/error-trying-to-join-user-to-queue/11995 I think from Users API we can only do Join or unjoin a set of queues for a user? is it also possible to assign set of queues first time for a user?
Regards, Bala
tim.smith | 2023-04-26 14:41:18 UTC | #4
balamurugan.dhesingu, post:3, topic:19655
first time for a user
I'm not sure what you mean. The request should work the first time as well as any time thereafter to modify the list.
balamurugan.dhesingu | 2023-04-26 15:00:19 UTC | #5
We tried with the below body using PATCH /api/v2/users/{userId}/queues When I tried to add a queue, i get 200 ok but the new queue is not actually added , but i can able to join or unjoin existing queues assigned to that user by setting true or false.. Could you please clarify the body for adding queue
[ { "id": "xxxxxxxxxxx", "joined": true } ]
Regards, Bala
tim.smith | 2023-04-26 15:20:59 UTC | #6
Sorry, I need to set some terminology straight. There are two things going on here that are getting mixed up.
Queue membership - being a member of a queue associates a user with a queue. The only way to change queue membership is via modifying the queue using POST /api/v2/routing/queues/{queueId}/members.
Joining a queue - after the pre-condition of being made a member of the queue, a user can join or unjoin the queue. Joining a queue is only possible for queues for which the user is already a member. This can be accomplished using any of the following:
tim.smith | 2023-04-26 15:26:23 UTC | #7
balamurugan.dhesingu, post:5, topic:19655
When I tried to add a queue, i get 200 ok but the new queue is not actually added ... Could you please clarify the body for adding queue
To address these points directly, please open a case with Genesys Cloud Care to report both of these issues:
- The API is accepting invalid requests and returning success. This is a bug as it should return a 400 bad request error when you send it requests that are unable to be handled. It's currently silently failing.
- Your guess of what to put in that request seems reasonable, but the API documentation is absolutely wrong for
PATCH /api/v2/users/{userId}/queues. It documents that you must provide an array of UserQueue objects and can set properties like dateCreated, bullseye, callingPartyName, etc., but fails to document the id of the queue, which is the most important property. This is a bug as it appears the API endpoint is annotated with an inappropriate class for the request.
balamurugan.dhesingu | 2023-04-26 17:28:10 UTC | #8
Hi Tim - Thanks for the detail clarification.
Regards, Bala
This post was migrated from the old Developer Forum.
ref: 19655