For Developers

Getting Started

Welcome to TxtBox! πŸŽ‰
Now that you're logged in, you’re ready to start sending SMS. sending sms
πŸ“Œ Important: Your default sender name is "TEST ONLY". If you'd like to use a custom sender name, follow these steps to request one:
Start messaging effortlessly with TxtBox! πŸš€

Using TXTBOX API

API Request:
POST
https://ws-v2.txtbox.com/messaging/v1/sms/push
Header:
X-TXTBOX-Auth: {PROJECT_API_KEY}
*All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Body:
FIELDTYPEDESCRIPTION
messagestringThe content of the message
numberNumberThe content of the recipient
*Please note that there are 160 characters per message.

Examples

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL =>"https://ws-v2.txtbox.com/messaging/v1/sms/push",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('message' =>'Sample text message','number' => '09955563764'),
CURLOPT_HTTPHEADER => array(
"X-TXTBOX-Auth: PROJECT_API_KEY"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Footer logo
Developed by
Footer logo
Β©2022 Txtbox v2.0.0 All rights reserved.