getNextMember

View as MarkdownOpen in Claude

Retrieve the next member in the queue (the member at the front).

Path parameters

queue_idstringRequiredformat: "uuid"
Unique ID of the queue.

Response

call_idstringRequiredformat: "uuid"
The call ID of the queue member.
project_idstringRequired
The ID of the project associated with this queue member.
queue_idstringRequired
The ID of the queue associated with this queue member.
positionintegerRequired
Queue member position in the queue.
uristringRequired
The URL of this queue member.
wait_timeintegerOptional
Wait time in seconds since the member was enqueued. If not yet enqueued, it will be null.
date_enqueueddatetimeOptional
When the queue member was last enqueued.

Response Example

Response
1{
2 "call_id": "596e2dea-a269-4765-a0b4-01b82d11c120",
3 "project_id": "d421473b-d696-449a-a1a1-4ddd83d2d0e5",
4 "queue_id": "596e2dea-a269-4765-a0b4-01b82d11c120",
5 "position": 2,
6 "uri": "/api/relay/rest/queues/596e2dea-a269-4765-a0b4-01b82d11c120/members/596e2dea-a269-4765-a0b4-01b82d11c120",
7 "wait_time": 172975,
8 "date_enqueued": "2024-01-15T09:30:00Z"
9}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9const nextMember = await client.queues.getNextMember("queue-id");
10console.log("Next caller:", nextMember["call_id"]);