Params

NameTypeRequirenessDefault valueDescription
messagestringoptionalnoneMessage (it's length may be limited for certain channel types). Optional when attachments is given. A call with an empty or missing message and no attachments returns error code 11.
thread_idstringoptionalnoneThread id (required without thread_uid and booking_uid).
booking_uidstringoptionalnoneUID of a booking (required without thread_uid).
channelstringoptionalplatformChannel type (see the corresponding filters section). Use 'email' for direct bookings, 'platform' for other platforms.
attachmentsstring[]optionalnoneIDs of images to send with the message, at most 10, returned by upload-message-attachment. Requires the messaging-send-attachments scope: without it, a call with attachments returns error code 14, and nothing is sent.

An ID can be sent in any number of messages until it expires, 24 hours after its upload; sending does not extend it. An ID that is unknown, expired or uploaded by another account rejects the whole call with error code 11, and nothing is sent. The same ID listed twice is sent once, and images sharing a file name get -2, -3 and so on. With channel set to platform, Vrbo delivers only JPEG, PNG and GIF images up to 5 MB and skips other images. HomeAway cannot receive images with channel set to platform, so a call with attachments to a HomeAway booking or thread returns error code 11, and nothing is sent. |

Description

Sends message to the main guest of a booking with using different available channels.

Returns UID of a message which can be used as a parameter for the message-status method

Images are uploaded first with upload-message-attachment, and attachments lists their IDs. On Airbnb, the text and each image arrive as separate messages.

This endpoint requires the following scope: messaging-send. A call with attachments also requires the messaging-send-attachments scope.

Request sample

Upload each image first with upload-message-attachment, then pass the returned IDs in attachments:

{
    "booking_uid": "HM4ZNBQ8TA_airbnb_123456789",
    "channel": "platform",
    "message": "Here is how to find the entrance.",
    "attachments": [
        "matt_01jabcdefghjkmnpqrstvwxyz0",
        "matt_01jabcdefghjkmnpqrstvwxyz1"
    ]
}

Response sample

{
    "data": {
        "message_uid": "74302303"
    }
}

Error sample

When an attachment ID is unknown, expired, or was uploaded by another account, the whole call is refused, and nothing is sent:

{
    "error": {
        "code": 11,
        "message": "Unknown or expired attachment ID; nothing was sent"
    }
}

When the token lacks the messaging-send-attachments scope, a call with attachments is refused, and nothing is sent:

{
    "error": {
        "code": 14,
        "message": "This API token does not have access to the needed scope which are required to perform this operation"
    }
}