Documentation: Basic information for interacting with the site content API
Description
This documentation describes the basic principles of interaction with the API for working with site content, including methods for working with categories, products and other related objects.
General terms of interaction
- Authorization header in each request (required)
Each API request must contain the following parameter in its headers:
API-Token: <Your_Token>
- Example of
API-Tokenvalue:MY_TOKEN_123 - The token is issued by your site manager and must be transferred to complete any request.
- The {{domain}} variable is also issued by your manager
- Pagination
- Basic pagination is applied to all endpoints.
The number of objects returned per request is 100 by default. If necessary, you can change the number of returned objects to the maximum value - 5000 by adding a query parameter:
?page_size=
To request the following pages, use the page** parameter
?page=
*Options can be combined in any order
*
*
Examples:
Receiving data with basic pagination (100 objects per page):
GET /external/product*Increasing the number of objects to 5000:
GET /external/product/?page_size=5000&page=2
Example API request
Example request using token and pagination:
curl --location '<http://admin.ecom.md/external/product'> \
--header 'API-Token: MY_TOKEN_123' \
--header 'Content-Type: application/json' \
3. Each GET request endpoint supports the ability to retrieve only certain data. For example, if a product has more than 30 different fields, you can request only the ones you need. To do this, pass the Query parameterfields, *indicating the required fields separated by* commas, for example:fields=id,code,name.
Notes
- Token security:
Please ensure that the providedAPI-Tokenis stored securely and is not shared with third parties. - Error handling:
A missing or invalidAPI-Tokenwill result in a 401 Unauthorized error code.
Make sure your token is valid and passed in the request header. - API requests:
All requests must be made via the secure HTTPS protocol to eliminate the risk of confidential data leaks. - Limits of the
page_sizeparameter:
If the passedpage_sizevalue is greater than 5000 , then the API will automatically reduce it to the maximum supported value. - If you do not pass some values for an object in the request, they will be ignored by the system and will not be updated
Possible objects for interaction:
- Product
- Category
- Promotions
- Product groups
- Companies
- Lists of stores (branches)
- Discount cards
- Custom entities (Author, manufacturer)
- Gift with product
- Video product reviews
- Certificates for payment
- [Version 2] Product groups.
- Brand
Was the article helpful?
Yes, thank you! Unfortunately no