Zoey REST API reference ยท Interactive version: apidocs.zoey.com

Catalog

Catalog: Category

Tree

Get

GET https://container-url.zoeysite.com/api/rest/category/tree/:categoryId

Images

Set

POST https://container-url.zoeysite.com/api/rest/categories/:categoryId/images

Example request body:

{
    "file_mime_type": "image/jpeg",
    "file_content": "/9j/4AAQSkZJRgABAgEASABIAA...",
    "file_name": "api_image.jpg",
    "types": [
        "image",
        "thumbnail",
        "promo_image"
    ]
}

Get

GET https://container-url.zoeysite.com/api/rest/categories/:categoryId/images

Delete

DELETE https://container-url.zoeysite.com/api/rest/categories/:categoryId/images

Param Type Description
file string, string[] File(s) to delete.

Example request body:

{
    "file": "mediamanager/image.jpg"
}

Update

PUT https://container-url.zoeysite.com/api/rest/categories/:categoryId/images

Param Type Description
main_image string, null Image to set as the main image. Null value will unset the main image.
thumbnail string, null Image to set as the thumbnail image. Null value will unset the thumbnail.
promo_image string, null Image to set as the promo image. Null value will unset the promo image.

Example request body:

{
    "main_image": "mediamanager/image.jpg",
    "thumbnail": "mediamanager/thumbnail.jpg",
    "promo_image": null
}

Get

GET https://container-url.zoeysite.com/api/rest/categories/:categoryId

Get All

GET https://container-url.zoeysite.com/api/rest/categories/?limit=2&page=2&order=name&dir=ASC&filter[0][attribute]=name&filter[0][eq]=Category&id=2

Filtering this collection requires and attribute and a value.

Action Data Type Description
eq string Is Equal To
neq string Is NOT Equal To
like string Is Like
nlike string Is Not Like
in array Is In
nin array Is NOT In
null boolean Is NULL
notnull boolean Is NOT NULL
gt string Is Greater Than
gte string Is Greater Than OR Equal To
lt string Is Less Than
lte string Is Less Than OR Equal To

How To Filter A Data Type in Query

DataType Query Description
string ?filter[0][attribute]=firstname&filter[0][neq]=test firstname does not equal test
array ?filter[0][attribute]=email&filter[0][in][0]=test@example.com&filter[0][in][1]=test@zoey.com Filter this collection where the email is either test@example.com or test@zoey.com
boolean ?filter[0][attribute]=email&filter[0][null]=true Filter this collection where the email is null.

Query parameters:

NameExampleNotes
limit2Items per page (ex: ?limit=10) ( Optional )
page2Pagination (ex: ?page=1) ( Optional )
ordernameAttribute to sort by (ex: ?order=name) ( Optional )
dirASCSort Direction (ex: ?order=name&dir=DESC) Requires order. ( Optional )
filter[0][attribute]nameFilter collection. ( Optional )
filter[0][eq]Category
id2Parent Category ID (optional)

Create

POST https://container-url.zoeysite.com/api/rest/categories/

Example request body:

{
    "parent_id": "5",
    "name": "API Category",
    "url_key": "api-category",
    "is_active": "1",
    "include_in_menu": "1",
    "include_in_menu_mobile": "1",
    "available_sort_by": [
        "position"
    ],
    "default_sort_by": "position"
}

Update

PUT https://container-url.zoeysite.com/api/rest/categories/:categoryId

Example request body:

{
    "available_sort_by": "name",
    "default_sort_by": "name",
    "account_permissions": "8"
}

Delete

DELETE https://container-url.zoeysite.com/api/rest/categories/:categoryId