Categories

Operation related to categories in Deeple system

Structure

Category structure

Field nameTypesRequired/OptionalDescription
namestring(30)RCategory's name
imageUrlstring(50)RCategory'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 nameTypesRequired/OptionalDescription
userIdstring(36)RUser’s id from either LINE or Facebook
postalCodestring(10)OUser’s postal code
originalTextstring(50)OUser’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 nameTypesRequired/OptionalDescription
userIdstring(36)RUser’s id from either LINE or Facebook
postalCodestring(10)OUser’s postal code
originalTextstring(50)OUser’s original text
categorieslist of string (30)OCategories 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"
}
}
]
}