GET /asset/v1/content/categories
Returns one or more Content Builder categories that are owned by or reside in your MID. To request categories that have been shared with your MID, add a scope parameter to the call.
Name | Type | Description | |
---|---|---|---|
$filter | string | Filter by ParentId using a simple operator and value. ParentId is the only allowed field. If you don't provide a $filter parameter, the query returns all the Categories in your MID. | |
$page | number | Page number to return from the paged results. Start with 1 and continue until you get zero results. Typically provided along with the $pagesize parameter. | |
$pagesize | number | Number of results per page to return. Typically provided along with the $page parameter. | |
$orderBy | string | Determines which category property to use for sorting, and also determines the direction in which to sort the data. If you don't provide the $orderBy parameter, the results are sorted by category ID in ascending order. | |
scope | string | Determines which MIDs the query results come from. To return categories that reside in your MID, either don't add the scope parameter or call the endpoint like this: .../categories?scope=Ours. To return categories that are shared to your MID, or that you have shared with other MIDs, call the endpoint like this: .../categories?scope=Shared. To return all categories visible to your MID, call the endpoint like this: .../categories?scope=Ours,Shared. |
Status | Name | Type | Description |
---|---|---|---|
200 | A collection of categories | ||
Id | string | System-assigned ID for the category. | |
Name | string | Name of the category. | |
ParentId | number | ID of the parent category. | |
CategoryType | string | The type of category, either asset or asset-shared. | |
MemberId | number | ID of the member who creates the category. | |
EnterpriseId | number | ID of the enterprise this business unit belongs to. | |
SharingProperties | object | Stores the MIDs of business units this category is shared with and the sharing type. Only included in the response if CategoryType is asset-shared. | |
Meta | object | Meta is used much like the data attribute on CMS assets but for internal functionality in Content Builder. If meta is returned, be sure to pass it through the API. | |
403 | Unauthorized | ||
Message | string | Insufficient privileges | |
ErrorCode | number | 20002 | |
500 | Internal server error | ||
Message | string | No message | |
ErrorCode | number | 10000 |
Example Request
Example Response
The sort syntax is the category property name followed by the order direction, either asc
or desc
, with a space in between. The following example sorts by name in descending order: /asset/v1/content/categories?$orderBy=name asc
.
Each filter is separated by &. The following example filters all categories whose parent id is similar to the value 3916
: /asset/v1/content/categories?$filter=parentId eq 3916
Operator | Description |
---|---|
eq | Equals. Compares numbers and strings. |
neq | Is not equal to. Compares numbers and strings. |
lt | Is less than. Compares numbers only. |
lte | Is less than or equal to. Compares numbers only. |
gt | Is greater than. Compares numbers only. |
gte | Is greater than or equal to. Compares numbers only. |
like | Is similar to. Compares strings only. |