Getting started
Get authenticated and running in under 5 minutes
SMSEdge API allows you to build your marketing application on top of a robust SMS infrastructure.
Communications schema
Sending your first SMS
After registering an account, go to the user's settings page and copy your API key.
Example API Key |
---|
L_ygPwSdOsfw41bM94 |
To send a request append the api key to the requests as seen below
# Send SMS Text
curl -X POST \
-d "api_key=L_ygPwSdOsfw41bM94"\
--url https://api.smsedge.io/v1/references/functions/
# Response - {"id":124,"time_created":"2020-12-01 18:28:58","verify_local":1,"verify_hlr":0,"shorten_url":1,"list_id":null,"reference":null}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.smsedge.io/v1/references/functions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=L_ygPwSdOsfw41bM94",
CURLOPT_HTTPHEADER => array(
"content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_key=L_ygPwSdOsfw41bM94");
Request request = new Request.Builder()
.url("https://api.smsedge.io/v1/references/functions/")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://api.smsedge.io/v1/references/functions/");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("", "api_key=L_ygPwSdOsfw41bM94", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import http.client
conn = http.client.HTTPSConnection("https://api.smsedge.io/v1/references/functions/")
payload = "api_key=L_ygPwSdOsfw41bM94"
headers = {
'content-type': "application/x-www-form-urlencoded"
}
conn.request("POST", "/api/sms/send", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.smsedge.io/v1/references/functions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "api_key=L_ygPwSdOsfw41bM94"
response = http.request(request)
puts response.read_body
You can find all API endpoints at our API Reference, for example - send a single SMS
Updated about 4 years ago
What’s Next