iotoms Docs

Create a department

POST
/api/v1/catalog/attributes/departments

Creates a new product department used to group items in the catalog and returns it directly with HTTP 201. Department names must be unique.

How to use it

  1. Send a unique, non-blank name, e.g. {"name": "Grocery"}.
  2. The department is created (HTTP 201) and returned directly, without the status/message envelope.
  3. Use its id as departmentId when creating or updating items.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
id?|

Numeric department ID. Set by the server; use it as departmentId on items.

Formatint64
name*string

Department name, e.g. the top-level grouping of items in the catalog. Required, must be unique and not blank.

modifiedTime*string

Timestamp stored when the department was created (ISO 8601). Renaming it does not change it.

Formatdate-time

Response Body

OK

*/*
  1. response
id?|

Numeric department ID. Set by the server; use it as departmentId on items.

Formatint64
name*string

Department name, e.g. the top-level grouping of items in the catalog. Required, must be unique and not blank.

modifiedTime*string

Timestamp stored when the department was created (ISO 8601). Renaming it does not change it.

Formatdate-time
Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/catalog/attributes/departments' \  -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"}