HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Get Conversations

Function

Get Conversations with platform.
藉由平台獲取對話列表。

URL

GET <<api_domain>>/v1/conversations

Request parameters

ParameterTypeDescriptionExample
platform *requiredStringPlatform, only support shop_messages and order_messages
獲取平台,目前僅支援網店訊息及訂單訊息
platform=shop_messages
customer_idStringCustomer ID
ID
622090c67895b5731f2c53c5
pageIntegerPage Number
頁數(第n頁)
(Default: 1)
page=1
per_pageIntegerNumbers of Products per page
每頁顯示 n 筆資料
(Default: 24)
-
*It's suggested to set per_page number to 50
建議 per_page 至多設定50
per_page=24

Response fields

FieldTypeDescriptionExample
paginationPaginationPagination
頁面資訊
Please check the link on the left
itemsArrayArray of Conversations
對話列表資訊
Shown below

Items entity (shop_messages)

FieldTypeDescriptionExample
idStringConversation ID622090c66775a37b9fa60799
typeStringConversation Platformshop_messages
customer_idStringCustomer ID622090c67895b5731f2c53c5
last_messageHashLast Message Info{ id: '600ac08191f6530044eaad8a', sender_id: '622090c67895b5731f2c53c5', sender_type: 'User', created_at: '2021-01-25T09:39:35.167Z', value: '對話內容', type: 'image' }

Items entity (order_messages)

FieldTypeDescriptionExample
idStringConversation ID622090c66775a37b9fa60799
typeStringConversation Platformorder_messages
customer_idStringCustomer ID622090c67895b5731f2c53c5
order_numberStringOrder Number2019052707260498
system_order_numberStringSystem Order Number2019052707260498
merchant_order_numberStringMerchant Order Number Depending on rollout_keynull
order_idStringOrder ID5d8c8b3be388095d25acbc89
last_messageHashLast Message Info{ id: '600ac08191f6530044eaad8a', sender_id: '622090c67895b5731f2c53c5', sender_type: 'User', created_at: '2021-01-25T09:39:35.167Z', value: '對話內容', type: 'text' }

Response Example

{
    "pagination": {
        "current_page": 1,
        "per_page": 24,
        "total_count": 8,
        "total_pages": 1
    },
    "items": [
        {
            "id": "622090c66775a37b9fa60799",
            "type": "shop_messages",
            "customer_id": "622090c67895b5731f2c53c5",
            "last_message": {
                "id": "622090c66775a37b9fa6079b",
                "sender_id": "622090c67895b5731f2c53c5",
                "sender_type": "User",
                "created_at": "2022-03-03T09:56:22.559Z",
                "value": "你好",
                "type": "text"
            }
        },
        {
            "id": "600d713291f6530044eab0d5",
            "type": "shop_messages",
            "customer_id": "600d71329888be544e4f27fb",
            "last_message": {
                "id": "600d723a91f6530044eab0d9",
                "sender_id": "600d71329888be544e4f27fb",
                "sender_type": "User",
                "created_at": "2021-01-24T13:12:26.282Z",
                "value": null,
                "type": "image"
            }
        }
    ]
}
{
    "pagination": {
        "current_page": 1,
        "per_page": 5,
        "total_count": 115,
        "total_pages": 23
    },
    "items": [
        {
            "id": "600f6e0d8e9f8a1afe47c51b",
            "type": "order_messages",
            "customer_id": "600f6e0bbd33f1064c090c97",
            "order_number": null,
            "system_order_number": null,
            "merchant_order_number": null,
            "order_id": "600f6e0d8e9f8a1afe47c51b",
            "last_message": {
                "id": "600f6e458e9f8a1afe47c526",
                "sender_id": "600f6e0bbd33f1064c090c97",
                "sender_type": "User",
                "created_at": "2021-01-26T01:20:05.801Z",
                "value": "Hi",
                "type": "text"
            }
        }
    ]
}