Send Reply
This endpoint sends a reply to a message (chat room) identified by msg_id
from shop_id
.
Path
post
/v1/chat/fs/:fs_id/messages/:msg_id/reply
Request Parameters
Parameter | Type | Required | Location | Description |
---|---|---|---|---|
fs_id | Integer | Required | path | Fulfillment service unique identifier |
msg_id | Integer | Required | path | Message service unique identifier |
shop_id | Integer | Required | body | Shop service unique identifier |
message | String | Required* | body | Message content |
attachment_type | Integer | Required | body | Attachment Type with value listed below. Default value is 0 |
payload | JSON | Required* | body | Attachment payload |
file_path | String | Required* | body | File path for image attachment |
Example Request
Example Request with text reply
- Curl
curl -X GET \
https://fs.tokopedia.net/v1/chat/fs/12345/messages/54321/reply \
-H 'Authorization: Bearer OoHgyxcgQ5a1uCbmbbXjjA'
-d '{
"shop_id": 23456,
"message": "Terimakasih"
}'
Example Request with image attachment
- Curl
curl -X GET \
https://fs.tokopedia.net/v1/chat/fs/12345/messages/54321/reply \
-H 'Authorization: Bearer OoHgyxcgQ5a1uCbmbbXjjA'
-d '{
"shop_id": 23456,
"attachment_type": 19,
"payload": {
"thumbnail": "https://www.tokopedia.com/quotation_thumbnail.jpg",
"identifier": "string",
"title": "Quotation Card",
"price": "Rp10.000",
"url": "https://www.tokopedia.com/quotation_url"
}
}'
Example Request with custom quotation
- Curl
curl -X GET \
https://fs.tokopedia.net/v1/chat/fs/12345/messages/54321/reply \
-H 'Authorization: Bearer OoHgyxcgQ5a1uCbmbbXjjA'
-d '{
"shop_id": 23456,
"message": "Terimakasih"
}'
Response Parameters
Name | Type | Demo Value | Description |
---|---|---|---|
Integer | 54321 | Message Unique Identifier | |
Integer | 13579 | Sender User Unique Identifier | |
Integer | 2 | User Role | |
Integer | 1564741529630 | Reply Time in UNIX format | |
String | Owen | Whose message is from | |
attachment | Object | ||
fallback_attachment | Object |
Success Response Examples
Example Request with text reply
{
"header": {
"process_time": 0,
"messages": "success",
"reason": "",
"error_code": 0
},
"data": {
"msg_id": 54321,
"sender_id": 123456,
"role": 2,
"msg": "Terimakasih",
"reply_time": 1571626816456,
"from": "Owen",
"attachment": {}
}
}
Example Request with custom quotation attachment
{
"header": {
"process_time": 0,
"messages": "success",
"reason": "",
"error_code": 0
},
"data": {
"msg_id": 54321,
"sender_id": 123456,
"role": 2,
"reply_time": 1571626816456,
"from": "Owen",
"attachment": {
"quotation_profile": {
"thumbnail": "https://www.tokopedia.com/quotation_thumbnail.jpg",
"identifier": "string",
"title": "Quotation Card",
"price": "Rp10.000",
"url": "https://www.tokopedia.com/quotation_url"
}
},
"fallback_attachment": {
"html": "<div>https://www.tokopedia.com/quotation_url</div>",
"message": "https://www.tokopedia.com/quotation_url"
}
}
}
Error Response Examples
{
"header": {
"process_time": 0.001552878,
"messages": "Your request format or parameters have some problem.",
"reason": "invalid shop_id format",
"error_code": 0
},
"data": null
}
Error Codes
Error Code | Error Message | Description |
---|---|---|
SHP_GRPC_001 | Failed Send GRPC Request | Failed sending request to upstream |
SHP_GRPC_003 | Data Not Found | Failed finding data from upstream |
Notes
List of Attachment Type
Attachment Type | Type | Required Fields |
---|---|---|
0 | No attachment | message |
2 | Image | file_path |
19 | Custom quotation | payload |