Categories are a way of grouping items. They can be added/updated/deleted through the Categories APIs.
{
"item_id": string,
"category": string
}
PUT /api/data/v3/items/{id}/categories
{
"categories": ["cat1", "cat2", "cat3", ...]
}
{id}
- (string) ID of Item to set categories.categories
- ([]string) Array of category names to set on Item.{
"categories": [
"cat1",
"cat2",
"cat3"
]
}
id
.GET /api/data/v3/items/{id}/categories
{id}
- (string) ID of Item to list categories.{
"categories": [
"cat1",
"cat2",
"cat3"
]
}
id
.This endpoint will merge previous categories with additional categories for an item.
PATCH /api/data/v3/items/{id}/categories
{
"categories": ["cat1", "cat2", "cat3", ...]
}
{id}
- (string) ID of Item to set categories.categories
- ([]string) Array of category names to set on Item.{
"categories": [
"cat1",
"cat2",
"cat3"
]
}
id
.GET /api/data/v3/search/categories?q={query}
{query}
- (string) Search term for category names.Note: an empty {query} will return all categories.
{
"categories": [
{
"category": "test-category1",
"num_items": 23
},
{
"category": "test-category2",
"num_items": 39
},
{
"category": "test-category4",
"num_items": 12
},
{
"category": "test-category5",
"num_items": 90
}
]
}
GET /api/data/v3/search/categories/{category_name}/items
{category_name}
- (string) Name of the cateogry to get items for.Note: an empty {query} will return all categories.
{
"item_ids": [
"3ab26f33b512d6dde6a217e96d25cdd5",
"7e6f0e66e3e8113779b862da7e29cf27",
"96815bc027bed98a643b2fbcfe2a4685"
],
"next_page_token": ""
}
DELETE /api/data/v3/item/{id}/categories/{name}
{id}
- (string) ID of Item to set categories.{name}
- (string) Name of category to be deleted.{
"categories": [
"cat1",
"cat3"
]
}
id
or category name
.POST /api/data/v3/categories/bulk
{
"items": ["item1", "item2"],
"categories": ["cat1", "cat2", "cat3", ...]
}
items
- ([]string) list of item ids on which to add categories.categories
- ([]string) Array of category names to add to the items.{
"successes": [
{
"item_id": "item1",
"categories": [
"foo",
"cat1",
"cat2",
"cat3"
]
}
],
"failures": [
{
"item_id": "item2",
"error": "some error"
}
]
}
failures
in response for any individual failures.DELETE /api/data/v3/categories/bulk
{
"items": ["item1", "item2"],
"categories": ["cat1", "cat2", "cat3", ...]
}
items
- ([]string) list of item ids on which to remove categories.categories
- ([]string) Array of category names to remove from the items.{
"successes": [
{
"item_id": "item1",
"categories": [
"foo"
]
}
],
"failures": [
{
"item_id": "item2",
"error": "some error"
}
]
}
failures
in response for any individual failures.This documentation is generated from the latest version of GrayMeta Platform. For documentation relevant to your own deployed version, please use the documentation inside the application.
© 2021 GrayMeta, Inc.