Excerpt |
---|
This method allows updating the statuses of agents that are registered to a queue in particular contexts such as User, Organization or global. |
Table of Contents maxLevel 3 exclude Apps Using This, Quick Examples, Need Help?
Request/Response Model
Overview
Use this request to log in, log out or pause a queue agent.
If successful, the Service returns the agent number and the status as a QueueAgent resource.
The request is made by an App that is registered to a User account.
To update the statuses of agents registered to a particular queue in a desired context, issue a HTTP PUT request:
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
HTTP-Method = "PUT" URI-Fragment = "/uapi/extensions/" User-Id "/" Extension-Number "/queue/agents/" UAPI-Agent-ID Query-Parameters = null Request-Payload = QueueAgent Return-Object = Array<QueueAgent> |
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
PUT /uapi/extensions/@me/0003*212/queue/agents/0003*210 HTTP/1.1
HOST |
Request
This section describes how to format the request to the service.
Anchor | ||||
---|---|---|---|---|
|
URI Fragment
The following parameters must be sent in the URI fragment:
Name | Type | Required | Description |
userId | Yes | Id of the User which owns the queue. | |
extension | UAPI-Extension-Number | Yes | Number of the Queue Extension. Cannot be set to @self |
agent | Yes | Identifier of the queue agent. Can be set to an extension number if the agent is local or to an Id for remote agents. |
Response
Success
If successful, the the request returns the agent number and the status as a QueueAgent resource, as well as the following HTTP statuses:
HTTP Code | Description |
200 | The QueueAgent resource is returned. |
204 | There are no QueueAgent resources to be returned. |
Failure
When it fails, the request returns the following error codes:
HTTP Code | Code | Description |
400 | status_invalid | Value supplied in type parameter is missing or invalid. The parameter must be set to one of the following value: 0 for DialIn, 1 for DialOut and 2 for Hangup. |
400 | extension_invalid | Value supplied in the URI-Fragment as extension is invalid. The parameter must reference the number of an existing Queue extension and cannot be set to @self. |
400 | qag_agent_invalid | Value supplied in status parameter is missing or invalid. The parameter can take the values: 0 for Logged Out, 1 for Online, 2 for Paused. |
Example
Anchor | ||||
---|---|---|---|---|
|
Below you can find an example that will help you understand the request and the response.
This example updates the agent 0003*210 which is registered to the queue 0003queue 0003*212. The request is made by an App on behalf of a User.
Code Block | ||
---|---|---|
| ||
PUT /uapi/extensions/@me/0003*212/queue/agents/0003*210 HTTP/1.1 HOST uapi.voipnow.com Content Type: application/json Authorization: Bearer token { "status": "1" } |
Assuming that the request has been successfulbeen successful, the Service sends the following answer:
Code Block | ||
---|---|---|
| ||
HTTP/1.1 200 OK ... [ { "agentNumber": "0003*210", "status": "1", "queue": "0003*212", "links": {"self":"https://x.x.x.x/uapi/extensions/@me/0003*212/queue/agents/0003*210"} } ] |
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.