ProstoTV 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)