Storyden
Categories

Category Update Position

Update the category's position in the tree. You may change the parent using `parent`, and/or reposition the category among its siblings using either `before` or `after`. Use this operation for drag-and-drop interfaces.

Update the category's position in the tree. You may change the parent using parent, and/or reposition the category among its siblings using either before or after. Use this operation for drag-and-drop interfaces.

PATCH/categories/{category_slug}/position
storyden-session<token>

In: cookie

Path Parameters

category_slug*string

Unique category URL slug.

Request Body

application/json

parent?string

Optional new parent category identifier. Set to null to move to the root level.

Formatxid
before?string

Move this category before the sibling with this identifier.

Formatxid
after?string

Move this category before the sibling with this identifier.

Formatxid

Response Body

application/json

application/json

curl -X PATCH "https://loading/api/categories/string/position" \  -H "Content-Type: application/json" \  -d '{}'
{
  "categories": [
    {
      "id": "cc5lnd2s1s4652adtu50",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "deletedAt": "2019-08-24T14:15:22Z",
      "misc": {},
      "name": "string",
      "slug": "string",
      "description": "string",
      "colour": "string",
      "sort": 0,
      "parent": "cc5lnd2s1s4652adtu50",
      "cover_image": {
        "id": "cc5lnd2s1s4652adtu50",
        "filename": "string",
        "path": "string",
        "mime_type": "string",
        "width": 0,
        "height": 0,
        "parent": {
          "id": "cc5lnd2s1s4652adtu50",
          "filename": "string",
          "path": "string",
          "mime_type": "string",
          "width": 0,
          "height": 0,
          "parent": {}
        }
      },
      "children": [
        {
          "id": "cc5lnd2s1s4652adtu50",
          "createdAt": "2019-08-24T14:15:22Z",
          "updatedAt": "2019-08-24T14:15:22Z",
          "deletedAt": "2019-08-24T14:15:22Z",
          "misc": {},
          "name": "string",
          "slug": "string",
          "description": "string",
          "colour": "string",
          "sort": 0,
          "parent": "cc5lnd2s1s4652adtu50",
          "cover_image": {
            "id": "cc5lnd2s1s4652adtu50",
            "filename": "string",
            "path": "string",
            "mime_type": "string",
            "width": 0,
            "height": 0,
            "parent": {
              "id": "cc5lnd2s1s4652adtu50",
              "filename": "string",
              "path": "string",
              "mime_type": "string",
              "width": 0,
              "height": 0,
              "parent": {}
            }
          },
          "children": [],
          "meta": {},
          "postCount": 0
        }
      ],
      "meta": {},
      "postCount": 0
    }
  ]
}
Empty
Empty
Empty
{
  "error": "string",
  "message": "string",
  "suggested": "string",
  "metadata": {}
}