Queue Multiple Calls

API for queuing multiple outbound calls

- NEW! - Interactive API docs, now live!

Visit api-docs.plumvoice.com to read Plum API documentation, build and test requests in our interactive API sandbox, review the responses, and share it all with your team.

Queuing Multiple Outbound Calls

POST https://fuse.plumvoice.com/api/apps/{application_id}/{deployment_id}/bulk_queue

Queues outbound calls in batches from a CSV of contacts.

Path Parameters

Name
Type
Description

application_id

number

Application ID number.

To find this number, see the following instructions from Outbound Calls.

deployment_id

number

Deployment ID number.

To find this number, see the following instructions from Outbound Calls.

Headers

Name
Type
Description

Content-type

string

multipart/form-data

Accept

string

application/xml, application/json

Request Body

Name
Type
Description

csv

string

CSV file of contacts to receive the outbound calls.

start_timestamp

string

Unix timestamp indicating when to begin the outbound dialing attempts. If not specified, the calls go out immediately.

end_timestamp

string

Unix timestamp indicating when to stop attempting outbound calls.

max_attempts

integer

Total number of times (between 1-10) to attempt calling a specific number (if previous attempts are not completed successfully). This field requires reattempt_wait field to be set.

reattempt_wait

integer

Interval (in seconds) to wait before retrying the outbound call after a failure. This is only required when the max_attempts value is set to a number greater than one, indicating additional retry attempts. Valid values range from 60 to 86400 (1 minute to 1 day).

result_url

string

Callback URL to your REST service that processes the call status results when the call is completed, canceled, or all attempts have been exhausted. The POST body matches the format of the call_details attribute from the outbound call status API response.

For more information on result_url, see documentation here.

is_pci

integer

For customers who have been granted access to our HIPAA / PCI compliant secure environment setting this flag to 1 will cause connected outbound calls to execute within that secure environment. (Integer 0 or 1).

{"calls_queued":1}

Possible Response Codes

  • 200: success, calls successfully queued

  • 400: supplied data improperly formatted or invalid

  • 401: authentication headers invalid or the account is inactive

  • 403: the user attempting to queue the outbound call does not have appropriate permissions

  • 404: deployment not found

  • 405: invalid HTTP method supplied (only POST allowed)

  • 409: user, deployment, or application previously deleted

  • 500: database error

The return structure will contain the following item(s):

Name

Data Type

Always Present

Description

calls_queued

integer

no

This represents the total number of calls queued when the HTTP code is 200.

error

string

no

Indicates what went wrong when an HTTP code other than 200 is returned.

Sample Code

This sample PHP code makes a request to queue multiple outbound calls (with a queue.csv file in the same working directory as the script):

<?php
// account and application settings
$email = '<your_email_address>';
$developer_key = '<your_developer_key>';
$application_id = '<your_application_id>';
$deployment_id = '<your_deployment_id>';
$phone_numbers_file = '/path/to/csv/file.csv';

// build the URL and POST parameters
$url = 'https://fuse.plumvoice.com/api/apps/'.$application_id.'/'.$deployment_id.'/bulk_queue';
$params = array(
  'csv' => curl_file_create($phone_numbers_file),
  'start_timestamp' => strtotime('+1 minutes'),
  'end_timestamp' => strtotime('+1 hour'),
  'max_attempts' => 1
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $email.':'.$developer_key);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-type: multipart/form-data"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);

Last updated