JSON API » queues » queues/create
Creates a new queue.
Input parameters
Requires authentication and the administrator role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
name | String | Name. | Yes | |
allow_forwards | Integer | 1 to allow destinations to forward calls, 0 not to. | No | 0 |
answer | Integer | 1 to request destinations to auto-answer, 0 not to. | No | 0 |
atype | String | Destination type when exiting the queue due to no destinations available. | No | "hangup" |
anumber | String | Destination number when exiting the queue due to no destinations available. | No | Empty string. |
callback | Integer | -1 to offer callback on pressing *, 0 not to, 1 or above to offer callback and validate number using class of service with this ID. | No | 0 |
callerid | String | Callerid to use on callback. Empty string for unknown. | No | Empty string. |
customer | Integer | ID of customer to create in. | No | Customer of authentication user. |
description | String | Description. | No | Empty string. |
destinations_same | Integer | Set all destinations to the same values as dtype and dnumber. | No | 0 |
dtype | String | Destination type when exiting the queue due to caller pressing *. | No | "hangup" |
dnumber | String | Destination number when exiting the queue due to caller pressing *. | No | Empty string. |
events | Integer | 1 to record queue events, 0 not to. | No | 0 |
events_url | String | URL to send events to. Empty string for none. | No | Empty string. |
htype | String | Destination type when exiting the queue due to hold time. | No | "hangup" |
hnumber | String | Destination number when exiting the queue due to hold time. | No | Empty string. |
holdtime | Integer | Maximum hold time in seconds. -1 for no limit. | No | -1 |
maximum_queued | Integer | Maximum queued calls. -1 for no limit. | No | -1 |
missed_logout | Integer | Number of missed calls to set destination to unavailable. 0 for never. | No | 0 |
music | Integer | ID of music class to play. 0 for default. | No | 0 |
ntype | String | Destination type when exiting the queue due to number of calls. | No | "hangup" |
nnumber | String | Destination number when exiting the queue due to number of calls. | No | Empty string. |
no_destinations | Integer | 1 to exit queue if no destinations are available on entering the queue, 0 not to. | No | 1 |
owner | Integer | ID of owner. 0 for none. | No | 0 |
panel | Integer | 1 to show in control panel, 0 not to. | No | 0 |
recordgroup | Integer | ID of record group. 0 for none. | No | 0 |
play_interval | Integer | Seconds to play message and/or position in queue. | No | 60 |
play_message | Integer | 1 to play message file, 0 not to. | No | 0 |
play_position | Integer | -1 to always play position in queue, 0 not to, 1 or above to play position for callers up to that position number. | No | 0 |
play_start | Integer | 1 to play message and/or position on entering queue, 0 not to. | No | 0 |
priority | Integer | Priority of queue from 1 to 10. | No | 1 |
ringtime | Integer | Seconds to ring destinations for before return caller to queue. | No | 15 |
screen | Integer | 1 to screen calls and play callerid, 2 to ask callers to record name, 0 not to screen. | No | 0 |
strategy | String | Ring strategy within a priority. "all", "least_recent", or "least_recent_all". | No | "least_recent" |
type | String | Ring strategy for priorities. "circular", "linear", "smart_circular", or "smart_linear". | No | "linear" |
wrapuptime | Integer | Seconds to leave destination idle for before delivering next call. | No | 0 |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
200 | Success. |
201 | Input passed validation. Only returned if validation=1. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
Data returned
The ID of the created queue.
Example: With required parameters
http://enswitch.example.com/api/json/queues/create/?auth_username=user;auth_password=password;name=example{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }
Change history
Version | Changes |
---|---|
3.14 | atype, anumber, destinations_same, events_url, htype, hnumber, ntype, and nnumber input parameters added. callback input parameter changed to -1 for always and to specify class of service ID. play_position input parameter changed to -1 for always and to specify highest position. |
3.13 | Function added. |