REST API v2.8

Categories

Collection of categories for a site.

Get Categories

Endpoint

GET sites/{siteid}/categories

Parameters

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in category.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type category.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/categories.json?num=2

Response

{ "totalcount": 40, "items": [ { "categoryid": 1, "categoryparentid": null, "visible": true, "sortorder": 1, "custom1": "", "custom2": "", "friendly": "living-room", "seo_title": "Feel the inspiration for a new living room", "seo_keywords": "furniture, sofas, living room", "seo_description": "Feel the inspiration for a new living room.\nDiscover Home & Furnishing!", "title": "Living Room", "datecreated": 1353477229, "datemodified": 1354108348 }, { "categoryid": 2, "categoryparentid": null, "visible": true, "sortorder": 5, "custom1": "", "custom2": "", "friendly": "brand", "seo_title": "", "seo_keywords": "", "seo_description": "", "title": "Brand", "datecreated": 1353477229, "datemodified": 1354108461 } ] }

Add Category

Endpoint

POST sites/{siteid}/categories

Request body

See category for fields.
Required fields:
title

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns categoryid if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/categories.json { "title": "Street Classics", "categoryparentid": 5 }

Response

68

Get Category

Endpoint

GET sites/{siteid}/categories/{categoryid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an item of type category.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/categories/68.json

Response

{ "categoryid": 68, "categoryparentid": 5, "visible": true, "sortorder": 3, "custom1": "", "custom2": "", "friendly": "street-classics", "seo_title": "", "seo_keywords": "", "seo_description": "", "title": "Street Classics", "datecreated": 1543832752, "datemodified": 1543832752 }

Update Category

Endpoint

PUT sites/{siteid}/categories/{categoryid}

Request body

See category for fields.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/categories/68.json { "title": "Jeans" }

Response

true

Delete Category

Note that any descendants of the category being deleted will also be deleted!

Endpoint

DELETE sites/{siteid}/categories/{categoryid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

DELETE https://api.mysitoo.com/v2/accounts/1500/sites/1/categories/68.json

Response

true