Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Test Credentials


Twilio provides you with a set of test credentials so you can exercise parts of the REST API without charging your account. You can find your credentials in the Auth Tokens page of your Console(link takes you to an external page).

You use these credentials in the same way as your live credentials, with one restriction being that you cannot log in to the Twilio CLI with your test credentials. However, when you authenticate with your test credentials, we will not charge your account, update the state of your account, or connect to real phone numbers. You can now pretend to buy a phone number or send an SMS, without actually doing so.

To protect your production data, your test credentials can't interact with the data in your real account. For example, you can't use phone numbers from your real account as the 'From' number in requests made with your test credentials.


Supported Resources

supported-resources page anchor

Your test credentials can currently be used to interact with the following three resources:

  • Buying phone numbers: POST /2010-04-01/Accounts/{TestAccountSid}/IncomingPhoneNumbers
  • Sending SMS messages: POST /2010-04-01/Accounts/{TestAccountSid}/Messages
  • Making calls: POST /2010-04-01/Accounts/{TestAccountSid}/Calls

Requests to any other resource with test credentials will receive a 403 Forbidden response. In the future, we may enable these resources for testing as well.

(warning)

Warning

A limitation of SMS messages and calls made using test credentials is that they will not trigger status callbacks. Learn more about status callbacks for outbound SMS and status callbacks for Voice.


When you make an API request with your test credentials, Twilio will validate all input as though the request were made with your real credentials. However, there are some cases when a request's validity depends on the state of Twilio. For instance, if you are trying to buy a phone number and that phone number is no longer available, Twilio will return an error.

To write test cases that expect and handle errors which depend on the state of Twilio, we provide magic inputs. For the case mentioned above, there is a magic phone number +15005550000 which if you pass it as the 'PhoneNumber' parameter in a POST to IncomingPhoneNumbers, will always return an error saying the number is unavailable.

The full set of magic inputs is detailed below.


If you'd like to test API requests to the phone numbers resource without provisioning a number for your account, you can use your test credentials.

You use these credentials in the same way as your live credentials. However, when you authenticate with your test credentials, we will not charge your account or purchase a phone number for you. This way, you can pretend to buy a phone number without actually doing so.

Just POST to the normal phone number purchase API endpoint using your test credentials to authenticate and your TestAccountSid in the URL:


_10
POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/IncomingPhoneNumbers

Parameters

test-incoming-phone-numbers-parameters page anchor

All of the existing phone number purchase parameters will work. In addition, we provide some specific values for certain parameters to help you generate success and failure cases.

PhoneNumber

test-incoming-phone-numbers-parameters-phonenumber page anchor
ValueDescriptionError Code
+15005550000This phone number is unavailable.21422
+15005550001This phone number is invalid.21421
+15005550006This phone number is valid and available.No error
ValueDescriptionError Code
533This area code doesn't have any available phone numbers.21452
500This area code has an available number.No error

Successfully provision a number. Purchase will always be completed successfully if you attempt to purchase the magic number +15005550006. Any other parameters you send with the request, such as a VoiceUrl or a StatusCallback, will be included in the API response.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_13
// Download the helper library from https://www.twilio.com/docs/node/install
_13
// Find your Account SID and Auth Token at twilio.com/console
_13
// and set the environment variables. See http://twil.io/secure
_13
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13
const authToken = process.env.TWILIO_AUTH_TOKEN;
_13
const client = require('twilio')(accountSid, authToken);
_13
_13
client.incomingPhoneNumbers
_13
.create({
_13
phoneNumber: '+15005550006',
_13
voiceUrl: 'http://demo.twilio.com/docs/voice.xml'
_13
})
_13
.then(incoming_phone_number => console.log(incoming_phone_number.sid));

Output

_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"address_requirements": "none",
_41
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"beta": false,
_41
"capabilities": {
_41
"voice": true,
_41
"sms": false,
_41
"mms": true,
_41
"fax": false
_41
},
_41
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"emergency_status": "Active",
_41
"emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"emergency_address_status": "registered",
_41
"friendly_name": "friendly_name",
_41
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"origin": "origin",
_41
"phone_number": "+15005550006",
_41
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_fallback_method": "GET",
_41
"sms_fallback_url": "https://example.com",
_41
"sms_method": "GET",
_41
"sms_url": "https://example.com",
_41
"status_callback": "https://example.com",
_41
"status_callback_method": "GET",
_41
"trunk_sid": null,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41
"voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"voice_caller_id_lookup": false,
_41
"voice_fallback_method": "GET",
_41
"voice_fallback_url": "https://example.com",
_41
"voice_method": "GET",
_41
"voice_url": "http://demo.twilio.com/docs/voice.xml",
_41
"bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"voice_receive_mode": "voice",
_41
"status": "in-use"
_41
}

Attempt to purchase an unavailable number. Trigger this by passing the magic number +15005550000.

Attempt to purchase an unavailable number

attempt-to-purchase-an-unavailable-number page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.incomingPhoneNumbers
_10
.create({phoneNumber: '+15005550000'})
_10
.then(incoming_phone_number => console.log(incoming_phone_number.sid));

Output

_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"address_requirements": "none",
_41
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"beta": false,
_41
"capabilities": {
_41
"voice": true,
_41
"sms": false,
_41
"mms": true,
_41
"fax": false
_41
},
_41
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"emergency_status": "Active",
_41
"emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"emergency_address_status": "registered",
_41
"friendly_name": "friendly_name",
_41
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"origin": "origin",
_41
"phone_number": "+15005550000",
_41
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_fallback_method": "GET",
_41
"sms_fallback_url": "https://example.com",
_41
"sms_method": "GET",
_41
"sms_url": "https://example.com",
_41
"status_callback": "https://example.com",
_41
"status_callback_method": "GET",
_41
"trunk_sid": null,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41
"voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"voice_caller_id_lookup": false,
_41
"voice_fallback_method": "GET",
_41
"voice_fallback_url": "https://example.com",
_41
"voice_method": "GET",
_41
"voice_url": "https://example.com",
_41
"bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"voice_receive_mode": "voice",
_41
"status": "in-use"
_41
}

Example 3: Attempt to buy an invalid number

test-post-example-3 page anchor

Just specify an invalid number as your input. Twilio will try to convert letters to numbers, but specifying a very short or very long string of either will fail.

Attempt to purchase an invalid number

attempt-to-purchase-an-invalid-number page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.incomingPhoneNumbers
_10
.create({phoneNumber: '33'})
_10
.then(incoming_phone_number => console.log(incoming_phone_number.sid));

Output

_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"address_requirements": "none",
_41
"address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"api_version": "2010-04-01",
_41
"beta": false,
_41
"capabilities": {
_41
"voice": true,
_41
"sms": false,
_41
"mms": true,
_41
"fax": false
_41
},
_41
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
_41
"emergency_status": "Active",
_41
"emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"emergency_address_status": "registered",
_41
"friendly_name": "friendly_name",
_41
"identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"origin": "origin",
_41
"phone_number": "33",
_41
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"sms_fallback_method": "GET",
_41
"sms_fallback_url": "https://example.com",
_41
"sms_method": "GET",
_41
"sms_url": "https://example.com",
_41
"status_callback": "https://example.com",
_41
"status_callback_method": "GET",
_41
"trunk_sid": null,
_41
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_41
"voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"voice_caller_id_lookup": false,
_41
"voice_fallback_method": "GET",
_41
"voice_fallback_url": "https://example.com",
_41
"voice_method": "GET",
_41
"voice_url": "https://example.com",
_41
"bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"voice_receive_mode": "voice",
_41
"status": "in-use"
_41
}


If you'd like to test API requests to send SMS messages without charging your account or sending an SMS, you can use your test credentials.

Just POST to the normal SMS API endpoint using your test credentials to authenticate and your TestAccountSid in the URL:


_10
POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/Messages

All of the existing outbound SMS parameters will work, except for MessagingServiceSid. In addition, we provide some specific values for certain parameters to help you generate success and failure cases.

Your test credentials don't have access to any valid 'From' phone numbers on your real account. Therefore, the only phone numbers you should use as 'From' numbers are the magic numbers listed here.

ValueDescriptionError Code
+15005550001This phone number is invalid.21212
+15005550007This phone number is not owned by your account or is not SMS-capable.21606
+15005550008This number has an SMS message queue that is full.21611
+15005550006This number passes all validation.No error
All OthersThis phone number is not owned by your account or is not SMS-capable.21606
ValueDescriptionError Code
+15005550001This phone number is invalid.21211
+15005550002Twilio cannot route to this number.21612
+15005550003Your account doesn't have the international permissions necessary to SMS this number.21408
+15005550004This number is blocked for your account.21610
+15005550009This number is incapable of receiving SMS messages.21614
All OthersAny other phone number is validated normally.Input-dependent

Successfully send an SMS. Trigger this by sending an SMS using the magic number +15005550006 as the From number, and a regular phone number for the To number.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.messages
_14
.create({
_14
body: 'All in the game, yo',
_14
from: '+15005550006',
_14
to: '+5571981265131'
_14
})
_14
.then(message => console.log(message.sid));

Output

_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"api_version": "2010-04-01",
_24
"body": "All in the game, yo",
_24
"date_created": "Thu, 30 Jul 2015 20:12:31 +0000",
_24
"date_sent": "Thu, 30 Jul 2015 20:12:33 +0000",
_24
"date_updated": "Thu, 30 Jul 2015 20:12:33 +0000",
_24
"direction": "outbound-api",
_24
"error_code": null,
_24
"error_message": null,
_24
"from": "+15005550006",
_24
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"num_media": "0",
_24
"num_segments": "1",
_24
"price": null,
_24
"price_unit": null,
_24
"sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"status": "queued",
_24
"subresource_uris": {
_24
"media": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media.json"
_24
},
_24
"to": "+5571981265131",
_24
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_24
}

Attempt to send a message to a non-mobile number. Trigger this by passing the magic number +15005550009 as the To number.

Attempt to send a message to a non-mobile number

attempt-to-send-a-message-to-a-non-mobile-number page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.messages
_14
.create({
_14
body: 'Hey Mr Nugget, you the bomb!',
_14
from: '+15005550006',
_14
to: '+15005550009'
_14
})
_14
.then(message => console.log(message.sid));

Output

_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"api_version": "2010-04-01",
_24
"body": "Hey Mr Nugget, you the bomb!",
_24
"date_created": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_sent": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_updated": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"direction": "outbound-api",
_24
"error_code": null,
_24
"error_message": null,
_24
"from": "+15005550006",
_24
"num_media": "0",
_24
"num_segments": "1",
_24
"price": null,
_24
"price_unit": null,
_24
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"status": "queued",
_24
"subresource_uris": {
_24
"media": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media.json"
_24
},
_24
"to": "+15005550009",
_24
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_24
}

Attempt to send a message with an empty SMS body. No need for magic numbers, the validation error will be raised normally.

Attempt to send a message with an empty SMS body

attempt-to-send-a-message-with-an-empty-sms-body page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.messages
_14
.create({
_14
from: '+15005550006',
_14
body: 'Do. Or do not. There is no try.',
_14
to: '+14108675310'
_14
})
_14
.then(message => console.log(message.sid));

Output

_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"api_version": "2010-04-01",
_24
"body": "Do. Or do not. There is no try.",
_24
"date_created": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_sent": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"date_updated": "Thu, 24 Aug 2023 05:01:45 +0000",
_24
"direction": "outbound-api",
_24
"error_code": null,
_24
"error_message": null,
_24
"from": "+15005550006",
_24
"num_media": "0",
_24
"num_segments": "1",
_24
"price": null,
_24
"price_unit": null,
_24
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"status": "queued",
_24
"subresource_uris": {
_24
"media": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media.json"
_24
},
_24
"to": "+14108675310",
_24
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_24
}


Test Making a Call

test-calls page anchor

If you'd like to test API requests to the outbound call endpoint without charging your account or making a call, you can use your test credentials. Note that since no call is made, Twilio will not request the URL passed in the 'Url' parameter and no TwiML will be executed.

Just POST to the normal outbound call API endpoint using your test credentials to authenticate and your TestAccountSid in the URL:


_10
POST https://api.twilio.com/2010-04-01/Accounts/{TestAccountSid}/Calls

All of the existing outbound call parameters will work. In addition, we provide some specific values for certain parameters to help you generate success and failure cases.

Your test credentials don't have access to any valid 'From' phone numbers on your real account. Therefore the only phone number you should use as a 'From' number is the magic number listed here.

ValueDescriptionError Code
+15005550001This phone number is invalid.21212
+15005550006This number is a valid From number for your account.No error
All OthersThe phone number is not verified for your account.21210
ValueDescriptionError Code
+15005550001This phone number is invalid.21217
+15005550002Twilio cannot route to this number.21214
+15005550003Your account doesn't have the international permissions necessary to call this number.21215
+15005550004This number is blocked for your account.21216
All OthersAny other phone number is validated normally.Input-dependent

Successfully enqueue an outgoing call. Use the magic number +15005550006 as the From number and any regular number as the To number.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.calls
_14
.create({
_14
url: 'http://demo.twilio.com/docs/voice.xml',
_14
to: '+14108675310',
_14
from: '+15005550006'
_14
})
_14
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+15005550006",
_37
"from_formatted": "(500) 555-0006",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14108675310",
_37
"to_formatted": "(410) 867-5310",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

Attempt to call an international number in a country without permission turned on. Trigger this by passing the magic number +15005550003 as the To number.

Making a call to an international number in a country without permissions turned on

making-a-call-to-an-international-number-in-a-country-without-permissions-turned-on page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.calls
_14
.create({
_14
url: 'http://demo.twilio.com/docs/voice.xml',
_14
to: '+15005550003',
_14
from: '+15005550006'
_14
})
_14
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+15005550006",
_37
"from_formatted": "(500) 555-0006",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+15005550003",
_37
"to_formatted": "(500) 555-0003",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}


Rate this page: