GatewayAPI accelerates development by removing the learning curve and guesswork, so you can get down to building right away with our APIs.
Getting the attention of your audience doesn’t have to be complicated. Find out how our services can help you break through the clutter and engage with your audience fast and efficiently. We are an award-winning platform with thousands of satisfied customers globally.
Read our guide on how to send SMS messages using GatewayAPI and the cURL coding language.
Set up your GatewayAPI account and start sending messages right away. Get access to intuitive and easy to use dashboards and services. In case you need help, our support team is only one click away.
Feel confident that you can always reach your recipients with our providers around the world. Get access to a distinct level of dependability and technical redundancy that guarantees rapid delivery of messages in real-time. Our historical uptime of over 99.99% speaks for itself.
With GatewayAPI as your messaging partner, you’ll have a fully GDPR-compliant service, including European data storage and ISAE 3000 certification (comparable to a SOC-2 report). Furthermore, we offer a unique EU setup, trusted by reputable organizations such as the Danish Ministry of Justice.
You can keep track of the uptime of our SMS APIs live and historically here. Our rates for 200+ countries as well as our ISAE 3000 GDPR report are freely accessible. Additionally, you can accurately follow up on the delivery to each recipient in the dashboard.
Reach new heights with our many add-on services. Supplement with our Email API or Number Lookup API or with virtual numbers and keywords. Setting up automation is a breeze with the many available integration options.
Our Support Team is ready to help you. Our average response time is less than 20 seconds within working hours and our satisfaction rate is a solid 98%. Additionally, there are no minimum spending requirements for receiving support.
using System.Net.Http.Json;
using System.Net.Http.Headers;
using HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Token",
"GoGenerateAnApiToken"
);
var messages = new {
sender = "ExampleSMS",
message = "Hello World!",
recipients = new[] { new { msisdn = 45_1234_5678 }},
};
using var resp = await client.PostAsync(
"https://gatewayapi.com/rest/mtsms",
JsonContent.Create(messages)
);
// On 2xx, print the SMS IDs received back from the API
// otherwise print the response content to see the error:
if (resp.IsSuccessStatusCode && resp.Content != null) {
Console.WriteLine("success!");
var content = await resp.Content.ReadFromJsonAsync<Dictionary<string, dynamic>>();
foreach (var smsId in content["ids"].EnumerateArray()) {
Console.WriteLine("allocated SMS id: {0:G}", smsId);
}
} else if (resp.Content != null) {
Console.WriteLine("failed :(\nresponse content:");
var content = await resp.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
curl -v "https://gatewayapi.com/rest/mtsms" \
-u "GoGenerateAnApiToken": \
-d sender="ExampleSMS" \
-d message="Hello World" \
-d recipients.0.msisdn=4512345678
package main
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"github.com/mrjones/oauth"
)
func main() {
// Authentication
key := "Create-an-API-Key"
secret := "GoGenerateAnApiKeyAndSecret"
consumer := oauth.NewConsumer(key, secret, oauth.ServiceProvider{})
client, err := consumer.MakeHttpClient(&oauth.AccessToken{})
if err != nil {
log.Fatal(err)
}
// Request
type GatewayAPIRecipient struct {
Msisdn uint64 `json:"msisdn"`
}
type GatewayAPIRequest struct {
Sender string `json:"sender"`
Message string `json:"message"`
Recipients []GatewayAPIRecipient `json:"recipients"`
}
request := &GatewayAPIRequest{
Sender: "ExampleSMS",
Message: "Hello World",
Recipients: []GatewayAPIRecipient{
{
Msisdn: 4512345678,
},
},
}
// Send it
var buf bytes.Buffer
if err := json.NewEncoder(&buf).Encode(request); err != nil {
log.Fatal(err)
}
res, err := client.Post(
"https://gatewayapi.com/rest/mtsms",
"application/json",
&buf,
)
if err != nil {
log.Fatal(err)
}
if res.StatusCode != 200 {
body, _ := ioutil.ReadAll(res.Body)
log.Fatalf("http error reply, status: %q, body: %q", res.Status, body)
}
// Parse the response
type GatewayAPIResponse struct {
Ids []uint64
}
response := &GatewayAPIResponse{}
if err := json.NewDecoder(res.Body).Decode(response); err != nil {
log.Fatal(err)
}
log.Println("ids", response.Ids)
}
package main
import (
"net/http"
"net/url"
)
func main() {
http.PostForm(
"https://gatewayapi.com/rest/mtsms",
url.Values{
"token": {"GoGenerateAnApiToken"},
"sender": {"ExampleSMS"},
"message": {"Hello World"},
"recipients.0.msisdn": {"4512345678"},
},
)
}
# install httpie oauth lib, with pip install httpie-oauth
http --auth-type=oauth1\
--auth="Create-an-API-Key:GoGenerateAnApiKeyAndSecret"\
"https://gatewayapi.com/rest/mtsms"\
sender='ExampleSMS'\
message='Hello world'\
recipients:='[{"msisdn": 4512345678}]'
http --auth=GoGenerateAnApiToken: \
https://gatewayapi.com/rest/mtsms\
sender='ExampleSMS'\
message='Hello world'\
recipients:='[{"msisdn": 4512345678}]'
// Install deps with gradle
// compile 'com.squareup.okhttp3:okhttp:3.4.1'
// compile 'se.akerfeldt:okhttp-signpost:1.1.0'
// compile 'org.json:json:20160810'
final String key = "Create-an-API-Key";
final String secret = "GoGenerateAnApiKeyAndSecret";
OkHttpOAuthConsumer consumer = new OkHttpOAuthConsumer(key, secret);
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new SigningInterceptor(consumer))
.build();
JSONObject json = new JSONObject();
json.put("sender", "ExampleSMS");
json.put("message", "Hello World");
json.put("recipients", (new JSONArray()).put(
(new JSONObject()).put("msisdn", 4512345678L)
));
RequestBody body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"), json.toString());
Request signedRequest = (Request) consumer.sign(
new Request.Builder()
.url("https://gatewayapi.com/rest/mtsms")
.post(body)
.build()).unwrap();
try (Response response = client.newCall(signedRequest).execute()) {
System.out.println(response.body().string());
}
import java.io.DataOutputStream;
import java.net.URL;
import java.net.URLEncoder;
import javax.net.ssl.HttpsURLConnection;
public class HelloWorld {
public static void main(String[] args) throws Exception {
URL url = new URL("https://gatewayapi.com/rest/mtsms");
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(
"token=GoGenerateAnApiToken"
+ "&sender=" + URLEncoder.encode("ExampleSMS", "UTF-8")
+ "&message=" + URLEncoder.encode("Hello World", "UTF-8")
+ "&recipients.0.msisdn=4512345678"
);
wr.close();
int responseCode = con.getResponseCode();
System.out.println("Got response " + responseCode);
}
}
async function sendSMS() {
const token = "GoGenerateAnApiToken";
const payload = {
sender: "ExampleSMS",
message: "Hello World",
recipients: [
{ msisdn: 45_1234_5678 },
],
};
const resp = await fetch(
"https://gatewayapi.com/rest/mtsms",
{
method: "POST",
body: JSON.stringify(payload),
headers: {
"Content-Type": "application/json",
"Authorization": `Token ${token}`,
},
},
);
console.log(await resp.json());
}
sendSMS();
<?php
//Send an SMS using Gatewayapi.com
$url = "https://gatewayapi.com/rest/mtsms";
$api_token = "GoGenerateAnApiToken";
//Set SMS recipients and content
$recipients = [4512345678, 4587654321];
$json = [
'sender' => 'ExampleSMS',
'message' => 'Hello world',
'recipients' => [],
];
foreach ($recipients as $msisdn) {
$json['recipients'][] = ['msisdn' => $msisdn];
}
//Make and execute the http request
//Using the built-in 'curl' library
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
curl_setopt($ch,CURLOPT_USERPWD, $api_token.":");
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($json));
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
print($result);
$json = json_decode($result);
print_r($json->ids);
# Install deps with: pip install requests
import requests
def send_sms(sender: str, msg_content: str, recipients: list[int]):
token="GoGenerateAnApiToken"
payload = {
"sender": sender,
"message": msg_content,
"recipients": [
{"msisdn": recipient_number}
for recipient_number in recipients
],
}
resp = requests.post(
"https://gatewayapi.com/rest/mtsms",
json=payload,
auth=(token, ""),
)
resp.raise_for_status()
print(resp.json())
send_sms("ExampleSMS", "Hello World", [45_1234_5678])
require 'uri'
require 'net/http'
require 'json'
body = {
'recipients': [{'msisdn': 45_1234_5678}],
'message': 'Hello World',
'sender': 'ExampleSMS',
}
token = 'GoGenerateAnApiToken'
resp = Net::HTTP.post(
URI.parse('https://gatewayapi.com/rest/mtsms'),
JSON.generate(body),
{
'Content-Type': 'application/json',
'Authorization': "Token #{token}",
},
)
puts resp.body
Free plugin for sending SMS messages and setting up 2-factor login.
Integrate with over 5,000 apps via Zapier and get started automating SMS workflows.
Hook up to GatewayAPI with a direct SMPP-connection and send huge volumes of text messages seamlessly.
Integrate easily with GatewayAPI
Integrate with our APIs in your preferred programming language. Or use Zapier, Flowize or Make to connect with GatewayAPI: Just find the app, service or platform you want to integrate with and get started right away!
Whichever method you choose, it’s fast and easy to set up.