Skip to main content

List Message

This endpoint retrieves a list of all messages (chatrooms) owned by a shop_id.

Path

get

/v1/chat/fs/:fs_id/messages?shop_id=:shop_id

Request Parameters

ParameterTypeRequiredLocationDescription
fs_id
Integer
Required
path
Fulfillment service unique identifier
shop_id
Integer
Required
query
Shop service unique identifier
page
Integer
Optional
query
Determine which page the order list should start. Start from 1. You can get the next page when the previous page has have_next_page value true
per_page
Integer
Optional
query
Determine how many orders will be shown per page. The maximum value is 15
filter
String
Optional
query
Filter by message read status. Value between “all”, “read”, or “unread”identifier

Example Request

curl -X GET \
https://fs.tokopedia.net/v1/chat/fs/12345/messages?shop_id=234567 \
-H 'Authorization: Bearer OoHgyxcgQ5a1uCbmbbXjjA'

Response Parameters

NameTypeDemo ValueDescription
message_key
String
user-456456~shop-123123
Message Key
msg_id
Integer
123123
Message Unique Identifier
attributes
Object

Success Response Examples

{
"header": {
"process_time": 0,
"messages": "success",
"reason": "",
"error_code": 0
},
"data": [
{
"message_key": "user-456456~shop-123123",
"msg_id": 123123,
"attributes": {
"contact": {
"id": 456456,
"role": "user",
"attributes": {
"Name": "Owen",
"tag": "Pengguna",
"thumbnail": "https://accounts-staging.tokopedia.com/image/v1/u/456456/user_thumbnail/"
}
},
"last_reply_msg": "test",
"last_reply_time": 1571646034517,
"read_status": 2,
"unreads": 0,
"pin_status": 0
}
}
]
}

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 CodeError MessageDescription
SHP_GRPC_001
Failed Send GRPC Request
Failed sending request to upstream
SHP_GRPC_003
Data Not Found
Failed finding data from upstream

Notes

Response field explanation:

  1. Field messages_key is an identic key for related buyer and related seller that communicate at the chat.
  2. Field role has User, Shop Owner, Shop Admin, and Tokopedia Admin.
  3. Field read status is to identify that status = 1 is not read yet and status = 2 is already read.
  4. Field unreads is the number of unread messages in the related message.
  5. Field pin_status is for chat pinned or not, when pinned it is 1 and for not it is 0.

Have a feedback?