📖
База знаний LetHost
  • 🖥️Использование API
  • 📹Аккаунт
    • [API] Аккаунт
  • ☁️Виртуальные серверы
    • [API] Виртуальные серверы
  • 🌎Виртуальный хостинг
    • [API] Виртуальный хостинг
  • 🌚VPN
    • [API] VPN
  • ⚡Защита веб-сайтов
    • [API] Защита веб-сайтов
Powered by GitBook
On this page
  • Вывод всех защит на аккаунте
  • Вывод данных указанной защиты
  • Вывод DNS записей указанного домена
  • Вывод всех доступных тарифов для заказа
  • Заказ защиты веб-сайтов
  • Продление защиты веб-сайтов
  • Добавление доменов
  • Создание DNS записи
  • Удаление домена
  • Удаление DNS записи
  1. Защита веб-сайтов

[API] Защита веб-сайтов

Здесь указаны все возможные на данный момент запросы для обращения с защитой веб-сайтов.

Вывод всех защит на аккаунте

GET https://api.lethost.co/protection

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "data": [
    {
        "id": protectionid,
        "domains": ['example.com'],
        "location": location_name,
        "tarif": tarif_name,
        "protection-status": protection_status
    }],
    "status": "success"
}

Вывод данных указанной защиты

GET https://api.lethost.co/protection/get/{id}

Path Parameters

Name
Type
Description

{id}*

int

ID защиты

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "id": protection_id,
    "protection-status": protection_status,
    "location": location_name,
    "tarif": tarif_name,
    "price": price,
    "maxdomains": maxdomains,
    "ns": nameservers,
    "domains": ['example.com'],
    "date-end": "2000-12-31 23:59:59",
    "status": "success"
}

Вывод DNS записей указанного домена

GET https://api.lethost.co/protection/getRecords/{id}/{domain}

Path Parameters

Name
Type
Description

{id}*

int

ID защиты

{domain}*

string

Домен

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "id": protection_id,
    "domain": domain,
    "data": [
    {
        "record-id": record_id,
        "type": type_dns,
        "name": name,
        "content": content,
        "ttl": ttl,
        "protectionMode": protection_mode
    }],
    "status": "success"
}

Вывод всех доступных тарифов для заказа

GET https://api.lethost.co/protection/products

{
    "data": [
    {
        "id": tarif_id,
        "name": tarif_name,
        "location": location_name,
        "price": price,
        "maxdomains": maxdomains
    }],
    "status": "success"
}

Заказ защиты веб-сайтов

POST https://api.lethost.co/protection/order

Query Parameters

Name
Type
Description

tarif-id*

int

ID тарифа

days*

int

Дни аренды (30, 90, 180, 360)

promo-code

string

Промокод

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "id": protection_id,
    "protection-status": protection_status,
    "tarif": tarif_name,
    "location": location_name,
    "price": price,
    "date-end": "2000-12-31 23:59:59",
    "status": "success"
}

Продление защиты веб-сайтов

POST https://api.lethost.co/protection/extend/{id}

Path Parameters

Name
Type
Description

{id}*

int

ID защиты

Query Parameters

Name
Type
Description

days*

int

Дни аренды (30, 90, 180, 360)

promo-code

int

Промокод

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "id": protection_id,
    "protection-status": protection_status,
    "tarif": tarif_name,
    "price": price,
    "extended-at": "2000-12-31 23:59:59",
    "extended-until": "2000-11-31 23:59:59",
    "status": "success"
}

Добавление доменов

PUT https://api.lethost.co/protection/addDomain/{id}

Path Parameters

Name
Type
Description

{id}*

int

ID защиты

Query Parameters

Name
Type
Description

domains*

array

Добавляемые домены

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "domains": ['example.com'],
    "success": "You have successfully added domains",
    "status": "success"
}

Создание DNS записи

PUT https://api.lethost.co/protection/addRecord/{id}/{domain}

Path Parameters

Name
Type
Description

{id}*

int

ID защиты

{domain}*

string

Домен

Query Parameters

Name
Type
Description

type*

string

Тип записи (A, AAAA, TXT, CNAME, MX)

name*

string

Название (@, www)

content*

string

Содержимое (1.1.1.1)

ttl

int

Время жизни пакета данных (по умолчанию: 300)

protectionMode*

string

Статус защиты (active, passive, disabled)

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "type": type,
    "name": name,
    "content": content,
    "ttl": ttl,
    "protectionMode": protectionmode,
    "success": "You have successfully added the record",
    "status": "success"
}

Удаление домена

DELETE https://api.lethost.co/protection/deleteDomain/{id}

Path Parameters

Name
Type
Description

{id}*

int

ID защиты

Query Parameters

Name
Type
Description

domain*

string

Удаляемый домен

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "id": protection_id
    "domain": domain,
    "success": "You have successfully deleted the domain",
    "status": "success"
}

Удаление DNS записи

DELETE https://api.lethost.co/protection/deleteRecord/{id}/{domain}

Path Parameters

Name
Type
Description

{id}*

string

ID защиты

{domain}*

string

Домен

Query Parameters

Name
Type
Description

record-id*

int

ID удаляемой записи

Headers

Name
Type
Description

API-Key*

string

API ключ

{
    "id": protection_id
    "domain": domain,
    "record-id": record_id,
    "success": "You have successfully deleted the record",
    "status": "success"
}
Previous[API] VPN

Last updated 1 year ago

⚡