POST
/
api-category
/
v1
/
category
/
find
Find categories
curl --request POST \
  --url https://live.copilot.fabric.inc/api-category/v1/category/find \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '{
  "include": {
    "children": false,
    "itemAttributes": false,
    "nodeAttributes": false,
    "filters": false,
    "sources": false,
    "statuses": true
  },
  "type": "ALTERNATE",
  "status": "ALL",
  "page": 1,
  "size": 10,
  "match": {
    "attribute": {
      "id": "6196b44a5cb04b7ce167cb34",
      "name": "Category Code",
      "value": {
        "exact": "1234",
        "contains": "1234"
      }
    },
    "and": [
      {
        "attribute": {
          "id": "6196b44a5cb04b7ce167cb34",
          "name": "Category Code",
          "value": {
            "exact": "1234",
            "contains": "1234"
          }
        }
      }
    ],
    "or": [
      {
        "attribute": {
          "id": "6196b44a5cb04b7ce167cb34",
          "name": "Category Code",
          "value": {
            "exact": "1234",
            "contains": "1234"
          }
        }
      }
    ]
  }
}'
{
  "totalSize": 100,
  "pageSize": 10,
  "pages": 10,
  "categories": [
    {
      "id": "6196b45b5cb04b7ce167cb46",
      "nodeId": 16,
      "name": "PCs",
      "hierarchy": "ALTERNATE",
      "isActive": true,
      "breadcrumbs": [
        {
          "id": "6196b44a5cb04b7ce167cb34",
          "nodeId": 10,
          "name": "Computers",
          "level": 0,
          "hierarchy": "ALTERNATE",
          "isActive": true,
          "createdOn": "2022-03-09T23:37:54.086Z",
          "modifiedOn": "2022-03-09T23:37:54.086Z"
        }
      ],
      "attributes": [
        {
          "id": "619a8ba6f1875f6dbcaf0521",
          "name": "notes",
          "description": "Notes for this particular category.",
          "type": "TEXT",
          "value": "Unable to fulfill demand."
        }
      ],
      "children": [
        {
          "id": "619973877a22c466eee93219",
          "name": "Apple",
          "breadcrumbs": [
            {
              "id": "6196b44a5cb04b7ce167cb34",
              "nodeId": 10,
              "name": "Computers",
              "level": 0,
              "hierarchy": "ALTERNATE",
              "isActive": true,
              "createdOn": "2022-03-09T23:37:54.086Z",
              "modifiedOn": "2022-03-09T23:37:54.086Z"
            }
          ],
          "attributes": [
            {
              "id": "619a8ba6f1875f6dbcaf0521",
              "name": "notes",
              "description": "Notes for this particular category.",
              "type": "TEXT",
              "value": "Unable to fulfill demand."
            }
          ],
          "children": [
            {}
          ]
        }
      ],
      "createdOn": "2022-03-09T23:37:54.086Z",
      "modifiedOn": "2022-03-09T23:37:54.086Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

S2S access token (JWT) from fabric Identity service (during Login)

Headers

x-site-context
string
required

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

Body

application/json
include
object

Inclusion criteria

type
enum<string>

Category type. The primary hierarchy contains all branches, whereas alternate hierarchies exist to export alternate organizations of the primary hierarchy. If omitted ALTERNATE is considered by default.

Available options:
PRIMARY,
ALTERNATE
Example:

"ALTERNATE"

status
enum<string>

Category status. Only ALTERNATE Hierarchies can be filtered using this paramater. If omitted ACTIVE status is considered by default.

Available options:
ACTIVE,
INACTIVE,
ALL
Example:

"ALL"

page
number

Number of pages in the response.

Example:

1

size
number

Number of categories per page.

Example:

10

match
object

Response

OK

totalSize
number

Total number of records (categories)

Example:

100

pageSize
number

Number of records (categories) per page

Example:

10

pages
number

Number of pages for the given pageSize

Example:

10

categories
object[]