Add queue
Creates a call queue for inbound or outbound calls.
Parameters
Send as application/x-www-form-urlencoded.
typestringrequiredSelects the operation. Always
add_queuefor this endpoint.tokenstringrequiredYour API token from Log in. See Authentication.
ID of the queue (inbound group).
ExamplebillingName of the queue.
ExampleBilling
curl https://api.dcdial.com/api/ \ -d type=add_queue \ -d token="$DCDIAL_TOKEN" \ -d group_id=billing \ -d group_name=Billing<?php$ch = curl_init('https://api.dcdial.com/api/');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => http_build_query([ 'type' => 'add_queue', 'token' => getenv('DCDIAL_TOKEN'), 'group_id' => 'billing', 'group_name' => 'Billing', ]),]);$result = json_decode(curl_exec($ch), true);curl_close($ch);
if (($result['response']['success'] ?? 0) != 1) { throw new RuntimeException($result['response']['error'] ?? 'Request failed');}const res = await fetch('https://api.dcdial.com/api/', { method: 'POST', body: new URLSearchParams({ type: "add_queue", token: process.env.DCDIAL_TOKEN, group_id: "billing", group_name: "Billing", }),});const { response } = await res.json();if (response.success != 1) throw new Error(response.error);import osimport requests
r = requests.post( "https://api.dcdial.com/api/", data={ "type": "add_queue", "token": os.environ["DCDIAL_TOKEN"], "group_id": "billing", "group_name": "Billing", }, timeout=30,)response = r.json()["response"]if str(response.get("success")) != "1": raise RuntimeError(response.get("error")){ "response": { "success": "1", "error": "" }}Try it