Send an SMS batch
curl --request POST \
--url https://api.robase.dev/v1/sms/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"messages": [
{
"to": "<string>",
"body": "<string>",
"template": "<string>",
"variables": {},
"idempotency_key": "<string>"
}
],
"template": "<string>",
"country": "<string>",
"send_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.robase.dev/v1/sms/batch"
payload = {
"from": "<string>",
"messages": [
{
"to": "<string>",
"body": "<string>",
"template": "<string>",
"variables": {},
"idempotency_key": "<string>"
}
],
"template": "<string>",
"country": "<string>",
"send_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
messages: [
{
to: '<string>',
body: JSON.stringify('<string>'),
template: '<string>',
variables: {},
idempotency_key: '<string>'
}
],
template: '<string>',
country: '<string>',
send_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.robase.dev/v1/sms/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.robase.dev/v1/sms/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'messages' => [
[
'to' => '<string>',
'body' => '<string>',
'template' => '<string>',
'variables' => [
],
'idempotency_key' => '<string>'
]
],
'template' => '<string>',
'country' => '<string>',
'send_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.robase.dev/v1/sms/batch"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"messages\": [\n {\n \"to\": \"<string>\",\n \"body\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"template\": \"<string>\",\n \"country\": \"<string>\",\n \"send_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.robase.dev/v1/sms/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"messages\": [\n {\n \"to\": \"<string>\",\n \"body\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"template\": \"<string>\",\n \"country\": \"<string>\",\n \"send_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.robase.dev/v1/sms/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"messages\": [\n {\n \"to\": \"<string>\",\n \"body\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"template\": \"<string>\",\n \"country\": \"<string>\",\n \"send_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": 123,
"failed": 123,
"success": true,
"data": [
{
"index": 123,
"replayed": true,
"sms": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": "+2348012345678",
"from": "SHUTTLERS",
"body": "<string>",
"segments": 123,
"country": "NG",
"carrier": "mtn_ng",
"provider": "beem",
"provider_message_id": "<string>",
"provider_attempts": [
{
"provider": "<string>",
"attempted_at": "2023-11-07T05:31:56Z",
"ok": true,
"provider_message_id": "<string>",
"error_code": "<string>",
"error_message": "<string>"
}
],
"cost": {
"amount_kobo": 123,
"currency": "NGN"
},
"test_mode": true,
"created_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z"
},
"error": {
"error": {
"message": "<string>",
"field": "<string>"
}
}
}
]
}SMS
Send an SMS batch
POST
/
sms
/
batch
Send an SMS batch
curl --request POST \
--url https://api.robase.dev/v1/sms/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"messages": [
{
"to": "<string>",
"body": "<string>",
"template": "<string>",
"variables": {},
"idempotency_key": "<string>"
}
],
"template": "<string>",
"country": "<string>",
"send_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.robase.dev/v1/sms/batch"
payload = {
"from": "<string>",
"messages": [
{
"to": "<string>",
"body": "<string>",
"template": "<string>",
"variables": {},
"idempotency_key": "<string>"
}
],
"template": "<string>",
"country": "<string>",
"send_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
messages: [
{
to: '<string>',
body: JSON.stringify('<string>'),
template: '<string>',
variables: {},
idempotency_key: '<string>'
}
],
template: '<string>',
country: '<string>',
send_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.robase.dev/v1/sms/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.robase.dev/v1/sms/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'messages' => [
[
'to' => '<string>',
'body' => '<string>',
'template' => '<string>',
'variables' => [
],
'idempotency_key' => '<string>'
]
],
'template' => '<string>',
'country' => '<string>',
'send_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.robase.dev/v1/sms/batch"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"messages\": [\n {\n \"to\": \"<string>\",\n \"body\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"template\": \"<string>\",\n \"country\": \"<string>\",\n \"send_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.robase.dev/v1/sms/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"messages\": [\n {\n \"to\": \"<string>\",\n \"body\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"template\": \"<string>\",\n \"country\": \"<string>\",\n \"send_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.robase.dev/v1/sms/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"messages\": [\n {\n \"to\": \"<string>\",\n \"body\": \"<string>\",\n \"template\": \"<string>\",\n \"variables\": {},\n \"idempotency_key\": \"<string>\"\n }\n ],\n \"template\": \"<string>\",\n \"country\": \"<string>\",\n \"send_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": 123,
"failed": 123,
"success": true,
"data": [
{
"index": 123,
"replayed": true,
"sms": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": "+2348012345678",
"from": "SHUTTLERS",
"body": "<string>",
"segments": 123,
"country": "NG",
"carrier": "mtn_ng",
"provider": "beem",
"provider_message_id": "<string>",
"provider_attempts": [
{
"provider": "<string>",
"attempted_at": "2023-11-07T05:31:56Z",
"ok": true,
"provider_message_id": "<string>",
"error_code": "<string>",
"error_message": "<string>"
}
],
"cost": {
"amount_kobo": 123,
"currency": "NGN"
},
"test_mode": true,
"created_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z"
},
"error": {
"error": {
"message": "<string>",
"field": "<string>"
}
}
}
]
}Authorizations
Pass your API key as Authorization: Bearer rb_live_...
Body
application/json
⌘I