API - Category

Manage the categories


Routes

Method name Route Parameters OK return code Return
GET /api/categories 200 Results of the 'category' loop
GET /api/categories/{categoryId} categoryId: The category id 200 Results of the 'category' loop for category id
POST /api/categories 201 Results of the 'category' loop for the created category
PUT /api/categories/{categoryId} 204 Nothing
DELETE /api/categories/{categoryId} categoryId: The category id 204 Nothing

Creation

If you want to create a category, you have to send the following fields with the POST method.

General information

  • parent: The parent category id
  • visible: If 1, the category will be visible (optional)

Descriptive

  • locale: The lang locale
  • title: The category title

Example

{
    "visible": 1,
    "parent": 2,
    "locale": "en_US",
    "title": "Category create from api"
}

Update

To update a category, you have to send data (only updated ones) with the PUT method.

General information

  • parent: The parent category id
  • visible: If 1, the category will be visible (optional)
  • default_template_id: the default template id

Descriptive

  • locale: The lang locale
  • title: The category title
  • chapo: The category short description (optional)
  • description: The category description (optional)
  • postscriptum: The category conclusion (optional)

Example

{
    "visible": 1,
    "parent": 2,
    "default_template_id": 3,
    "locale": "en_US",
    "title": "Category create from api",
    "description": "Category description updated from api",
    "chapo": "Category chapo updated from api",
    "postscriptum": "Category postscriptum"
}