Získat katalog služeb
curl --request GET \
--url https://rest-api.smsmngr.com/v1/credit/services \
--header 'x-api-key: <api-key>'import requests
url = "https://rest-api.smsmngr.com/v1/credit/services"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://rest-api.smsmngr.com/v1/credit/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rest-api.smsmngr.com/v1/credit/services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rest-api.smsmngr.com/v1/credit/services"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://rest-api.smsmngr.com/v1/credit/services")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest-api.smsmngr.com/v1/credit/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"services": {
"sender": {
"sms": {
"420": {
"alnum": {
"name": {
"cs": "Textový odesílatel",
"en": "Text ID sender"
},
"subject": "defined",
"status": "new",
"prices": {
"czk": {
"setup": 500,
"monthly": 500
},
"eur": {
"setup": 20,
"monthly": 20
}
}
},
"simhost": {
"name": {
"cs": "SIM hosting",
"en": "SIM hosting"
},
"subject": "defined",
"prices": {
"czk": {
"setup": 200,
"monthly": 100,
"min_interval": "year"
},
"eur": {
"setup": 8,
"monthly": 4,
"min_interval": "year"
}
}
}
}
}
}
}
}Kredit
Získat katalog služeb
Vrací katalog objednatelných placených služeb (odesílatelé, virtuální čísla, SIM hosting, …). Katalog má strukturu services.sender.<platform>.<country_calling_code>.<variant>. Ploché id služby používané v /credit/order se skládá jako sender_<platform>_<calling_code>_<variant> (např. sender_sms_420_alnum).
Každá varianta služby obsahuje: lokalizovaný name (a volitelné requirements a delay), subject (defined = předmět dodáváte vy, např. text odesílatele nebo telefonní číslo, assigned = číslo z poolu je přiděleno automaticky), volitelný výchozí status a prices pro jednotlivé měny s poli setup, monthly a volitelně min_interval (month / year) nebo min_monthly_spend.
GET
/
credit
/
services
Získat katalog služeb
curl --request GET \
--url https://rest-api.smsmngr.com/v1/credit/services \
--header 'x-api-key: <api-key>'import requests
url = "https://rest-api.smsmngr.com/v1/credit/services"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://rest-api.smsmngr.com/v1/credit/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rest-api.smsmngr.com/v1/credit/services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://rest-api.smsmngr.com/v1/credit/services"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://rest-api.smsmngr.com/v1/credit/services")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest-api.smsmngr.com/v1/credit/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"services": {
"sender": {
"sms": {
"420": {
"alnum": {
"name": {
"cs": "Textový odesílatel",
"en": "Text ID sender"
},
"subject": "defined",
"status": "new",
"prices": {
"czk": {
"setup": 500,
"monthly": 500
},
"eur": {
"setup": 20,
"monthly": 20
}
}
},
"simhost": {
"name": {
"cs": "SIM hosting",
"en": "SIM hosting"
},
"subject": "defined",
"prices": {
"czk": {
"setup": 200,
"monthly": 100,
"min_interval": "year"
},
"eur": {
"setup": 8,
"monthly": 4,
"min_interval": "year"
}
}
}
}
}
}
}
}Was this page helpful?
⌘I