Login and go to 'Advanced' - 'API authentication' to find the API keys
Required
client_secret
API client secret
Login and go to 'Advanced' - 'API authentication' to find the API keys
Required
ID
Group ID
Group ID to be modified
Required
name
Name of the group
The new name of the group
Required
<?php
//PHP - cURL
$ch = curl_init();
$url = "https://api.smsgatewayapi.com/v1/groups/";
$client_id = "XXX"; // Your API client ID (required)
$client_secret = "YYY"; // Your API client secret (required)
$data = [
'ID' => {ID}, //Group ID (required)
'name' => "Marketing" //Name of the group (required)
];
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-Client-Id: $client_id",
"X-Client-Secret: $client_secret",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
?>
//NodeJs - HTTP request
const https = require("https");
const client_id = "XXX"; // Your API client ID (required)
const client_secret = "YYY"; // Your API client secret (required)
const data = JSON.stringify({
ID: {ID}, //Group ID (required)
name: "Marketing", //Name of the group (required)
});
const options = {
hostname: "api.smsgatewayapi.com",
port: 443,
path: "/v1/groups/",
method: "PATCH",
headers: {
"X-Client-Id": client_id,
"X-Client-Secret": client_secret,
"Content-Type": "application/json",
"Content-Length": data.length,
},
};
const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`);
res.on("data", (d) => {
process.stdout.write(d);
});
});
req.write(data);
req.end();
//Ruby - Net::HTTP
require "uri"
require "net/http"
url = URI("https://api.smsgatewayapi.com/v1/groups/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Client-Id"] = "XXX" // Your API key
request["X-Client-Secret"] = "YYY" // Your API secret
request["Content-Type"] = "application/json"
form_data = [
['ID', {ID}], //Group ID (required)
['name', "Marketing"] //Name of the group (required)
]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
//Python - Requests
import requests
url = "https://api.smsgatewayapi.com/v1/groups/"
payload={
'ID' : '{ID}', #Group ID (required)
'name' : 'Marketing' #Name of the group (required)
}
headers = {
'X-Client-Id': 'XXX', #Your API key
'X-Client-Secret': 'YYY', #Your API secret
'Content-Type': 'application/json'
}
response = requests.request(
"PATCH",
url,
headers=headers,
json=payload
)
print(response.text)
//C# - RestSharp
var url = "https://api.smsgatewayapi.com/v1/groups/";
var payload = new {
ID = {ID},
name = "Marketing
};
?>
var client = new RestClient(url);
client.Timeout = -1;
var request = new RestRequest(Method.PATCH);
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 = '{
"ID": "{ID}", //Group ID (required)
"name": "Marketing" //Name of the group (required)
}'
$response = Invoke-RestMethod 'https://api.smsgatewayapi.com/v1/groups/' -Method 'PATCH' -Headers $headers -Body $body -ContentType “application/json; charset=utf-8”
$response | ConvertTo-Json
//Shell - wget
wget --no-check-certificate --quiet \
--method PATCH \
--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 '{
"ID" : "{ID}", //Group ID (required)
"name" : "Marketing" //Name of the group (required)
}' \
'https://api.smsgatewayapi.com/v1/groups/'
If one or more IDs are not found, the API returns a 404 status code and all modifications of the current request are canceled.
Example response single:
{
"ID": [ {id} ]
}
Example response multiple:
{
"IDs": [ {id1}, {id2}, ...]
}
SMS gateway API
Smstools
SMS gateway integreren via onze SMS API. Hiermee kan je jouw software verbinden met onze SMS gateway om SMS berichten te versturen en ontvangen. Gratis testaccount. Start direct!
5 van de 5 op basis van 2439 gebruikersbeoordelingen.
SMSGATEWAYAPIAPI1
REGISTREER NU
Probeer onze geavanceerde SMS software & API vandaag!