Sender IDs
Every sender ids route, with request, response, errors and samples in curl, Node, Python and PHP.
See the overview for sign-in and the error shape.
List your sender IDs
GET /v1/sender-ids
Who can call it: Any API key, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/sender-ids" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/sender-ids', {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.get(
"https://api.sms.jtnoble.com/v1/sender-ids",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/sender-ids');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
[]| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Request a sender ID
POST /v1/sender-ids
Who can call it: Any API key, or a dashboard session token.
Body (JSON):
| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
name | string | Yes | A name. | |
countries | array of string | No | Two-letter country codes, for example ["NG","GH"]. Leave it out for your default country. | |
use_case | string | No | What you send with it, up to 500 characters. |
curl -X POST "https://api.sms.jtnoble.com/v1/sender-ids" \
-H "Authorization: Bearer $JTSMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"MYSHOP","use_case":"Order updates to our customers"}'const resp = await fetch('https://api.sms.jtnoble.com/v1/sender-ids', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"MYSHOP","use_case":"Order updates to our customers"}),
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.post(
"https://api.sms.jtnoble.com/v1/sender-ids",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
json={"name":"MYSHOP","use_case":"Order updates to our customers"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/sender-ids');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"MYSHOP","use_case":"Order updates to our customers"}',
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"id": 4,
"name": "MYSHOP",
"status": "pending",
"countries": [
"NG"
]
}| HTTP | code | Message |
|---|---|---|
| 400 | bad_request | |
| 400 | sender_reserved | |
| 401 | unauthorized | Not authenticated |
| 409 | duplicate_request | |
| 422 | validation_error | Request validation failed |
| 429 | rate_limited | Too many requests. Try again in a moment. |
The default sender
GET /v1/sender-ids/default
The platform default sender and whether accounts may use it.
Who can call it: Any API key, or a dashboard session token.
curl -X GET "https://api.sms.jtnoble.com/v1/sender-ids/default" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/sender-ids/default', {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.get(
"https://api.sms.jtnoble.com/v1/sender-ids/default",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/sender-ids/default');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"country": "NG",
"sender": "MYSHOP",
"allowed": true
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 429 | rate_limited | Too many requests. Try again in a moment. |
Delete a sender ID
DELETE /v1/sender-ids/{sender_id}
Delete one of the caller's own requests. An approved sender needs ?confirm=true.
Who can call it: Any API key, or a dashboard session token.
| Path value | Type | Meaning |
|---|---|---|
sender_id | integer | Sender name, up to 11 characters. It must be approved on your account. Without it the default sender is used. |
| Query | Type | Required | Default | Meaning |
|---|---|---|---|---|
confirm | boolean | No | false | Set true to delete an approved sender ID. |
curl -X DELETE "https://api.sms.jtnoble.com/v1/sender-ids/SENDER_ID" \
-H "Authorization: Bearer $JTSMS_API_KEY"const resp = await fetch('https://api.sms.jtnoble.com/v1/sender-ids/SENDER_ID', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.JTSMS_API_KEY}` },
});
console.log(resp.status, await resp.text());import os
import requests
resp = requests.delete(
"https://api.sms.jtnoble.com/v1/sender-ids/SENDER_ID",
headers={"Authorization": f"Bearer {os.environ['JTSMS_API_KEY']}"},
timeout=30,
)
print(resp.status_code, resp.text)<?php
$ch = curl_init('https://api.sms.jtnoble.com/v1/sender-ids/SENDER_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('JTSMS_API_KEY')],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $body, PHP_EOL;HTTP 200:
{
"status": "deleted",
"id": 4,
"name": "MYSHOP"
}| HTTP | code | Message |
|---|---|---|
| 401 | unauthorized | Not authenticated |
| 404 | not_found | Sender ID not found |
| 409 | confirm_required | This sender ID is approved. Deleting it removes it from your account. Pass confirm=true to proceed. |
| 429 | rate_limited | Too many requests. Try again in a moment. |