ProstoTV API documentation version 1
https://api.prosto.tv/v1
/objects
Добавление пользователя
post /objects
Добавление пользователя
Body
Media type: application/json
Type: object
Properties- first_name: (string)
- middle_name: (string)
- last_name: (string)
- note: (string)
- phone: (string)
- password: (string)
HTTP status code 201
Пользователь добавлен
Body
Media type: application/json
Type: object
Example:
{
"id": 123456,
"password": 12345678,
"status": "active",
"balance": 0,
"bonus": 0,
"ebs_url": 'https://{ebs_url}/{object_id}/more/services',
"bundles": [],
"services": [],
"devices": [],
"playlists": []
}
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Получение данных пользователя
Удаление учетки
get /objects/{account_id}
Получение данных пользователя
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- id: required (integer)
- status: required (none)
- balance: required (number)
- bonus: required (number)
- contacts: required (array)
- date_create: required (string)
- bundles: required (array)
- services: required (array)
- devices: required (array)
- playlists: required (array)
Example:
{
"id": 123456,
"status": "active",
"balance": 0,
"bonus": 0,
"ebs_url": 'https://{ebs_url}/{object_id}/more/services',
"contacts": [ "012 3456789", "098 7654321"...]
"date_create": "2015-02-08"
"bundles": [
{
"id": 40,
"main": 1,
"bundles": [],
"name_ru": "Украина",
"name_uk": "Україна",
"channels_count": 38,
"cost": 39
},
{
"id": 50,
"main": 1,
"bundles": [40],
"name_ru": "Вселенная",
"name_uk": "Всесвіт"
"channels_count": 144,
"cost": 79
}
],
"services": [
{
"id": 50,
"created": "2018-11-01 01:00:14",
"name_ru": "IPTV Вселенная",
"name_uk": "IPTV Всесвіт",
"active": 1,
"auto_renewal": 1,
"cost": 79,
"main": 1,
"channels_count": 144,
"bundles": [40],
"stop": "2019-01-01"
}
],
"devices": [
{
"id": "123456_3",
"created": "2018-11-01 02:01:04",
"updated": "2018-12-08 19:54:17",
"password": "520630",
"device": "M01PR100",
"comment": "Телевизор на кухне"
}
],
"playlists": [
{
"id": "secret",
"created": "2018-12-01 12:14:34",
"updated": "2018-12-08 19:54:17",
"genres": 1,
"comment": "Домашний ПК",
"ip": "90.100.110.120",
"url": "http://my.prosto.tv/secret.m3u"
}
]
}
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
delete /objects/{account_id}
Удаление учетки
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 200
Учетка удалена
Body
Media type: application/json
Type: object
Example:
{
"id": "123456",
"status": "deleted"
}
HTTP status code 305
Учетка удалена не полностью
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Учетка уже удалена
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Работа с устройствами
Получение списка всех устройств
Добавление устройства
get /objects/{account_id}/devices
Получение списка всех устройств
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- devices: required (array of object)
Items: Device
- id: required (string)
- created: required (string)
- updated: required (string)
- login: required (string)
- password: required (string)
- device: required (string)
- comment: required (string)
- playlist_id: required (integer)
Example:
{ "id": "xxxxxx_x", "created": "2020-03-25 15:49:07", "updated": "2020-03-25 15:50:19", "login": "xxxxxx_x", "password": "xxxxxx", "device": "", "comment": "", "playlist_id": 123 }
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
post /objects/{account_id}/devices
Добавление устройства
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 201
Устройство добавлено
Body
Media type: application/json
Type: object
Properties- id: required (string)
- created: required (string)
- updated: required (string)
- login: required (string)
- password: required (string)
- device: required (string)
- comment: required (string)
- playlist_id: required (integer)
Example:
{
"id": "xxxxxx_x",
"created": "2020-03-25 15:49:07",
"updated": "2020-03-25 15:50:19",
"login": "xxxxxx_x",
"password": "xxxxxx",
"device": "",
"comment": "",
"playlist_id": 123
}
HTTP status code 406
Достугнут лимит устройств
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Удаление устройства
Добавление комментария к устройству
delete /objects/{account_id}/devices/{device_id}
Удаление устройства
URI Parameters
- account_id: required (integer)
Account ID
- device_id: required (string)
Идентификатор (логин) устройства
Example:
000000_0
HTTP status code 200
Устройство удалено
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Устройство не найдено
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
put /objects/{account_id}/devices/{device_id}
Добавление комментария к устройству
URI Parameters
- account_id: required (integer)
Account ID
- device_id: required (string)
Идентификатор (логин) устройства
Example:
000000_0
Body
Media type: application/json
Type: object
Properties- comment: (string)
HTTP status code 201
Комментарий добавлено
Body
Media type: application/json
Type: object
Properties- id: required (string)
- created: required (string)
- updated: required (string)
- login: required (string)
- password: required (string)
- device: required (string)
- comment: required (string)
- playlist_id: required (integer)
Example:
{
"id": "xxxxxx_x",
"created": "2020-03-25 15:49:07",
"updated": "2020-03-25 15:50:19",
"login": "xxxxxx_x",
"password": "xxxxxx",
"device": "",
"comment": "",
"playlist_id": 123
}
HTTP status code 204
Не задан комментарий
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 400
Неверный id устройства
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Управление плейлистами
Получение списка всех плейлистов
Добавление плейлиста
get /objects/{account_id}/playlists
Получение списка всех плейлистов
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- playlists: required (array of object)
Items: Playlist
- id: required (string)
- created: required (datetime)
- updated: required (datetime)
- genres: required (json)
- tv_guide: required (json)
- comment: required (string)
- ip: required (string)
- url: required (string)
- device_id: required (string)
- password: required (string)
- parent_control_start: required (union of integer or nil)
- parent_control_end: required (union of integer or nil)
Example:
{ "id": "xxxxxxxx", "created": "2020-03-06 09:47:38", "updated": "0000-00-00 00:00:00", "genres": 1, "tv_guide": 1, "comment": "", "ip": "", "url": "http://my.prosto.tv/xxxxxxxx.m3u", "device_id": "", "password": "0000", "parent_control_start": null, "parent_control_end": null }
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
post /objects/{account_id}/playlists
Добавление плейлиста
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 201
Плейлист добавлен
Body
Media type: application/json
Type: object
Properties- id: required (string)
- created: required (datetime)
- updated: required (datetime)
- genres: required (json)
- tv_guide: required (json)
- comment: required (string)
- ip: required (string)
- url: required (string)
- device_id: required (string)
- password: required (string)
- parent_control_start: required (union of integer or nil)
- parent_control_end: required (union of integer or nil)
Example:
{
"id": "xxxxxxxx",
"created": "2020-03-06 09:47:38",
"updated": "0000-00-00 00:00:00",
"genres": 1,
"tv_guide": 1,
"comment": "",
"ip": "",
"url": "http://my.prosto.tv/xxxxxxxx.m3u",
"device_id": "",
"password": "0000",
"parent_control_start": null,
"parent_control_end": null
}
HTTP status code 406
Достугнут лимит
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Удаление плейлиста
Добавление комментария, включение выключение группировки по жанрам
delete /objects/{account_id}/playlists/{playlist_id}
Удаление плейлиста
URI Parameters
- account_id: required (integer)
Account ID
- playlist_id: required (string)
Идентификатор (secret) плейлиста
Example:
xxxxxxxx
HTTP status code 200
Плейлист удален
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Плейлист не найден
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
put /objects/{account_id}/playlists/{playlist_id}
Добавление комментария, включение выключение группировки по жанрам
URI Parameters
- account_id: required (integer)
Account ID
- playlist_id: required (string)
Идентификатор (secret) плейлиста
Example:
xxxxxxxx
Body
Media type: application/json
Type: object
Properties- comment: (string)
- genres: (0|1)
- tv_guide: (0|1)
- available_mode: (0|1)
Оставить в плейлисте только доступные каналы
HTTP status code 201
Плейлист изменен
Body
Media type: application/json
Type: object
Properties- id: required (string)
- created: required (datetime)
- updated: required (datetime)
- genres: required (json)
- tv_guide: required (json)
- comment: required (string)
- ip: required (string)
- url: required (string)
- device_id: required (string)
- password: required (string)
- parent_control_start: required (union of integer or nil)
- parent_control_end: required (union of integer or nil)
Example:
{
"id": "xxxxxxxx",
"created": "2020-03-06 09:47:38",
"updated": "0000-00-00 00:00:00",
"genres": 1,
"tv_guide": 1,
"comment": "",
"ip": "",
"url": "http://my.prosto.tv/xxxxxxxx.m3u",
"device_id": "",
"password": "0000",
"parent_control_start": null,
"parent_control_end": null
}
HTTP status code 400
Не указаны параметры
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Активация работы в кредит
post /objects/{account_id}/workoncredit
Активация работы в кредит
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 200
Работа в кредит активирована
HTTP status code 400
Не удалось активировать услугу
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 402
Активация услуги недоступна
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Проведение операции
post /objects/{account_id}/operations
Проведение операции
URI Parameters
- account_id: required (integer)
Account ID
Body
Media type: application/json
Type: object
Properties- operation_id: required (integer)
- sum: required (number)
Example:
{
"operation_id": 20,
"sum": 120.0
}
HTTP status code 201
Операция проведена
Body
Media type: application/json
Type: object
Properties- id: required (integer)
- transaction_id: required (integer)
- object_id: required (integer)
- created: required (datetime)
- sum: required (number)
- balance: required (number)
Example:
{
"id": 123456,
"transaction_id": 123456,
"object_id": 123456,
"created": "2018-12-01 10:10:43",
"sum": 79.00,
"balance": 79.00
}
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 403
Указанный тип операции не разрешен
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Указанный тип операции не найден
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Отключение/включение учетной записи
post /objects/{account_id}/status
Отключение/включение учетной записи
URI Parameters
- account_id: required (integer)
Account ID
Body
Media type: application/json
Type: object
Properties- status: required (string)
HTTP status code 201
Статус учетной записи изменен
Body
Media type: application/json
Type: object
Properties- id: required (string)
- status: required (one of active, disconnected)
Example:
{
"id": 123456,
"status": "disconnected"
}
HTTP status code 203
Неверный статус
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 304
Статус уже установлен
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 402
Недостаточно средств
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Активация услуги
post /objects/{account_id}/services
Активация услуги
URI Parameters
- account_id: required (integer)
Account ID
Body
Media type: application/json
Type: object
Properties- id: required (integer)
- auto_renewal: required (integer)
HTTP status code 201
Услуга активирована
Body
Media type: application/json
Type: object
Properties- id: required (integer)
- created: required (datetime)
- name_ru: required (string)
- name_uk: required (string)
- cost: required (number)
- start: (date-only)
- stop: (date-only)
Example:
{
"id": 50,
"created": "2018-11-01 01:00:14",
"name_ru": "IPTV Вселенная",
"name_uk": "IPTV Всесвіт",
"active": 1,
"auto_renewal": 1,
"cost": 79,
"main": 1,
"channels_count": 230,
"bundles": [40],
}
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 402
Недостаточно средств
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 403
Нет прав для активации указанной услуги
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Услуга не найдена
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Отключение услуги
delete /objects/{account_id}/services/{service_id}
Отключение услуги
URI Parameters
- account_id: required (integer)
Account ID
- service_id: required (string)
Body
Media type: application/json
Type: object
HTTP status code 201
Услуга активирована
Body
Media type: application/json
Type: object
Properties- id: required (integer)
- created: required (datetime)
- name_ru: required (string)
- name_uk: required (string)
- cost: required (number)
- start: (date-only)
- stop: (date-only)
Example:
{
"id": 50,
"name_ru": "IPTV Вселенная",
"name_uk": "IPTV Всесвіт",
"active": 1,
"auto_renewal": 0,
"cost": 79,
"main": 1,
"channels_count": 230,
"bundles": [40],
"stop": "2019-01-01"
}
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 403
Нет прав для работы с указанной услуги
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Услуга не найдена
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Добавление номера телефона
post /objects/{account_id}/contacts
Добавление номера телефона
URI Parameters
- account_id: required (integer)
Account ID
Body
Media type: application/json
Type: object
Properties- phone: required (string)
HTTP status code 6
Duplicate entry data
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 201
Номер добавлен
Body
Media type: application/json
Type: object
Example:
{
"id": 123456,
"contact": "012 3456789",
"status": "added"
}
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Удаление номера телефона
delete /objects/{account_id}/contacts/{phone}
Удаление номера телефона
URI Parameters
- account_id: required (integer)
Account ID
- phone: required (string)
HTTP status code 200
Номер удален
Body
Media type: application/json
Type: object
Example:
{
"id": 123456,
"contact": "012 3456789",
"status": "deleted"
}
HTTP status code 400
Некорректный запрос
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 406
No phone number found
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Изменение пароля. Формат пароля минимум 8 символов
put /objects/{account_id}/password
Изменение пароля. Формат пароля минимум 8 символов
URI Parameters
- account_id: required (integer)
Account ID
Body
Media type: application/json
Type: object
Properties- password: (string)
HTTP status code 200
Пароль изменен
Body
Media type: application/json
Type: object
Example:
{
"id": 123456,
"newPassword": "12345678"
}
HTTP status code 400
Некорректный пароль
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Создание временного токена для авторизации устройства
post /objects/{account_id}/token
Создание временного токена для авторизации устройства
URI Parameters
- account_id: required (integer)
Account ID
HTTP status code 200
Токен создан, время жизни токена 2 минуты
Body
Media type: application/json
Type: object
Example:
{
"account_id": 123456,
"date_create": "2020-03-25 15:42:37",
"date_expire": "2020-03-25 15:44:37",
"token": "01234"
}
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
/search
Получить список всех точек аккаунтов
Получить список точек аккаунтов согласно заданнім условиям
get /search/accounts
Получить список всех точек аккаунтов
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- count: required (integer)
- accounts: required (array of )
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
post /search/accounts
Получить список точек аккаунтов согласно заданнім условиям
Body
Media type: application/json
Type: object
Properties- parameter: required (string status|phone|service_id|first_name|last_name|middle_name)
- value: required (string)
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- count: required (integer)
- property: required (string)
- value: required (string)
- accounts: required (array of )
HTTP status code 500
Внутренняя ошибка
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
Получение списка доступных пакетов
get /search/bundles
Получение списка доступных пакетов
HTTP status code 200
Список пакетов для пользователей которые уже созданы или будут созданы по api
Body
Media type: application/json
Type: array of Bundles
Example:
[
{
"id": "126",
"name_ru": "Базовый",
"name_uk": "Базовий",
"main": true,
"cost": "80.00"
},
{
"id": "100",
"name_ru": "Детский",
"name_uk": "Дитячий",
"main": false,
"cost": "29.00"
}
]
HTTP status code 500
Ошибка сервера, нужно проверить настройки учётки оператора
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
Secured by bearer
Headers
- Authorization: required (string)
Заголовок для авторизации по токену
Example:
Bearer 00112233445566778899aabbccddeeff
/tokens
Получение токена
post /tokens
Получение токена
Body
Media type: application/json
Type: object
Properties- login: required (string)
- password: required (string)
HTTP status code 201
Токен создан
Body
Media type: application/json
Type: object
Properties- token: required (string)
Example:
{
"token": "00112233445566778899aabbccddeeff"
}
HTTP status code 400
Некорректный запрос, см. дополнительную информацию в ответе
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)
HTTP status code 404
Указанная пара логин/пароль не найдена
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- message: required (string)