JT Noble SMS documentation home

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:

[]
HTTPcodeMessage
401unauthorizedNot authenticated
429rate_limitedToo 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):

FieldTypeRequiredDefaultMeaning
namestringYesA name.
countriesarray of stringNoTwo-letter country codes, for example ["NG","GH"]. Leave it out for your default country.
use_casestringNoWhat 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"
  ]
}
HTTPcodeMessage
400bad_request
400sender_reserved
401unauthorizedNot authenticated
409duplicate_request
422validation_errorRequest validation failed
429rate_limitedToo 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
}
HTTPcodeMessage
401unauthorizedNot authenticated
429rate_limitedToo 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 valueTypeMeaning
sender_idintegerSender name, up to 11 characters. It must be approved on your account. Without it the default sender is used.
QueryTypeRequiredDefaultMeaning
confirmbooleanNofalseSet 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"
}
HTTPcodeMessage
401unauthorizedNot authenticated
404not_foundSender ID not found
409confirm_requiredThis sender ID is approved. Deleting it removes it from your account. Pass confirm=true to proceed.
429rate_limitedToo many requests. Try again in a moment.

On this page