Example Code

API Token Notice

You will need both your API Token and your Call API SID (ACCOUNT_SID). Both are available in User Settings at the top right of the portal.

Full CallAPI URL:

https://v1.api19.com/call/2012-04-24/Accounts/ACCOUNT_SID/Calls.json

This section includes several examples in different languages of how to make calls.

The following table includes the supported POST variables that can be sent with your HTTP calls.

Request Parameters

Parameter

Description

From (Required)

The phone number to use as the caller id.

To (Required)

The phone number to call.

Url (Required)

The fully qualified URL that should be executed when the call connects.

Method

The HTTP method Platform should use when making its request to the above Url. Defaults to POST.

FallbackUrl

The URL that Platform will request if execution of Url fails for any reason.

FallbackMethod

The HTTP method that Platform should use to request the FallbackUrl. Must be either GET or POST. Defaults to POST.

StatusCallbackEvent

A comma separated list of events on which we are interested in getting a callback on. Possible values are initiated, ringing, answered, completed. Defaults to none.

StatusCallback

URL to receive the callback events at. Default none.

StatusCallbackMethod

Set to GET or POST. Defaults to POST.

Timeout

The number of seconds that the Platform should allow the phone to ring before assuming there is no answer. The default is 60 seconds.

You can view example code here

Last updated