Create Queue
The Create Queue API must be called twice.
  • Once to register the Customer Number (+1 571 331 6666 in above example) and corresponding <queue> verb as explained in Queue RCML.
  • A second time to register Agent Number (+1 571 331 9999 in above example) and corresponding verb as explained in Enqueue RCML.
Base Resource URI : https://api.teleapi.net Add Queue Resource URI: callqueue/provisioning
Supported Operations HTTP POST: Add New Queue

Request Parameters

Parameter
Description
applicationUrl
Required. applicationUrl takes an absolute URL as the value. URL points to RCML that will be executed for an incoming call. The RCML can be setup for if its a Customer Number or <enqueue> if its an Agent Number For example, Customer Number URL can return: <Response> <Dial timeout="300" record="true"> <Queue waitUrl="http://www.mocky.io/v2/5dadc3592d00006e00e4bcc9" joinUrl="http://www.mocky.io/v2/5d92d5d23000005b001b7085">support </Queue> </Dial> </Response>
Agent NumberURL can return: <Response> <Enqueue waitUrl="http://www.mocky.io/v2/5dadc1ce2d00006e00e4bcba" joinUrl="http://www.mocky.io/v2/5d92ee853000005b001b70ea" rejoin="true"> support </Enqueue> </Response>
applicationUrlMethod
The HTTP Method for applicationUrl, GET or POST. The default value is POST.
phoneNumber
Required. Then Phone Number that must be provisioned in the teleapi Cloud. Number is either Customer Number or Agent Number.
override
Set to true or false. If the teleapi Cloud already has a number provisioned and the API is called passing the same number, setting override to “true”, the Call Queue Solution will override the setting of the number. By default it is set to false.
byoc
Defines if provisioned phoneNumber is to be bought from teleapi Cloud Platform or to be used as SIP number (Bring Your Own Career). If byoc is set to true, phoneNumber is registered as SIP number. By default it is set to true.

Response Body

Response Body returns HTTP response of 200 OK if Call Queue was successfully provisioned; otherwise it will return an HTTP Error.
The successful response is returned as JSON body, shown in the example below. The following is a list of all available parameters.
Parameter
Description
sid
Unique Id for this Application within the Call Queue Solution.
phoneNumber
Phone Number that was provisioned.
accountSid
teleapi Account Sid that called this API.
friendlyName
Friendly name of Phone Number that was provisioned. By default this is always the same as phoneNumber parameter
dateCreated
Timestamp when the Call Queue app was created
voiceUrl
URL that is provisioned for passed phoneNumber in teleapi Cloud. This URL is made up of “applicationUrlMethod” that was passed as request parameter along with some additional parameters that are used by Call Queue Solution.
voiceMethod
HTTP Method for calling the voiceUrl provisioned in teleapi Cloud for PhoneNumber. This is the same value as applicationUrlMethod parameter passed in API request..
voiceFallbackUrl
Not used.
voiceFallbackMethod
Not used.
voiceCallerIdLookup
Not used.
voiceApplicationSid
Not used.
statusCallback
The URL that teleapi will request to pass status parameters (such as call ended) to Call Queue application.
statusCallbackMethod
The HTTP method teleapi will use to make requests to the StatusCallback URL.Always POST.
smsUrl
Not used.
smsMethod
Not used.
smsFallbackUrl
Not used.
smsApplicationSid
Not used.
apiVersion
The API version of teleapi Cloud.
isSIP
If phoneNumber is registered as SIP Number (BYOC) or if it’s provided by teleapi.

Example

1
{
2
"override":"true",
3
"applicationUrl":"http://www.mocky.io/v2/5dd4a91f2f0000f905d4fb63",
4
"phoneNumber":"15713316666"
5
}
Copied!
From the bash terminal you can run the command below to register Customer Phone Number and applicationUrl:
1
curl -X POST \
2
'https://yourcompany.com/callqueue/provisioning' \
3
--user '{your_account_SID}:{your_account_token}' \
4
-H 'Cache-Control: no-cache' \
5
-H 'Content-Type: application/json' \
6
-d '{ "override":"true", "applicationUrl":"http://www.mocky.io/v2/5dd4a91f2f0000f905d4fb63", "phoneNumber":"15713316666" }'
Copied!
If the creation of Call Queue is successful, the following response is returned:
1
{
2
"sid":"PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"phoneNumber":"15713316666",
4
"accountSid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
5
"friendlyName":"15713316666",
6
"dateCreated":"Wed, 20 Nov 2019 02:54:42 +0000",
7
"dateUpdated":"Wed, 20 Nov 2019 02:54:42 +0000",
8
"voiceUrl":"https://yourcompany.com/callqueue/rcml?appUrl=http%3A%2F%2Fwww.mocky.io%2Fv2%2F5dd4a91f2f0000f905d4fb63&queueState=initiating",
9
"voiceMethod":"POST",
10
"voiceFallbackUrl":null,
11
"voiceFallbackMethod":"POST",
12
"voiceCallerIdLookup":"false",
13
"voiceApplicationSid":null,
14
"statusCallback":"https://yourcompany.com/callqueue/callback",
15
"statusCallbackMethod":"POST",
16
"smsUrl":null,
17
"smsMethod":"POST",
18
"smsFallbackUrl":null,
19
"smsFallbackMethod":"POST",
20
"smsApplicationSid":null,
21
"apiVersion":"2012-04-24",
22
"isSIP":null,
23
"uri":"/2012-04-24/Accounts/AC23f1b11bbb99a46436c365cb7bec246e/IncomingPhoneNumbers/PN1865b4235b7b498bbbf983d2ec486f0e.json"
24
}
Copied!
Run the same command again, but this time change applicationUrl and phoneNumber as explained in below command to register the Agent Number.
1
curl -X POST \
2
'https://yourcompany.com/callqueue/provisioning' \
3
--user '{your_account_SID}:{your_account_token}' \
4
-H 'Cache-Control: no-cache' \
5
-H 'Content-Type: application/json' \
6
-d '{ "override":"true", "applicationUrl":"http://www.mocky.io/v2/5dd4b7f62f0000f905d4fb98", "phoneNumber":"15713319999" }'
Copied!