Подключение к внешнему REST API/en: различия между версиями
Новая страница: «=== '''Methods List''' === <div class="mw-collapsible mw-collapsed" style="border:1px solid #aaa; padding:8px; background:#f9f9f9;"> Below is a list of methods with translated descriptions: * Authorization: ** Login to the server application. thumb|center| Example of authorization method|800px * Broadcast: ** Import broadcast. ** Send event to change broadcast page. ** Get all broadcasts. ** Get broadcast by I...» |
FuzzyBot (обсуждение | вклад) Обновление для соответствия новой версии исходной страницы. |
||
| (не показана 1 промежуточная версия 1 участника) | |||
| Строка 1: | Строка 1: | ||
<languages/> | |||
== '''Description of the Situation''' == | == '''Description of the Situation''' == | ||
For users who want to connect via REST API, it is recommended to use our dedicated resource. On this resource, the user can test methods and requests that allow connection and data retrieval from the SmartPlayer platform. | For users who want to connect via REST API, it is recommended to use our dedicated resource. On this resource, the user can test methods and requests that allow connection and data retrieval from the SmartPlayer platform. | ||
| Строка 144: | Строка 145: | ||
[[File:Изменения.png|thumb|center| Example of response display|800px]] | [[File:Изменения.png|thumb|center| Example of response display|800px]] | ||
</div> | </div> | ||
== '''Schemas''' == | |||
== ''' | |||
<div class="mw-collapsible mw-collapsed" style="border:1px solid #aaa; padding:8px; background:#f9f9f9;"> | <div class="mw-collapsible mw-collapsed" style="border:1px solid #aaa; padding:8px; background:#f9f9f9;"> | ||
This section describes API data structures. | |||
[[File:Раздел_схемы.png|thumb|center| | |||
[[File:Раздел_схемы.png|thumb|center| Example of "Schemas"|800px]] | |||
# | |||
# | Schemas provide: | ||
# | # response formats; | ||
# | # request formats; | ||
# | # data types; | ||
# | # required fields; | ||
# | # nested structures; | ||
# reusable models; | |||
# error understanding. | |||
[[File:Раздел_схемы.png|thumb|center| | Expand sections via ">". | ||
[[File:Опсание_или_пример.png|thumb|center| | [[File:Раздел_схемы.png|thumb|center| Example of schema details|800px]] | ||
[[File:Вложенность_вкладок.png|thumb|center| | Some fields include descriptions or examples. | ||
[[File:Опсание_или_пример.png|thumb|center| Example of descriptions|800px]] | |||
Nested schemas are supported. | |||
[[File:Вложенность_вкладок.png|thumb|center| Example of nested schemas|800px]] | |||
</div> | </div> | ||
== ''' | |||
== '''Postman Interaction''' == | |||
<div class="mw-collapsible mw-collapsed" style="border:1px solid #aaa; padding:8px; background:#f9f9f9;"> | <div class="mw-collapsible mw-collapsed" style="border:1px solid #aaa; padding:8px; background:#f9f9f9;"> | ||
Advanced users can use Postman. | |||
[[File:Новый_запрос_в_постман.png|thumb|center| | Create request: | ||
[[File:Новый_запрос_в_постман.png|thumb|center| Example of Postman|800px]] | |||
[[File:Вариант_запроса.png|thumb|center| | |||
Set method and URL: | |||
[[File:Тело_запроса.png|thumb|center| | [[File:Вариант_запроса.png|thumb|center| Example of request setup|800px]] | ||
{{Note| | |||
Configure headers and body: | |||
[[File:Тело_запроса.png|thumb|center| Example of headers and body|800px]] | |||
{{Note|Authorization may be required via bearer token.|warn}} | |||
Send request: | |||
[[File:Тело_ответа.png|thumb|center| Example of response|800px]] | |||
[[File: | |||
</div> | </div> | ||
== '''Video Instruction''' == | |||
[https://vkvideo.ru/video-227547238_456239131 Connecting to external REST API] | |||
== '''Additional Information''' == | |||
If this article does not help, questions can be asked in the “Discussions” section. | |||
[[File:Обсуждение_подключения_.png|thumb|center| Example of discussions tab|800px]] | |||
Additional information: [[How to interact with the "Discussions" section]] | |||
Текущая версия от 22:52, 26 апреля 2026
Description of the Situation
For users who want to connect via REST API, it is recommended to use our dedicated resource. On this resource, the user can test methods and requests that allow connection and data retrieval from the SmartPlayer platform.
Portal Operation
This section is built on the Swagger Plugin and allows not only to ознакомиться with connection information for REST API, but also to test described methods and receive real results. Advanced users can also test these methods using Postman.
Usage Scenario
It is assumed that interaction with the portal will follow a specific sequence. Usage scenario:
- Authorization on the portal.
- Selecting the required server for testing requests.
- Obtaining a token to use the "Authorize" button.
- Selecting the required method and reviewing its information.
- Sending a request using the "Try it out" button.
- Receiving and reviewing the server response.
- Studying the "Schemas" section.
Information on the Portal
After authorization, the user will see the main page displaying the following information:

The portal page includes information about:
- contact information for interacting with the SmartPlayer team;
- list of available servers for testing;
- "Authorize" button (details below);
- list of methods;
- "Schemas" section (scroll to the bottom of the page).


Server Selection
To test requests, the user must select one of the available servers. Each server is displayed as: "name" + "short description" (in English).

"Authorize" Button
Clicking the "Authorize" button opens a modal window where the user must enter a bearer token. Instructions for obtaining the token are provided via a link in the window.

After entering the token, click "Close". The authorization icon will change (lock icon will be closed and highlighted).


Methods Information
Currently, the portal provides two types of methods:
- GET — used to retrieve data. Parameters are passed via URL. Safe (idempotent) and cacheable.
- POST — sends data in the request body. Used to create or modify resources. Suitable for sensitive data.

Each method has an endpoint specified after the method name and highlighted in bold.

Interaction with Methods
The list of methods allows users to test connections and retrieve sample data. A successful request returns method data and allows analysis of SmartPlayer behavior.
Method Areas
Methods are grouped by system areas:
- Authorization;
- Broadcast;
- Content;
- Notifications;
- IP-TV;
- User;
- Settings;
- Schedule;
- Devices

Methods List
Below is a list of methods with translated descriptions:
- Authorization:
- Login to the server application.

- Broadcast:
- Import broadcast.
- Send event to change broadcast page.
- Get all broadcasts.
- Get broadcast by ID.
- Get broadcast by title.

- Content:
- Upload file.
- Upload multiple files.
- Upload file to video editor.
- Upload files.

- Notifications:
- Upload user activity history.

- IP-TV:
- Export CSV files.
- Import CSV files.

- User:
- Update user photo.
- Create user.
- Send password reset link.

- Settings:
- Upload font.

- Schedule:
- Export schedule archive.

- Devices:
- Get device by IP.
- Get all devices.
- Update timers.

Method Details
Each method can be expanded to view:
- description;
- parameters;
- request body;
- responses.

"Try it out" Button
Allows sending requests.

After activation:
- interface changes;
- button becomes "Cancel".

Send request via "Execute".

Response appears in "Responses".

Schemas
This section describes API data structures.

Schemas provide:
- response formats;
- request formats;
- data types;
- required fields;
- nested structures;
- reusable models;
- error understanding.
Expand sections via ">".

Some fields include descriptions or examples.

Nested schemas are supported.

Postman Interaction
Advanced users can use Postman.
Create request:

Set method and URL:

Configure headers and body:

Send request:

Video Instruction
Connecting to external REST API
Additional Information
If this article does not help, questions can be asked in the “Discussions” section.

Additional information: How to interact with the "Discussions" section
