- Created by Александр Шрамко, last modified by Елизавета Шепелева on Oct 10, 2024
You have English selected as language but this page has not been translated yet. Translate the page or view the content in the default space language below.
Display defaultThe API section in the administrative panel allows you to view descriptions of REST API functions and fulfill user requests.
To go to the documentation, select the API section in the admin panel or follow the link.
Agora REST API
You can use this specification to work with API methods using Postman: download.
What is an API?
API (application programming interface) is an interface that makes it possible to control any software (for example, an application, service, program) using special commands.
What is the Agora API used for?
We offer a description of the API methods that you can use to perform tasks such as:
- User registration;
- import of goods, as well as prices and balances of goods;
- receiving and sending orders, as well as updating their statuses;
- receiving information about news and promotions;
- receiving and creating complaints;
- obtaining analytical information about products, orders, customers;
- receiving and sending messages in feedback forms or chat
- etc.
Agora API Features
Data transfer protocol
The API supports HTTPS protocols.
Request Format
The API supports CORS - cross-domain requests.
The Agora API uses queries
Authorization
Requests require an API key for authorization. To get the key, you need to send a request to the following URL for authorization: . The request is expected in the format
and contains the following fields:
- email (not required if the login field is filled in);
- login (not required if the email field is filled in);
- password (required field)
Request Format
Requests use the format .
Response Format
The default response format is JSON.
Response structure
The response when requesting a list of objects contains the following parameters:
count | Total number of objects |
---|---|
next | Link to next page |
previous | Link to previous page |
results | List containing query results |
For an example response, see the "Request Filtering" section.
When requesting an object for a specific pk, the response contains one JSON object with the names and values of the properties of the requested object. An example of a response to a request for url /news/1/:
Request filtering
The Agora API has the ability to filter by URL. To filter the received data, you need to pass the filtering field and the desired value to the url query parameters. An example of a news filtering query.
URL: https://api-cloud.agora.ru/api/rest/v1/news/?title=Тест
Answer:
Errors
All errors are presented as human- and machine-readable status. The response body contains more detailed information about the error and is formed depending on its type. Most errors contain the "detail" key in the body. Example:
Validation errors, however, contain keys that correspond to request fields, or "non_field_errors" if the error is not related to the value of a specific request field. Example:
Description of the status codes used:
200 | Ok |
---|---|
201 | Created |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
405 | Method not allowed |
500 | Internal server error |
Sending a test request
To check the operation of the API, you can send a test request from the corresponding subsection of the documentation:
- Select the API method you need from the navigation bar on the left.
- Click on the Try it button on the right side of the screen.
- A form for filling out the request fields will open. In the Request tab, fill in all the required fields.
- If necessary, add the previously obtained authorization key to the Security section.
- Click on the Send button.
- You can also edit the request and resend it.
- The received response will be displayed in the Response tab.
You have English selected as language but this page has not been translated yet. Translate the page or view the content in the default space language below.
Display default- No labels