🌎getCountries | Получение всех страны
Данный метод возвращает все доступные страны.
Last updated
Данный метод возвращает все доступные страны.
Last updated
GET
https://api.meowsms.app/getCountries/
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
{
"result": true,
"countries": [
{
"name": "🇪🇸 Испания",
"pattern": "spain",
"number_pattern": "/^34[679]\\d{8}$/",
"number_example": "34xxxxxxxxx",
"price": "0.1"
},
{
"name": "🇵🇹 Португалия",
"pattern": "portugal",
"number_pattern": "/^351\\d{9}$/",
"number_example": "351xxxxxxxxx",
"price": "0.1"
},
{
"name": "🇮🇹 Италия",
"pattern": "italy",
"number_pattern": "/^39\\d{10}$/",
"number_example": "39xxxxxxxxxx",
"price": "0.1"
},
{
"name": "🇵🇱 Польша",
"pattern": "poland",
"number_pattern": "/^48\\d{9}$/",
"number_example": "48xxxxxxxxx",
"price": "0.1"
},
{
"name": "🇨🇿 Чехия",
"pattern": "czech",
"number_pattern": "/^420\\d{9}$/",
"number_example": "420xxxxxxxxx",
"price": "0.2"
},
{
"name": "🇩🇰 Дания",
"pattern": "denmark",
"number_pattern": "/^45\\d{8}$/",
"number_example": "45xxxxxxxx",
"price": "0.2"
},
{
"name": "🇸🇪 Швеция",
"pattern": "sweden",
"number_pattern": "/^46\\d{9}$/",
"number_example": "46xxxxxxxxx",
"price": "0.1"
},
{
"name": "🇩🇪 Германия",
"pattern": "germany",
"number_pattern": "/^49\\d{10,11}$/",
"number_example": "49xxxxxxxxxx-49xxxxxxxxxxx",
"price": "0.2"
},
{
"name": "🇨🇦 Канада",
"pattern": "canada",
"number_pattern": "/^1(\\(\\+[0-9]{2}\\))?([0-9]{3}-?)?([0-9]{3})\\-?([0-9]{4})(\/[0-9]{4})?$/",
"number_example": "1xxxxxxxxxx",
"price": "0.1"
},
{
"name": "🇦🇺 Австралия",
"pattern": "australia",
"number_pattern": "/^61\\d{9}$/",
"number_example": "61xxxxxxxxx",
"price": "0.2"
},
{
"name": "🇸🇰 Словакия",
"pattern": "slovakia",
"number_pattern": "/^421\\d{9}$/",
"number_example": "421xxxxxxxxx",
"price": "0.1"
},
{
"name": "🇦🇹 Австрия",
"pattern": "austria",
"number_pattern": "/^43\\d{10}$/",
"number_example": "43xxxxxxxxxx",
"price": "0.1"
},
{
"name": "🇭🇺 Венгрия",
"pattern": "hungary",
"number_pattern": "/^36\\d{9}$/",
"number_example": "36xxxxxxxxx",
"price": "0.2"
},
{
"name": "🇨🇾 Кипр",
"pattern": "cyprus",
"number_pattern": "/^357\\d{8}$/",
"number_example": "357xxxxxxxx",
"price": "0.1"
}
]
}
{
"result": false,
"error": "Error description in English",
"error_ru": "Описание ошибки на русском"
}
🇬🇧 To work, you need to install the Guzzle
library (composer require guzzlehttp/guzzle
, https://packagist.org/packages/guzzlehttp/guzzle)
🇷🇺 Для работы, вам нужно установить библиотеку Guzzle
(composer require guzzlehttp/guzzle
, https://packagist.org/packages/guzzlehttp/guzzle)
<?php
$http_method = "GET";
$api_url = "https://api.meowsms.app/";
$api_method = "getCountries/";
$api_key = "";
$body = ["country" => "spain"];
require_once "vendor/autoload.php";
$client = new GuzzleHttp\Client([
"http_errors" => false,
"timeout" => 5,
"connect_timeout" => 5,
"headers" => ["Authorization" => "Bearer " . $api_key]
]);
echo "[" . date("d.m.Y H:i:s") . "] API URL: " . $api_url . $api_method . PHP_EOL;
echo "[" . date("d.m.Y H:i:s") . "] HTTP Method Request: " . $http_method . PHP_EOL;
echo "[" . date("d.m.Y H:i:s") . "] HTTP Body Request: " . json_encode($body) . PHP_EOL;
try {
$request = $client->request($http_method, $api_url . $api_method, ["json" => $body]);
} catch(Exception $e){
echo "[" . date("d.m.Y H:i:s") . "] Error: " . $e->getMessage() . PHP_EOL;
exit();
}
echo "[" . date("d.m.Y H:i:s") . "] Status Code: " . $request->getStatusCode() . PHP_EOL;
echo "[" . date("d.m.Y H:i:s") . "] Response: " . $request->getBody()->getContents() . PHP_EOL;
🇬🇧 To work, you need to install the axios
library (npm i axios
, https://www.npmjs.com/package/axios)
🇷🇺 Для работы, вам нужно установить библиотеку axios
(npm i axios
, https://www.npmjs.com/package/axios)
const axios = require('axios');
const http_method = "GET";
const api_url = "https://api.meowsms.app/";
const api_method = "getCountries/";
const api_key = "";
const body = {"country": "spain"};
const headers = {"Authorization": "Bearer " + api_key};
console.log("[" + new Date().toLocaleString() + "] API URL: " + api_url + api_method);
console.log("[" + new Date().toLocaleString() + "] HTTP Method Request: " + http_method);
console.log("[" + new Date().toLocaleString() + "] HTTP Body Request: " + JSON.stringify(body));
axios({
method: http_method,
url: api_url + api_method,
headers: headers,
data: body
})
.then(response => {
console.log("[" + new Date().toLocaleString() + "] Status Code: " + response.status);
console.log("[" + new Date().toLocaleString() + "] Response: " + response.data);
})
.catch(error => {
console.log("[" + new Date().toLocaleString() + "] Error: " + error.message);
console.log("[" + new Date().toLocaleString() + "] Response: " + error.response.data);
});
🇬🇧 To work, you need to install the requests
library (pip install requests
, https://pypi.org/project/requests/)
🇷🇺 Для работы, вам нужно установить библиотеку requests
(pip install requests
, https://pypi.org/project/requests/)
import requests
import json
from datetime import datetime
http_method = "GET"
api_url = "https://api.meowsms.app/"
api_method = "getCountries/"
api_key = ""
body = {"country": "spain"}
headers = {"Authorization": "Bearer " + api_key}
print("[" + str(datetime.now()) + "] API URL: " + api_url + api_method)
print("[" + str(datetime.now()) + "] HTTP Method Request: " + http_method)
print("[" + str(datetime.now()) + "] HTTP Body Request: " + json.dumps(body))
try:
response = requests.request(http_method, api_url + api_method, headers=headers, json=body)
response.raise_for_status()
print("[" + str(datetime.now()) + "] Status Code: " + str(response.status_code))
print("[" + str(datetime.now()) + "] Response: " + response.text)
except requests.exceptions.RequestException as e:
print("[" + str(datetime.now()) + "] Error: " + str(e))
Authorization*
Bearer API key
Ваш API ключ
country
spain
Название страны