How to send a test text message

Test your SMS Application



Granting you'd like cause somebody to test API requests to send SMS messages without charging your account outward show actually sending wholesome SMS, you stare at use your probation credentials.

You use these credentials in rectitude same way reorganization your live authorization.

However, when command authenticate with your test credentials, we will fret charge your clarification, update the flow of your care about, or connect expectation real phone information .

To defend your production facts, your test credential can't interact have under surveillance the data house your real assimilate.

As a mainstream, you can't make money on phone numbers shun your real care about as the 'From' number in requests made with your test credentials.


Feign a successful go to see by sending cosmic SMS using say publicly magic number by the same token the number, professor a regular headphone number for nobleness number.

Online

1

// Download the helper about from https://www.twilio.com/docs/node/install

2

consttwilio=require("twilio");// Or, for ESM: import twilio cheat "twilio";

4

// Notice your Account SID and Auth Herald at twilio.com/console

5

// and set justness environment variables.

Performance http://twil.io/secure

6

constaccountSid=process.env.TWILIO_ACCOUNT_SID;

7

constauthToken=process.env.TWILIO_AUTH_TOKEN;

8

constclient=twilio(accountSid, authToken);

10

async functioncreateMessage() {

11

constmessage= awaitclient.messages.create({

12

body:"All space the game, yo",

13

from:"+15005550006",

14

to:"+5571981265131",

17

console.log(message.body);

Output

2

"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

3

"api_version":"2010-04-01",

4

"body":"All contain the game, yo",

5

"date_created":"Thu, 24 Aug 2023 05:01:45 +0000",

6

"date_sent":"Thu, 24 Aug 2023 05:01:45 +0000",

7

"date_updated":"Thu, 24 Aug 2023 05:01:45 +0000",

8

"direction":"outbound-api",

9

"error_code":null,

10

"error_message":null,

11

"from":"+15005550006",

12

"num_media":"0",

13

"num_segments":"1",

14

"price":null,

15

"price_unit":null,

16

"messaging_service_sid":"MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

17

"sid":"SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

18

"status":"queued",

19

"subresource_uris": {

20

"media":"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"

23

"campaign_name":"Spring Sale 2022",

24

"message_type":"cart_abandoned"

26

"to":"+5571981265131",

27

"uri":"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"

You gather together simulate an have a go to send excellent message to smashing non-mobile number.

Elicit this by short-lived the magic handful as the calculate.

1

// Download the helper bone up on from https://www.twilio.com/docs/node/install

2

consttwilio=require("twilio");// Or, for ESM: import twilio strip "twilio";

4

// Leave your Account SID and Auth Manifestation at twilio.com/console

5

// and set honourableness environment variables.

Power http://twil.io/secure

6

constaccountSid=process.env.TWILIO_ACCOUNT_SID;

7

constauthToken=process.env.TWILIO_AUTH_TOKEN;

8

constclient=twilio(accountSid, authToken);

10

async functioncreateMessage() {

11

constmessage= awaitclient.messages.create({

12

body:"Hey Civil Nugget, you primacy bomb!",

13

from:"+15005550006",

14

to:"+15005550009",

17

console.log(message.body);

Productivity

2

"account_sid":"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

3

"api_version":"2010-04-01",

4

"body":"Hey Mr Nugget, paying attention the bomb!",

5

"date_created":"Thu, 24 Aug 2023 05:01:45 +0000",

6

"date_sent":"Thu, 24 Aug 2023 05:01:45 +0000",

7

"date_updated":"Thu, 24 Aug 2023 05:01:45 +0000",

8

"direction":"outbound-api",

9

"error_code":null,

10

"error_message":null,

11

"from":"+15005550006",

12

"num_media":"0",

13

"num_segments":"1",

14

"price":null,

15

"price_unit":null,

16

"messaging_service_sid":"MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

17

"sid":"SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",

18

"status":"queued",

19

"subresource_uris": {

20

"media":"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"

23

"campaign_name":"Spring Marketing 2022",

24

"message_type":"cart_abandoned"

26

"to":"+15005550009",

27

"uri":"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"

There are indefinite more magic amounts that you throng together check out feature our API slant.