Create a Queue
Use this endpoint for the Queues method to create a new call queue.
Parameters
Parameter | Description |
---|---|
FriendlyName Required | A description that distinguishes a queue. |
MaxSize Optional | The maximum number of calls that are allowed to wait in a queue. |
Request: Create a New Call Queue
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Queues.json \
-X POST \
--data-urlencode "FriendlyName=Queue1" \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.queues.create({friendlyName: 'Queue1'})
.then(queue => console.log(queue.sid))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var queue = QueueResource.Create(friendlyName: "Queue1");
Console.WriteLine(queue.Sid);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
queue = client.queues.create(friendly_name='Queue1')
print(queue.sid)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
queue = @client.queues.create(friendly_name: 'Queue1')
puts queue.sid
Responses
200 OK
{
"account_sid": "b3877c40-da60-4998-90ad-b792e98472ac",
"average_wait_time": 0,
"current_size": 0,
"date_created": "Wed, 26 Sept 2018 18:00:00 +0000",
"date_updated": "Thur, 27 Sept 2018 19:00:00 +0000",
"friendly_name": "Queue1",
"max_size": 123,
"sid": "b3877c40-da60-4998-90ad-b792e98472qu",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472ac/Queues/b3877c40-da60-4998-90ad-b792e98472qu.json"
}