Welcome to Bandwidth's Developer Docs

Welcome to Bandwidth's Developer Docs

Click and play around to learn more about Bandwidth's APIs


Messaging icon Messaging

Communication at its most basic. Adding SMS or MMS is a snap.

Voice icon Voice

Need to make a call? Placing and receiving phone calls is fast and easy with Bandwidth Voice.

Phone Numbers icon Numbers

We’ve got your number. In fact, we have as many of them as you want.

Send a message

var body = new BandwidthMessaging.MessageRequest({
    "applicationId": applicationId ,
    "to": ["+19999999999"],
    "from": "+18888888888",
    "text": "The quick brown fox jumps over a lazy dog."
});

var response = await messagingController.createMessage(msgUserId, body);
console.log(response);
MessageRequest msgReq = new MessageRequest();

List<String> toNumbers = new ArrayList<>();

toNumbers.add("+19999999999");

msgReq.setTo( toNumbers );
msgReq.setFrom("+18888888888");
msgReq.setApplicationId("1-2-3");
msgReq.setText("Hello World");

 try {
    ApiResponse<BandwidthMessage> response = msgController.createMessage(accountId, messageRequest);
    System.out.println(response.getResult().getId());
} catch (ApiException  | IOException e){
    //Handle
}
MessageRequest msgRequest = new MessageRequest();
msgRequest.ApplicationId = applicationId;
msgRequest.From = "+18888888888";
msgRequest.To = new string[1] {"9199199999"};
msgRequest.Text = "The quick brown fox jumps over a lazy dog.";

msgController.CreateMessage(msgUserId, msgRequest);
account_id = "1"
body = MessageRequest.new
body.application_id = "1-2-3"
body.to = ["+17777777777"]
body.from = "+18888888888"
body.text = "Hello from Bandwidth"

result = message_controller.create_message(account_id,:body => body)
curl -X POST \
    --url 'https://messaging.bandwidth.com/api/v2/users/{accountId}/messages' \
    -u '{apiToken}:{apiSecret}' \
    -H 'Content-type: application/json' \
    --data-raw '
    {
      "to"            : ["+12345678902"],
      "from"          : "+12345678901",
      "text"          : "Hey, check this out!",
      "applicationId" : "93de2206-9669-4e07-948d-329f4b722ee2",
      "tag"           : "test message"
    }
  '
account_id = "123"
body = MessageRequest()
body.application_id = "1-d-b"
body.to = ["+17777777777"]
body.mfrom = "+18888888888"
body.text = "Greetings!"

result = messaging_client.create_message(account_id, body=body)
$body = new BandwidthLib\Messaging\Models\MessageRequest();
$body->applicationId = "93de2206-9669-4e07-948d-329f4b722ee2";
$body->to = array("+12345678902");
$body->from = "+12345678901";
$body->text = "Hey, check this out!";

$response = $messagingClient->createMessage($messagingAccountId, $body);

Make a call

var body = new BandwidthVoice.ApiCreateCallRequest({
    "from": "+19999999999",
    "to": "+18888888888",
    "applicationId": "123",
    "answerUrl": "https://test.com",
    "answerMethod": "POST",
    "callTimeout": 30
});
var response = await voiceController.createCall(accountId, body);
console.log(response);
ApiCreateCallRequest callRequest = new ApiCreateCallRequest();

callRequest.setApplicationId("3-d-4-b-5");
callRequest.setFrom("+17777777777");
callRequest.setTo("+19999999999");
callRequest.setAnswerUrl("https://test.com");

try {
    ApiResponse<ApiCallResponse> response = voiceController.createCall(accountId, callRequest);
    System.out.println(response.getResult().getCallId());
} catch (IOException | ApiException e) {
    //Handle
}
callRequest.ApplicationId = "3-d-4-b-5";
callRequest.To="+19999999999";
callRequest.AnswerUrl= "https://test.com";
callRequest.From="+17777777777";

//Be aware that the Voice Client can throw exceptions
voiceController.CreateCall(accountId, callRequest);
account_id = '1'
body = ApiCreateCallRequest.new
body.from = '+16666666666'
body.to = '+17777777777'
body.answer_url = 'https://test.com'
body.application_id = '3-d-4-b-5'

result = voice_client.create_call(account_id,:body => body)
curl -X POST \
    --url 'https://voice.bandwidth.com/api/v2/accounts/{accountId}/calls' \
    -u '{username}:{password}' \
    -H 'Content-type: application/json' \
    --data-raw '
    {
      "from"          : "+19195551212",
      "to"            : "+19195551313",
      "answerUrl"     : "http://www.myapp.com/hello",
      "applicationId" : "7fc9698a-b04a-468b-9e8f-91238c0d0086"
    }'
account_id = "123"
body = ApiCreateCallRequest()
body.mfrom = "+17777777777"
body.to = "+16666666666"
body.application_id = "3-d-4-b-5"
body.answer_url = "https://test.com"

result = voice_client.create_call(account_id, body=body)
$body = new BandwidthLib\Voice\Models\ApiCreateCallRequest();
$body->from = "+15554442222";
$body->to = "+15554443333";
$body->answerUrl = "https://test.com";
$body->applicationId = "3-6-4-a";

$response = $voiceClient->createCall($accountId, $body);

Buy a telephone number

curl -X POST \
    --url 'https://dashboard.bandwidth.com/api/accounts/{accountId}/orders' \
    -u '{username}:{password}' \
    -H 'Content-type: application/xml; charset=utf-8' \
    --data-raw '
    <Order>
        <AreaCodeSearchAndOrderType>
            <AreaCode>910</AreaCode>
            <Quantity>1</Quantity>
        </AreaCodeSearchAndOrderType>
        <SiteId>{Site-ID}</SiteId>
    </Order>
  '
// Coming Soon
// Coming Soon
## Coming Soon
## Coming Soon
// Coming soon

results matching ""

    No results matching ""