| версия от 2023-02-13 |
Группа методов позволяет получать общие данные текущего абонента и менять статус двухфакторной аутентификации.
Адрес: https://restapi.plusofon.ru
GET api/v1/customer-info
Метод позволяет получить общие данные текущего абонента.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/customer-info" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/customer-info"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/customer-info',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/customer-info'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе возвращается:
"id" |
integer | ИД абонента |
"tariff" |
object | объект с текущим тарифом |
"name" |
string | название тарифа |
"description" |
string | описание тарифа |
"expiration_date" |
object | объект со сроком тестового периода |
"days" |
integer | количество дней до окончания |
"expiration" |
string | дата и время окончания |
"block" |
object | объект с существующими блокировками |
"type" |
string | тип блокировки |
"unread_sms" |
integer | количество непрочитанных SMS |
Данные абонента:
{
"id": 1234,
"tariff": {
"name": "Тестовый",
"description": "Облачная АТС"
},
"expiration_date": {
"days": 14,
"expiration": "2022-12-31 14:57:40"
},
"block": {
"type": "agreement"
},
"unread_sms": 0,
"finally_created": true,
"success": true
}
GET api/v1/customer/tfa
Метод позволяет получить текущий статус режима двухфакторной аутентификации.
Не имеет параметров.
curl -X GET \
-G "https://restapi.plusofon.ru/api/v1/customer/tfa" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://restapi.plusofon.ru/api/v1/customer/tfa"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://restapi.plusofon.ru/api/v1/customer/tfa',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/customer/tfa'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
В ответе может возвращаться:
"tfa_active" |
bool | признак включенного режима двухфакторной аутентификации |
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Получен текущий статус:
{
"tfa_active": true,
"success": true
}
PUT api/v1/customer/tfa
Метод позволяет включить двухфакторную аутентификацию.
Параметры Body
"pin" |
string | пин-код, полученный из Flash-вызова |
curl -X PUT \
"https://restapi.plusofon.ru/api/v1/customer/tfa" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}" \
-d '{"pin":"1234"}'
const url = new URL(
"https://restapi.plusofon.ru/api/v1/customer/tfa"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"pin": "1234"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://restapi.plusofon.ru/api/v1/customer/tfa',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
'json' => [
'pin' => '1234',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/customer/tfa'
payload = {
"pin": "1234"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
В ответе может возвращаться:
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Двухфакторная аутентификация включена:
{
"success": true
}
DELETE api/v1/customer/tfa
Метод позволяет отключить двухфакторную аутентификацию.
Параметры Body
"pin" |
string | пин-код, полученный из Flash-вызова |
curl -X DELETE \
"https://restapi.plusofon.ru/api/v1/customer/tfa" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Client: 10553" \
-H "Authorization: Bearer {token}" \
-d '{"pin":"1234"}'
const url = new URL(
"https://restapi.plusofon.ru/api/v1/customer/tfa"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Client": "10553",
"Authorization": "Bearer {token}",
};
let body = {
"pin": "1234"
}
fetch(url, {
method: "DELETE",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://restapi.plusofon.ru/api/v1/customer/tfa',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Client' => '10553',
'Authorization' => 'Bearer {token}',
],
'json' => [
'pin' => '1234',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://restapi.plusofon.ru/api/v1/customer/tfa'
payload = {
"pin": "1234"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Client': '10553',
'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers, json=payload)
response.json()
В ответе может возвращаться:
"success" |
bool | признак успешно выполненного запроса |
"message" |
string | сообщение об ошибке |
Двухфакторная аутентификация отключена:
{
"success": true
}