Quickstart
This guide gets you set up to authenticate and make your first TextPro API request.
Before you can make requests to the TextPro API, you will need to grab your API key from your dashboard. You can find it under API Keys.
Choose Your Client
You can integrate with cURL, JavaScript, Python, or PHP. Install your preferred client tooling first.
# cURL is likely already installed
curl --version
# Install your preferred HTTP client
npm install axios --save
# Install requests
pip install requests
# Install Guzzle HTTP client
composer require guzzlehttp/guzzle
Make Your First API Request
Send POST /api/send/sms using your API key.
POST
/api/send/sms
curl -X POST https://textpro.co.uk/api/send/sms \
-H "X-API-KEY: tp_live_xxx" \
-H "Content-Type: application/json" \
-d '{"to":"+447000000000","message":"Quickstart message"}'
POST
/api/send/sms
import axios from 'axios'
await axios.post('https://textpro.co.uk/api/send/sms', {
to: '+447000000000',
message: 'Quickstart message',
}, {
headers: {
'X-API-KEY': 'tp_live_xxx',
'Content-Type': 'application/json',
},
})
POST
/api/send/sms
import requests
requests.post(
'https://textpro.co.uk/api/send/sms',
headers={
'X-API-KEY': 'tp_live_xxx',
'Content-Type': 'application/json',
},
json={
'to': '+447000000000',
'message': 'Quickstart message',
},
)
POST
/api/send/sms
$client = new \GuzzleHttp\Client();
$response = $client->post('https://textpro.co.uk/api/send/sms', [
'headers' => [
'X-API-KEY' => 'tp_live_xxx',
'Content-Type' => 'application/json',
],
'json' => [
'to' => '+447000000000',
'message' => 'Quickstart message',
],
]);