Grokify
Grokify

Reputation: 16354

How can I get a user's call queue / department?

If I have a user's extensionId, how can I get the user's call queue / department info, e.g. a specific team like "department": "Sales".

I know I can call the following endpoint and get a list of call queues / departments using the following, but I want a list specific to a user:

List Call Queues API

GET /restapi/v1.0/account/{accountId}/call-queues

Get Extension List API

GET /restapi/v1.0/account/{accountId}/extension?type=Department

Once I have the queue groupId, I can also get a list of members per queue:

Get Call Queue Members API

GET /restapi/v1.0/account/{accountId}/call-queues/{groupId}/members

Upvotes: 0

Views: 509

Answers (1)

Grokify
Grokify

Reputation: 16354

A user can be a member of multiple call queues. To get a list, call the user's extension info endpoint and look for the departments property in the JSON response body.

Request:

GET /restapi/v1.0/account/{accountId}/extension/{extensionId}

Response:

The response will have a number of properties. The below is an excerpt that shows the department property.

{
    "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222",
    "id": 22222222,
    "extensionNumber": "102",
    "name": "Tiger RingForce",
    "type": "User",
    "status": "Enabled",
    "departments": [
        {
            "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/33333333",
            "id": "33333333",
            "extensionNumber": "201"
        },
        {
            "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/44444444",
            "id": "44444444",
            "extensionNumber": "202"
        }
    ],
    ...
}

Upvotes: 0

Related Questions