Returns all messages that belongs to a conversation
GET /v2/messaging/conversations/{conversationId}/messagesRequest
ConversationId - The conversation the message belongs to
Response
| Field | Type | Description |
|---|---|---|
messageId | integer | Unique identifier for the message |
conversationId | integer | The conversation the message belongs to |
sender | string | Guest or Host |
body | string | The text of the message |
messageType | string | What kind of message this is — see below |
sentAt | dateTime (YYYY-MM-DDTHH:mm:ssZ) | When the message was sent |
viewedAt | dateTime (YYYY-MM-DDTHH:mm:ssZ) | When it was first opened by whoever it was addressed to, else null |
attachments | array | Files attached to the message |
Message Types
| Type | Meaning |
|---|---|
ContactHost | A guest enquiry about a home |
Conversation | A reply sent from the Plum inbox |
ConversationViaEmailClient | A reply sent using an email client |
Booking | The message a guest leaves with a booking request |
Declined | The message sent when a request to book is declined |
Undelivered | A notice that an earlier message could not be delivered |
Only Conversation can be sent through this API.
Attachments on a message
| Field | Type | Description |
|---|---|---|
name | string | The name to show, as the file was uploaded |
fileName | string | The name the file is stored under. Downloads use this, not name |
contentType | string | Media type of the file |
size | string | Size of the file in bytes, sent as a string rather than a number |
Downloading a file needs both the fileName and the messageId it arrived on — see Attachments.
The response is { "data": [...], "total": n}This route does not page: the whole thread comes back in one call, so total is simply how many messages are in data.
viewedAt is the read receipt of whoever the message was addressed to.
| Status | When it happens |
|---|---|
200 | The conversation belongs to this host. A thread with nothing readable left is an empty data array with a total of 0, not an error |
400 | The token carries no usable user id |
401 | The Authorization header is missing, malformed or expired |
404 | No conversation with that id belongs to the authenticated host |
5xx | A transient failure reaching the messaging back end. Safe to retry, because this endpoint only reads |
A conversation that does not exist and one belonging to another host both return 404, deliberately, so nothing about another host's inbox can be inferred from the difference.
conversationId has to be a positive whole number. 0, a negative number or anything non-numeric does not match the route at all, so it comes back as a bare 404 rather than a validation error.
