Categories
Operation related to categories in Deeple system
Structure
Category structure
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's name |
description | string(50) | O | Category's description |
image | string(50) | R | Category's image url |
isFree | boolean | O | Indicator this category is free or not |
isActive | boolean | O | Indicator this category is active or not |
properties | list of properties | O | Category's properties |
variations | list of variation | O | Category's variations |
Example of category structure
{
"name": "string",
"description": "string",
"image": "string",
"isFree": false,
"isActive": true,
"properties": [
{
"name": "string"
}
],
"variations": [
{
"name": "string"
}
]
}
Category's property structure
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's property name |
Example of category's property structure
{
"name": "string"
}
Category's variation structure
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's variation name |
Example of category's variation structure
{
"name": "string"
}
Create category
Create category which will be used by BOT. We suggest to keep maximum amount of categories to 10. Since we will display this on Categories
carousel
Resource method
POST
Endpoint
/v1/categories
Parameters
Body parameters
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's name |
description | string(50) | O | Category's description |
image | string(50) | R | Category's image url |
isFree | boolean | O | Indicator this category is free or not |
isActive | boolean | O | Indicator this category is active or not |
properties | list of properties | O | Category's properties |
variations | list of variation | O | Category's variations |
Example response object
{
"id": 1,
"createdAt": "2020-06-14T19:52:06.942Z",
"updatedAt": "2020-06-14T19:52:06.942Z",
"projectId": 1,
"name": "string",
"description": "string",
"image": "string",
"isFree": false,
"isActive": true,
"isDeleted": false,
"properties": [
{
"name": "string"
}
],
"variations": [
{
"name": "string"
}
]
}
Get categories
Resource method
GET
Endpoint
/v1/categories
Parameters
No parameters
Example response object
{
"data": [
{
"id": 1,
"createdAt": "2020-06-14T19:52:06.942Z",
"updatedAt": "2020-06-14T19:52:06.942Z",
"projectId": 1,
"name": "string",
"description": "string",
"image": "string",
"isFree": false,
"isActive": true,
"isDeleted": false,
"properties": [
{
"name": "string"
}
],
"variations": [
{
"name": "string"
}
]
}
],
"total": 1
}
Import categories
Import categories with CSV file. Here is an example of categories CSV
Resource method
POST
Endpoint
/v1/categories/import
Parameters
Body parameters
Field name | Types | Required/Optional | Description |
---|---|---|---|
categories | csv | R | Category's file |
Example response object
200 - OK status code
Get category by name
Resource method
GET
Endpoint
/v1/categories/:categoryName
Parameters
URL parameter
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Categories' CSV file |
Example response object
{
"name": "string",
"description": "string",
"image": "string",
"isFree": false,
"isActive": true,
"isDeleted": false,
"properties": [
{
"name": "string"
}
],
"variations": [
{
"name": "string"
}
]
}
Update category's information by name
Resource method
PATCH
Endpoint
/v1/categories/:categoryName
Parameters
URL parameter
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's name |
Body parameters
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | O | Category's name |
description | string(50) | O | Category's description |
image | string(50) | O | Category's image url |
isFree | boolean | O | Indicator this category is free or not |
isActive | boolean | O | Indicator this category is active or not |
properties | list of properties | O | Category's properties |
variations | list of variation | O | Category's variations |
Example response object
{
"name": "string",
"description": "string",
"image": "string",
"isFree": false,
"isActive": true,
"isDeleted": false,
"properties": [
{
"name": "string"
}
],
"variations": [
{
"name": "string"
}
]
}
Delete category by name
Resource method
DELETE
Endpoint
/v1/categories/:categoryName
Parameters
URL parameter
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's name |
Example response object
{
"name": "string",
"description": "string",
"image": "string",
"isFree": false,
"isActive": true,
"isDeleted": false,
"properties": [
{
"name": "string"
}
],
"variations": [
{
"name": "string"
}
]
}