Categories
Operation related to categories in Deeple system
Structure
Category structure
Field name | Types | Required/Optional | Description |
---|---|---|---|
name | string(30) | R | Category's name |
imageUrl | string(50) | R | Category's image url |
Example of category structure
{
"name": "ขนมไทย",
"imageUrl": "https://google.com/image.png" // Always expected https image url
}
Get main categories
Get main categories for categories flex message (rich menu + greeting message)
Resource method
POST
Parameters
Request parameters from Deeple system to 3rd party API
Field name | Types | Required/Optional | Description |
---|---|---|---|
userId | string(36) | R | User’s id from either LINE or Facebook |
postalCode | string(10) | O | User’s postal code |
originalText | string(50) | O | User’s original text |
Example request parameter
{
"userId": "U1325a29a021d91231239123",
"postalCode": "12345",
"originalText": "แนะนำสินค้า"
}
Example expected response object
{
"categories": [
{
"name": "ขนมไทย",
"imageUrl": "https://google.com/image.png" // Always expected https image url
}
]
}
Get sub categories
Search categories from 3rd party API after Deeple extract entity from the user’s original text
Resource method
POST
Parameters
Request parameters from Deeple system to 3rd party API
Field name | Types | Required/Optional | Description |
---|---|---|---|
userId | string(36) | R | User’s id from either LINE or Facebook |
postalCode | string(10) | O | User’s postal code |
originalText | string(50) | O | User’s original text |
categories | list of string (30) | O | Categories extracted from the user’s original text |
Example request parameter
{
"userId": "U1325a29a021d91231239123",
"postalCode": "12345",
"originalText": "มีแฮม TGM มั้ย",
"categories": ["ขนมไทย"]
}
Example expected response object
Returning sub categories
{
"categories": [
{
"name": "ขนมไทย",
"imageUrl": "https://google.com/image.png" // Always expected https image url
}
],
"products": []
}
Returning products from category
{
"categories": [],
"products": [
{
"productCode": "VA-4527",
"name": "TGM ไทยซอสเซส 200 กรัม",
"description": "",
"images": [{ src: "https://google.com/image.png" }] // Always expected https image url
"price": 200,
"stock": 50,
"promotion": {
"fullName": "ซื้อ TGM ไทยซอสเซส 1 แถม 1",
"shortName": "1 แถม 1",
"description": "ซื้อ TGM ไทยซอสเซส 1 แถม 1"
}
}
]
}