Error when trying to INSERT or UPDATE an User on a Queue

When I try to INSERT or UPDATE an Agent on a Queue with the service:
/api/v2/users/{userId}/queues/{queueId}

I receive an code error 400, but with message:
"Some of the queues do not exist for the agent:..."

I´m sending all required fields (mediaSettings, acwSettings, skillEvaluationMethod) and one optional field (joined), but it still not working.

I´m following the API resource https://developer.mypurecloud.com/api/rest/v2/users/index.html.

Any ideas???

That resource is for a user to join/unjoin themselves from a queue. They must be a member of the queue to be joined to the queue. This concept could also be referred to as being active in the queue. For more information, see the Resource Center's article Choose queues to work.

To add or remove a user as a member of the queue, use the Routing API resource POST /api/v2/routing/queues/{queueId}/users.

Tim
Thanks for reply!
I tryed this resource and it works great!!

Hi there. I'm having a different issue trying to Add member(s) to a Queue. Based on the API documentation, I am sending all required fields, but I get an error message saying "bad.request" -> "id may not be empty". I have been trying different data formats, but could not get to a solution. Could you give me an idea?

I'm doing POST to https://api.mypurecloud.com/api/v2/routing/queues/{{queueid}}/users

Body is:

[
        {
          "name": "xxxxxxxxxxxxxxxxxxxx",
          "user": {
            "name": "xxxxxxxxxxxxxxxxxxxx",
            "chat": {
              "jabberId": "xxxxxxxxxxxxxxx@xxxxxxxxxx.xxxxx.com"
            },
            "email": "xxxxx@xxxxx.com",
            "addresses": [
              {
                "address": "xxxxx@xxxxx.com",
                "mediaType": "EMAIL",
                "type": "PRIMARY"
              }
            ],
            "username": "xxxx@xxxx.com",
            "version": 6
          },
          "joined": true
        }
    ]

Response is:

{
"status": 400,
"code": "bad.request",
"message": "id may not be empty",
"contextId": "3ac08bca-d0b3-4bb7-bbd9-75ce6bd1c5b1",
"details": [],
"errors": []
}

Thank you very much!

Ok, quick update:

I replaced the first "name" parameter by the "id", and the POST method seems to work. I get no response back from the cURL call, but the member gets added to the queue. I think this will work. 

I would still appreciate any input on this question, regarding best practices or other methods I should closer look.

Thank you!

It's a documentation error. The only field you need to send is the ID:

[
  {
    "id":"fc627781-ea42-467f-ab60-d329f08122f7"
  }
]
1 Like

Thank you Tim! I was afraid it was a documentation error. It is indeed. You're right.