JSON API » queues » queues/create

Creates a new queue.

Input parameters

Requires authentication and the administrator role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringName.Yes
allow_forwardsInteger1 to allow destinations to forward calls, 0 not to.No0
answerInteger1 to request destinations to auto-answer, 0 not to.No0
atypeStringDestination type when exiting the queue due to no destinations available.No"hangup"
anumberStringDestination number when exiting the queue due to no destinations available.NoEmpty string.
callbackInteger-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.No0
calleridStringCallerid to use on callback. Empty string for unknown.NoEmpty string.
customerIntegerID of customer to create in.NoCustomer of authentication user.
descriptionStringDescription.NoEmpty string.
destinations_sameIntegerSet all destinations to the same values as dtype and dnumber.No0
dtypeStringDestination type when exiting the queue due to caller pressing *.No"hangup"
dnumberStringDestination number when exiting the queue due to caller pressing *.NoEmpty string.
eventsInteger1 to record queue events, 0 not to.No0
events_urlStringURL to send events to. Empty string for none.NoEmpty string.
htypeStringDestination type when exiting the queue due to hold time.No"hangup"
hnumberStringDestination number when exiting the queue due to hold time.NoEmpty string.
holdtimeIntegerMaximum hold time in seconds. -1 for no limit.No-1
maximum_queuedIntegerMaximum queued calls. -1 for no limit.No-1
missed_logoutIntegerNumber of missed calls to set destination to unavailable. 0 for never.No0
musicIntegerID of music class to play. 0 for default.No0
ntypeStringDestination type when exiting the queue due to number of calls.No"hangup"
nnumberStringDestination number when exiting the queue due to number of calls.NoEmpty string.
no_destinationsInteger1 to exit queue if no destinations are available on entering the queue, 0 not to.No1
ownerIntegerID of owner. 0 for none.No0
panelInteger1 to show in control panel, 0 not to.No0
recordgroupIntegerID of record group. 0 for none.No0
play_intervalIntegerSeconds to play message and/or position in queue.No60
play_messageInteger1 to play message file, 0 not to.No0
play_positionInteger-1 to always play position in queue, 0 not to, 1 or above to play position for callers up to that position number.No0
play_waittimeInteger-1 to always play wait time in queue, 0 not to, 1 or above to play wait time for callers up to that number of seconds.No0
play_startInteger1 to play message and/or position on entering queue, 0 not to.No0
priorityIntegerPriority of queue from 1 to 10.No1
ringtimeIntegerSeconds to ring destinations for before return caller to queue.No15
screenInteger1 to screen calls and play callerid, 2 to ask callers to record name, 0 not to screen.No0
strategyStringRing strategy within a priority. "all", "least_recent", or "least_recent_all".No"least_recent"
typeStringRing strategy for priorities. "circular", "linear", "smart_circular", or "smart_linear".No"linear"
wrapuptimeIntegerSeconds to leave destination idle for before delivering next call.No0
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your 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

VersionChanges
4.1play_waittime parameter added.
3.14atype, 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.13Function added.