General information¶
Introduction¶
This section provides a description of the Application Programming Interface (API) for the portal service. The API is a tool for developers that enables integration of the portal with other websites, portals, and university information systems. The documentation is intended for developers who need programmatic access to portal functions. It is assumed that the developer is already familiar with the portal’s capabilities.
The API documentation is presented using Swagger and is available at this link.
Swagger makes the documentation interactive and allows generation of client-side code. For example, client code generation is available using the resource https://editor.swagger.io/.
Versioning¶
All API sections support versioning. Each version has a specific identifier (v1, v2, etc.). When a new version of the API is released, the previous version remains available to ensure backward compatibility.
If you are just starting to work with the API, use the latest version. If you are already using an older version, it is recommended to migrate to the newest one, since support for older versions is time-limited.
When making a request to the API, always specify the version you want to use.:
https://api.lomonosov-msu.ru/api/v1/...
https://api.lomonosov-msu.ru/api/v2/...
Resources¶
The API is built on REST principles.
Everything managed through the API is represented as a resource — such as a calendar, event, user, etc.
In other words, a resource is a complete part of the system that you can interact with:
read the contents and current state of a resource (GET);
modify the contents or state and write it back to the resource (PUT);
delete a resource (DELETE);
perform actions — for example, add new items to a list (POST).
Each resource has its own unique URL. All actions are performed using the corresponding HTTP methods on the resource URLs.
For example, to retrieve event information, you need to make a GET request to the URL of the corresponding resource.
Calling methods¶
A request to the service is structured as follows:
<тип_метода> https://api.lomonosov-msu.ru/api/<версия>/<раздел_API>/<имя_метода>/<параметры>
<method type> — GET, POST, PUT, or DELETE.
<API section> — the section of the API where the action is performed.
<version> — the current version number of the API.
<method name> — the URL of the resource on which the action is performed.
<parameters> — required and optional request parameters.
The API returns responses in UTF-8 encoding. Responses are in JSON format, as indicated by the HTTP header Accept: application/json.
Authorization¶
To use the API, you must obtain an authorization token from the Organization Administrator. This token must be included in each request in the HTTP header Organization-Token.
Example of an HTTP header:
GET /api/v1/organization/event-calendars HTTP/1.1
Host: api.lomonosov-msu.ru
Organization-Token: 05dd3dd84ff948fdae2bc4fb91f13e22bb1f289ceef0037
Accept: application/json
If an API method is called without a token, or if an invalid token is provided, the server returns the HTTP status 401 Unauthorized.
Rate limiting¶
To ensure maximum service availability, a limit is set on the frequency of API requests. A single Organization-Token must not exceed 5,000 requests per day.
If the request limit is exceeded, the Organization-Token is automatically blocked. The Organization Administrator can unblock it using the token management interface.