HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Create Shop Message

Function

To create shop message
建立訊息

URL

POST https://open.shopline.io/v1/conversations/message

Request Parameters

ParameterTypeDescriptionExample
sender_id
*Required
StringSender ID
發送者ID
5ce0d084e388096bdb229a59
recipient_id
*Required
StringRecipient ID
接收者ID
5ce0d084e388096bdb229a59
textStringText
文字內容
hello
media_idStringMedia ID
圖片ID
5ce0d084e388096bdb229a59
ref_data.pathStringPath
路徑
用於儲存用戶發送訊息當下的路徑,顯示於訊息中心
/messages
ref_data.full_pathStringFull Path
完整路徑
用於儲存用戶發送訊息當下的路徑,顯示於訊息中心
https://mydomain.com/messages

Request Example

curl --location --request POST 'https://open.shopline.com/v1/conversations/message' \
--header 'Authorization: Bearer ${token}' \
--header 'Content-Type: application/json' \
--data-raw '{
        "media_id": "64216d1a818ba9004cc4cce7",
        "sender_email": "[email protected]",
        "sender_id": "60f64c7b262ba6001b9c0463",
        "recipient_id": "63e4b7faa7234a05c9626520",
        "ref_data": {
            "path": "/",
            "full_path": "/"
        }
}'

Response Body

{
    "id": "6421755e203c0e44f88f3ed5",
    "platform": "shop_messages",
    "message": {
        "sender_id": "60f64c7b262ba6001b9c0463",
        "created_at": "2023-03-27T10:52:14.101Z",
        "acting_sender_id": "625ce9457b7d28003882d517",
        "is_sent_by_merchant": true,
        "attachment": {
            "image_url": "https://img-shoplineapp-com.s3.amazonaws.com/media/image_clips/64216d1a818ba9004cc4cce7/original.jpeg?1679912218",
            "type": "image"
        }
    }
}