Get Subscription
curl --request GET \
--url https://api.example.com/cabinet/subscription \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/cabinet/subscription"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/cabinet/subscription', 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://api.example.com/cabinet/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.example.com/cabinet/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/cabinet/subscription")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/cabinet/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"has_subscription": true,
"subscription": {
"id": 123,
"status": "<string>",
"is_trial": true,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"days_left": 123,
"traffic_limit_gb": 123,
"traffic_used_gb": 123,
"traffic_used_percent": 123,
"device_limit": 123,
"autopay_enabled": true,
"autopay_days_before": 123,
"is_active": true,
"is_expired": true,
"hours_left": 0,
"minutes_left": 0,
"time_left_display": "",
"connected_squads": [],
"servers": [],
"subscription_url": "<string>",
"hide_subscription_link": false,
"is_limited": false,
"traffic_purchases": [],
"is_daily": false,
"is_daily_paused": false,
"daily_price_kopeks": 123,
"next_daily_charge_at": "2023-11-07T05:31:56Z",
"tariff_id": 123,
"tariff_name": "<string>",
"traffic_reset_mode": "<string>"
}
}Cabinet Subscription
Get Subscription
Get current user’s subscription details.
GET
/
cabinet
/
subscription
Get Subscription
curl --request GET \
--url https://api.example.com/cabinet/subscription \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/cabinet/subscription"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/cabinet/subscription', 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://api.example.com/cabinet/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.example.com/cabinet/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/cabinet/subscription")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/cabinet/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"has_subscription": true,
"subscription": {
"id": 123,
"status": "<string>",
"is_trial": true,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"days_left": 123,
"traffic_limit_gb": 123,
"traffic_used_gb": 123,
"traffic_used_percent": 123,
"device_limit": 123,
"autopay_enabled": true,
"autopay_days_before": 123,
"is_active": true,
"is_expired": true,
"hours_left": 0,
"minutes_left": 0,
"time_left_display": "",
"connected_squads": [],
"servers": [],
"subscription_url": "<string>",
"hide_subscription_link": false,
"is_limited": false,
"traffic_purchases": [],
"is_daily": false,
"is_daily_paused": false,
"daily_price_kopeks": 123,
"next_daily_charge_at": "2023-11-07T05:31:56Z",
"tariff_id": 123,
"tariff_name": "<string>",
"traffic_reset_mode": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
⌘I
