Create a category
POST
Creates a new product category and returns it directly with HTTP 201. Category names must be unique.
How to use it
- Send a unique, non-blank name, for example {"name": "Beverages"}.
- The response (HTTP 201) is the category itself with its new id, not wrapped in the status/message envelope.
- Use the category id when creating or updating items in that category.
BearerAuthheader
AuthorizationBearer <JWT>application/json- body
id?|Unique numeric ID of the category. Set by the server; omit it when creating.
Format
int64name*stringCategory name. Required, must not be blank, and must be unique.
modifiedTime*stringTime the category was created (ISO 8601 date-time). Set by the server; renaming the category does not change it.
Format
date-timeOK
*/*- response
id?|Unique numeric ID of the category. Set by the server; omit it when creating.
Format
int64name*stringCategory name. Required, must not be blank, and must be unique.
modifiedTime*stringTime the category was created (ISO 8601 date-time). Set by the server; renaming the category does not change it.
Format
date-timeExample 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"}