Share

Get all categories

GET /api/category/v1/categories returns all categories created for the tenant/company specified in the Upc-Selected-Company header.

Request schema

Method URL
GET /api/category/v1/categories

Request header

*indicates required parameters

Field Value Type Description
*Authorization String Enter: Bearer access token.
*Upc-Selected-Company Integer Company’s ID. Use the value returned in the id field received in response to the following request: GET /api/auth/v1/companies.
X-User-Id Text Enter the email address of the user being impersonated. This value is required if you are using a two-legged token. If you are using a three-legged token, then this field is not required.

Response schema

Response body

200 response

Field Value Type Description
No field name Array Contains an array of categories created with the tenant specified in the Upc-Selected-Company header. For every category fetches the following parameters:

  • id - Category ID
  • parentId - Parent category ID
  • name - Category name
  • description - Category description
  • level - Level of the category in the hierarchy
  • children - An array of children categories

Sample response body

[
  {
    "id": 1290,
    "parentId": null,
    "name": "Fasteners",
    "description": "Fasteners",
    "level": 1,
    "children": null
  },
  {
    "id": 1291,
    "parentId": null,
    "name": "Product Family",
    "description": "Camping Product Family",
    "level": 1,
    "children": [
      {
        "id": 1292,
        "parentId": 1291,
        "name": "Sleeping Bag",
        "description": null,
        "level": 2,
        "children": null
      },
     {
        "id": 1293,
        "parentId": 1291,
        "name": "Camp Pads",
        "description": null,
        "level": 2,
        "children": null
      }
    ]
  }
]

Was this information helpful?