Exportação da lista de preços
Baixe uma lista de preços para serviços SMS. Retorna preços para rotas Direct e Text2Speech nos formatos JSON, XLSX ou CSV. Especifique um código de país ISO de 2 letras (por exemplo, DE, CH) ou ‘all’ para todos os países. A resposta inclui moeda e requisitos específicos do país.
Parameters
Seção intitulada “ Parameters ”Path Parameters
Seção intitulada “Path Parameters ”Código de país ISO de duas letras ou ‘all’ para todos os países
Query Parameters
Seção intitulada “Query Parameters ”Formato de saída
Moeda para os preços
Idioma para os nomes dos países
Responses
Seção intitulada “ Responses ”Price list file
Single country response
object
ISO-2 country code
Human-readable country name in the requested language
Price currency
Country-specific requirements for sending SMS
Price rates keyed by service code
object
S, M, L, XL rate tiers
All countries response
object
object
Examples
Price list for Italy in CHF
Example response for /pricelist/it?currency=chf
{ "country": "IT", "name": "Italy", "currency": "CHF", "requirements": "Text Sender-ID needs to be registered. Only for companies with VAT and PEC in ITALY. Numeric sender-ID possible.", "rates": { "pro": [ 0.06, 0.05, 0.049, 0.048 ], "economy": [ 0.05, 0.044, 0.043, 0.042 ], "direct": [ 0.072, 0.062, 0.061, 0.06 ], "text2speech": [ 0.038, 0.032, 0.031, 0.03 ] }}Invalid input
Resource not found
Code Samples
#!/usr/bin/env bashcurl -s 'https://api.lox24.eu/pricelist/de?currency=chf&lang=de'#!/usr/bin/env bashcurl -s 'https://api.lox24.eu/pricelist/all?format=xlsx¤cy=eur&lang=de' -o lox24_pricelist_eur_all.xlsxusing System;using System.IO;using System.Net;using System.Text;
namespace Lox24.Api{ class Pricelist { static void Main() { string url = "https://api.lox24.eu/pricelist/de?currency=chf&lang=de";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(url); httpWebRequest.Method = "GET";
try { using (HttpWebResponse resp = (HttpWebResponse)httpWebRequest.GetResponse()) { using (StreamReader sr = new StreamReader(resp.GetResponseStream(), Encoding.UTF8)) { Console.WriteLine(sr.ReadToEnd()); } } } catch (WebException ex) { var webResponse = ex.Response as HttpWebResponse; Console.WriteLine("Error: " + webResponse.StatusCode); using (StreamReader sr = new StreamReader(webResponse.GetResponseStream(), Encoding.UTF8)) { Console.WriteLine(sr.ReadToEnd()); } } } }}package main
import ( "fmt" "io" "log" "net/http")
func main() { url := "https://api.lox24.eu/pricelist/de?currency=chf&lang=de"
res, err := http.Get(url) if err != nil { log.Fatal(err) } defer res.Body.Close()
body, err := io.ReadAll(res.Body) if err != nil { log.Fatal(err) }
if res.StatusCode == 200 { fmt.Println(string(body)) } else { fmt.Printf("Error: %d\n%s\n", res.StatusCode, string(body)) }}package eu.lox24.doc.user;
import java.io.IOException;import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.time.Duration;
public class GetPricelist {
public static void main(String[] args) {
var url = "https://api.lox24.eu/pricelist/de?currency=chf&lang=de";
var httpRequest = HttpRequest.newBuilder(URI.create(url)) .timeout(Duration.ofMillis(100000)) .GET() .build();
var client = HttpClient.newBuilder().build();
try { var httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
if (httpResponse.statusCode() == 200) { System.out.println(httpResponse.body()); } else { System.out.println("Error: " + httpResponse.statusCode()); System.out.println(httpResponse.body()); }
} catch (IOException | InterruptedException e) { e.printStackTrace(); } }}const https = require('https');
const url = 'https://api.lox24.eu/pricelist/de?currency=chf&lang=de';
https.get(url, res => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { if (res.statusCode === 200) { console.log(JSON.parse(data)); } else { console.log(`Error: ${res.statusCode}`); console.log(data); } });}).on('error', err => { console.error(err);});<?php
$uri = 'https://api.lox24.eu/pricelist/de?currency=chf&lang=de';
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => $uri, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 20,]);
$response = curl_exec($curl);$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);curl_close($curl);
$data = json_decode($response, true);
if (200 === $code) { echo json_encode($data, JSON_PRETTY_PRINT);} else { echo "Error: code = {$code}\n" . $response;}import jsonimport requests
url = 'https://api.lox24.eu/pricelist/de'params = {'currency': 'chf', 'lang': 'de'}
try: res = requests.get(url, params=params, timeout=100) res.raise_for_status() print(json.dumps(res.json(), indent=4))except requests.HTTPError: print(f'Error: {res.status_code}') print(res.text)