Get conversations
Changed onGet conversations
Request
- Base URLhttps://open-api.guesty.com/v1
- URLhttps://open-api.guesty.com/v1/communication/conversations
- AuthAPI key in header authorization
Query parameters
Array of filters to query by.
field: Subject of the filter: status, type, guest._id, owner._id, reservation._id, reservation.status, read, assignee._id, listing._id
operator: Enhanced MongoDB comparison operator: $eq, $exists, $not, $contains, $notcontains, $gt, $lt, $between, $in, $nin
value: Value to filter by
Selection of fields, separated by space
Sorting, default: -createdAt
Pagination, max: 100, default is: 25
Pagination cursor, default:'',
cursorAfter and cursorBefore are not allowed to be used at the same time in one request.
First request will require only limit parameter and in response you will get cursor object.
Use cursor.after to send in query params cursorAfter parameter in order to move forward.
Use cursor.before to send in query params cursorBefore parameter in order to move backwards.
An empty string in after or before cursor in response will indicate that there is no more documents in this direction.
If you sort buy something different than createdAt, please make sure include this parameter in fields, or you will get empty cursor.
cursorAfter and cursorBefore are not allowed to be used at the same time in one request.
Pagination cursor, default:null
Deprecated — use the type query parameter instead. The legacy name contains a space and is not transmitted correctly by generated clients.
The conversations API supports guest, owner, and owner-direct conversations.
The query parameter type (guest, owner, or owner-direct; default: guest) determines which conversations are returned.
- guest — guest inbox conversations
- owner — owner conversations (includes owner and owner-guest records)
- owner-direct — direct owner conversations
Owner and owner-direct conversations do not support airbnb2 module type; messages sent with platform module type are delivered through Email.
Response
OK
Example response
{
"status": 200,
"data": {
"count": 30,
"countUnread": 2,
"fields": "guest reservation status assignee priority createdAt",
"limit": 25,
"conversations": [
{
"_id": "6134a49cd450d300307794cb",
"priority": 10,
"meta": {
"reservations": [
{
"_id": "61347d71d450d300307792a4",
"status": "inquiry",
"checkIn": "2021-09-04T21:00:00.000Z",
"checkOut": "2021-09-05T20:00:00.000Z",
"listing": {
"tags": [
"Pool"
],
"_id": "5fba2d97d8e638002d76d842",
"picture": {
"_id": "615c0214cdf3370028883d3a",
"thumbnail": "https://res.cloudinary.com/guesty/image/upload/c_fit,h_200/v1606036872/preprod/5fb67280e39677002e6c2683/ephepadfvgopafgykxrc.jpg"
},
"address": {
"full": "Loma Mazamitla Sur, La Aurora, 44790 Guadalajara, Jal., Mexico",
"city": "Guadalajara",
"country": "Mexico",
"state": "Jalisco"
},
"nickname": "OPS-Listing",
"title": "TEST"
}
}
],
"guest": {
"_id": "61347d70d450d300307792a3",
"email": "asdasd@assadsa.com"
}
},
"accountId": "5fb67280e39677002e6c2683",
"createdAt": "2021-09-05T11:06:05.388Z",
"state": {
"status": "OPEN"
}
}
]
}
}Changes
- breaking
the
queryrequest parameterconversation typeswas restricted to a list of enum values - breaking
for the
queryrequest parameterconversation types, default valueguestwas added - info
added the new optional
queryrequest parametertype - info
queryrequest parameterconversation typeswas deprecated - info
added the new enum value
guestto thequeryrequest parameterconversation types - info
added the new enum value
ownerto thequeryrequest parameterconversation types - info
added the new enum value
owner-directto thequeryrequest parameterconversation types
- breaking