//C# - RestSharp
var url = "https://api.smsgatewayapi.com/v1/optouts";
var payload = new {
number = "11231231234"
};
?>
var client = new RestClient(url);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("X-Client-Id", "XXX"); // Your API key
request.AddHeader("X-Client-Secret", "YYY"); // Your API secret
request.AddHeader("Content-Type", "application/json");
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(payload);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//PowerShell - RestMethod
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("X-Client-Id", "XXX") // Your API key
$headers.Add("X-Client-Secret", "YYY") // Your API secret
$body = '{
"number": "11231231234" //Contact number (required)
}'
$response = Invoke-RestMethod 'https://api.smsgatewayapi.com/v1/optouts' -Method 'POST' -Headers $headers -Body $body -ContentType “application/json; charset=utf-8”
$response | ConvertTo-Json
//Shell - wget
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'X-Client-Id: XXX' \ // Your API key
--header 'X-Client-Secret: YYY' \ // Your API secret
--header 'Content-Type: application/json' \
--body-data '{
"number" : "11231231234" //Contact number (required)
}' \
'https://api.smsgatewayapi.com/v1/optouts'
Normal response: http status code 201 (Created).
SMS API
Smstools
With our SMS gateway API you can add text messaging to your platform in minutes. Free trial.
5 out of 5 based on 2648 user ratings.
SMSGATEWAYAPIAPI1
REGISTER NOW
Discover our text message marketing platform today!