PHP
Node
Ruby
Python
C#
<?php
$ch = curl_init();
$url = "https://api.smsgatewayapi.com/v1/subaccount";
$client_id = "XXX"; // Your API client ID (required)
$client_secret = "YYY"; // Your API client secret (required)
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
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",
]);
$response = curl_exec($ch);
?>
const https = require("https");
const client_id = "XXX"; // Your API client ID (required)
const client_secret = "YYY"; // Your API client secret (required)
const options = {
hostname: "api.smsgatewayapi.com",
port: 443,
path: "/v1/subaccount",
method: "GET",
headers: {
"X-Client-Id": client_id,
"X-Client-Secret": client_secret,
},
};
const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`);
res.on("data", (d) => {
process.stdout.write(d);
});
});
req.write(data);
req.end();
require "uri"
require "net/http"
url = URI("https://api.smsgatewayapi.com/v1/subaccount")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = "XXX" // Your API key
request["X-Client-Secret"] = "YYY" // Your API secret
response = https.request(request)
puts response.read_body
import requests
url = "https://api.smsgatewayapi.com/v1/subaccount"
payload={
}
headers = {
'X-Client-Id': 'XXX', #Your API key
'X-Client-Secret': 'YYY', #Your API secret
'Content-Type': 'application/json'
}
response = requests.request(
"GET",
url,
headers=headers,
json=payload
)
print(response.text)
var url = "https://api.smsgatewayapi.com/v1/subaccount";
var client = new RestClient(url);
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("X-Client-Id", "XXX"); // Your API key
request.AddHeader("X-Client-Secret", "YYY"); // Your API secret
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);