REST API
The public GitFlic API allows you to interact with the service using HTTP requests to retrieve or modify data according to the specified request parameters. This type of interaction provides users with new functionality. For example, with the public API, you can automate processes, obtain data for analytics, or integrate the service with third-party applications.
Creating a REST API Request
To create a REST API request, you need to access a specific endpoint, which should start with:
api.gitflic.ru
for working with the API on gitflic.rulocalhost:8080/rest-api
for working with the API in self-hosted builds
The domain and port may differ when using the self-hosted solution.
The full request address depends on the specific method you want to use. You can view all available methods here.
Request Example
Example request to get a list of public projects on gitflic.ru:api.gitflic.ru/project
Authorization in Requests
Sending any REST API method requires authorization. To do this, you need to create an access token and specify it in the request header as follows:
Authorization: token <access token>
<access token>
- your created access token.
You can find instructions for creating an access token here.
When working with the API, the token owner must meet the following requirements:
- The profile must not be blocked;
- There must be no active requirement to change the password;
- There must be no active requirement to set up two-factor authentication.
Rate Limits
When working with the API on gitflic.ru, there is a limit - you can send up to 500 requests per hour. The limit for the API in self-hosted builds depends on the specified settings.
Response Format
After sending a request, you will receive a response in JSON format. Some requests may return a response in plain text format.
Each response contains a response code that indicates the result of the request and is useful for troubleshooting. Common codes are listed below:
200 OK
- The request was successfully processed. Usually, the response body contains the requested data.400 Bad Request
- The request was formed with errors. For example, it contained invalid characters.403 Forbidden
- The request was not executed due to authorization issues. For example, an access token with insufficient permissions was used.404 Not Found
- The server could not find the requested data. For example, the request refers to a project that does not exist.
Pagination in Requests
If a request returns an object containing a list of entities, pagination can be applied to such a request - specify the number of entities per page or go to a specific page. You can read the pagination rules here.
Description of Available Methods:
- Administrator Methods
- Agent Methods
- Webhook Methods
- Branch Methods
- Merge Request Methods
- Team Methods
- Issue Note Methods
- Commit Methods
- Company Methods
- User Settings Methods
- Pagination Methods
- User Methods
- Issue Methods
- Project Methods
- Package Registry Methods
- Release Methods
- Tag Methods
- File Methods
- CI/CD Methods
- SAML SSO Methods
Automated translation!
This page was translated using automatic translation tools. The text may contain inaccuracies.