Documentation: Working with categories
Basic information
The API provides the ability to work with site categories. Using the endpoints provided, you can get a list of all categories or information about a specific category.
Endpoints
1. Getting a list of all categories
[GET] {domain}/external/category/
This endpoint returns a list of all categories available on the site.
Query example:
curl --location '<https://admin.ecom.md/external/category/'> \
--header 'API-Token: YOUR_API_TOKEN'
Example answer:
[
{
"id": 2964,
"position": 10,
"name_ro": "Telefoane",
"name_ru": "Phones",
"name_en": null,
"name_uk": null,
"slug_ro": "telefoane-1",
"slug_ru": "telefony",
"slug_en": "telefoane-1",
"slug_uk": "telefoane-1",
"hide": false,
"description_ro": null,
"description_ru": null,
"description_en": null,
"description_uk": null,
"description_position": null,
"group_category_id": "testing-phone-cat-id",
"meta_description_ro": null,
"meta_description_ru": null,
"meta_description_en": null,
"meta_description_uk": null,
"meta_title_ro": null,
"meta_title_en": null,
"meta_title_en": null,
"meta_title_uk": null,
"meta_keywords_ro": null,
"meta_keywords_ru": null,
"meta_keywords_en": null,
"meta_keywords_uk": null,
"show_18_popup": true,
"category_id": null
}
]
2. Getting information about a specific category
[GET] {domain}/external/category/{id}
Allows you to get detailed information about a specific category by its id.
Path parameters:
{id}is a unique identifier for the category in the database.
Query example:
curl --location '<https://admin.ecom.md/external/category/2964'> \
--header 'API-Token: YOUR_API_TOKEN'
Example answer:
{
"id": 2964,
"position": 10,
"name_ro": "Telefoane",
"name_ru": "Phones",
"name_en": null,
"name_uk": null,
"slug_ro": "telefoane-1",
"slug_ru": "telefony",
"slug_en": "telefoane-1",
"slug_uk": "telefoane-1",
"hide": false,
"description_ro": null,
"description_ru": null,
"description_en": null,
"description_uk": null,
"description_position": null,
"group_category_id": "testing-phone-cat-id",
"meta_description_ro": null,
"meta_description_ru": null,
"meta_description_en": null,
"meta_description_uk": null,
"meta_title_ro": null,
"meta_title_en": null,
"meta_title_en": null,
"meta_title_uk": null,
"meta_keywords_ro": null,
"meta_keywords_ru": null,
"meta_keywords_en": null,
"meta_keywords_uk": null,
"show_18_popup": true,
"category_id": null
}
Response fields
Each category contains the following information:
- id (int): Unique identifier of the category in the database.
- position (int): Position of the category in the site menu.
- namero, nameru, nameen, nameuk (string): Category name in a specific language.
- slugro, slugru, slugen, sluguk (string): A unique category slug in a specific language.
- hide (bool): The visibility status of the category (false - the category is displayed, true - hidden).
- descriptionro, descriptionru, descriptionen, descriptionuk (string): Description of the category in a specific language.
- description_position (int, nullable): Display position of the category description.
- groupcategoryid (string): The unique category identifier used in your system.
- metadescriptionro, metadescriptionru, metadescriptionen, metadescriptionuk (string): Meta description of the category in a specific language.
- metatitlero, metatitleru, metatitleen, metatitleuk (string): Meta title of the category in a specific language.
- metakeywordsro, metakeywordsru, metakeywordsen, metakeywordsuk (string): Meta keywords of the category in a specific language.
- show18popup (bool): Show the 18+ popup popup for this category.
- category_id (List[int]): IDs of the parent categories (if nested).
Notes
- Language system:
If a category is not specified for a language, the return value for thename,slug,description,meta_*fields will benull. - Response structure:
If a category is nested within another, the value of thecategory_idfield corresponds to the ID of the parent category.
Was the article helpful?
Yes, thank you! Unfortunately no