GET

List Messages


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves messages between the business and participant.

Up to 30 messages are returned per request. If the number of messages is larger than the returned page, pagingMetadata.cursors is returned in the response, indicating that another page of results is available. To retrieve the next page, pass the next cursor value in the next request's paging.cursor parameter.

To ensure you'll always retrieve the next record, use the same visibility and sorting in the first request and all subsequent requests.

By default, 30 messages are retrieved, sorted by sequence in descending order (the most recent messages are first in the list).

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Inbox Messages
Read Inbox Messages
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/inbox/v2/messages

Query Params
conversationIdstringRequired

ID of the conversation that contains the intended messages.


visibilitystring

Required. Filters for messages with the specified visibility setting.

  • BUSINESS_AND_PARTICIPANT: Return messages visible to the business and the participant.
  • BUSINESS: Return all messages.

paging.limitintegerminimum 0maximum 100format int32

Number of items to load.


paging.cursorstring

Pointer to the next or previous page in the list of results.

You can get the relevant cursor token from the pagingMetadata object in the previous call's response. Not relevant for the first request.


sorting.fieldNamestring

Name of the field to sort by.


sorting.orderstring

Sort order.

Response Object
messagesArray <Message>

List of messages between the specified visitor and the site.


pagingMetadataPagingMetadata

Details on the paged set of results returned.

List Messages Example 1
Request
cURL
curl -X GET \ 'https://www.wixapis.com/inbox/v2/messages?conversationId=6202c3bb-f263-3c16-8c90-d6387d9ed420&visibility=BUSINESS_AND_PARTICIPANT' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "messages": [ { "id": "1640851963799825", "content": { "previewText": "Thanks for reaching out 💬. We’ll be right with you.", "basic": { "items": [ { "text": "Thanks for reaching out 💬. We’ll be right with you." } ] } }, "sender": { "wixUserId": "5a0c4737-a2a0-4c37-a07e-d9fd87027023" }, "badges": [], "targetChannels": [], "sourceChannel": "UNKNOWN_CHANNEL_TYPE", "visibility": "BUSINESS_AND_PARTICIPANT", "sequence": "1640851963799825", "direction": "BUSINESS_TO_PARTICIPANT", "createdDate": "2021-12-30T08:12:43.799Z" }, { "id": "1640851962800972", "content": { "previewText": "A Template message!", "basic": { "items": [ { "text": "A text message" } ] } }, "sender": { "anonymousVisitorId": "40096143-3643-4cc1-8329-30a7fc2c595e" }, "badges": [], "targetChannels": ["CHAT"], "sourceChannel": "CHAT", "appId": "141fbfae-511e-6817-c9f0-48993a7547d1", "visibility": "BUSINESS_AND_PARTICIPANT", "sequence": "1640851962800972", "direction": "PARTICIPANT_TO_BUSINESS", "createdDate": "2021-12-30T08:12:42.800Z" }, { "id": "1640851398501777", "content": { "previewText": "A Template message!", "template": { "title": "A Template Message", "buttons": [ { "label": "click me", "postbackProperties": { "appId": "141fbfae-511e-6817-c9f0-48993a7547d1", "interactionId": "inter_id_1" } } ], "orientation": "PORTRAIT", "textLines": ["oh", "cool"], "imageUrl": "https://static.wixstatic.com/media//0df0927d01d641338d1e0c59bbbabfde.jpg/v1/fill/w_315,h_315,q_80/0df0927d01d641338d1e0c59bbbabfde.jpg" } }, "sender": { "appId": "141fbfae-511e-6817-c9f0-48993a7547d1" }, "badges": [], "targetChannels": ["CHAT"], "sourceChannel": "CHAT", "appId": "141fbfae-511e-6817-c9f0-48993a7547d1", "visibility": "BUSINESS_AND_PARTICIPANT", "sequence": "1640851398501777", "direction": "BUSINESS_TO_PARTICIPANT", "createdDate": "2021-12-30T08:03:18.501Z" }, { "id": "1640849952353627", "content": { "previewText": "Hey!", "basic": { "items": [ { "text": "Hey!" } ] } }, "sender": { "wixUserId": "5a0c4737-a2a0-4c37-a07e-d9fd87027023" }, "badges": [], "targetChannels": ["EMAIL"], "sourceChannel": "CHAT", "appId": "141fbfae-511e-6817-c9f0-48993a7547d1", "visibility": "BUSINESS_AND_PARTICIPANT", "sequence": "1640849952353627", "direction": "BUSINESS_TO_PARTICIPANT", "createdDate": "2021-12-30T07:39:12.353Z" } ] }
Errors
401Unauthenticated

There are 2 errors with this status code.

404Not Found

There are 2 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?