iotoms Docs

Create a category

POST
/api/v1/catalog/attributes/categories

Creates a new product category and returns it directly with HTTP 201. Category names must be unique.

How to use it

  1. Send a unique, non-blank name, for example {"name": "Beverages"}.
  2. The response (HTTP 201) is the category itself with its new id, not wrapped in the status/message envelope.
  3. Use the category id when creating or updating items in that category.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
id?|

Unique numeric ID of the category. Set by the server; omit it when creating.

Formatint64
name*string

Category name. Required, must not be blank, and must be unique.

modifiedTime*string

Time the category was created (ISO 8601 date-time). Set by the server; renaming the category does not change it.

Formatdate-time

Response Body

OK

*/*
  1. response
id?|

Unique numeric ID of the category. Set by the server; omit it when creating.

Formatint64
name*string

Category name. Required, must not be blank, and must be unique.

modifiedTime*string

Time the category was created (ISO 8601 date-time). Set by the server; renaming the category does not change it.

Formatdate-time
Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/catalog/attributes/categories' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "modifiedTime": "2019-08-24T14:15:22Z"}'
Example Response
{  "id": 0,  "name": "string",  "modifiedTime": "2019-08-24T14:15:22Z"}