{
    "componentChunkName": "component---src-templates-article-page-template-js",
    "path": "/concepts/messages/",
    "result": {"data":{"markdownRemark":{"frontmatter":{"title":"Messages","slug":"messages","updated":"2022-07-21T00:00:00.000Z","category":"concepts-messages","ingress":"Flex allows your users to communicate with each other using messages. This article introduces the concept of messages and how to access messages through Zapier.","skills":null},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"h2","properties":{"id":"what-are-messages","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#what-are-messages","ariaLabel":"what are messages permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"What are messages?"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Messages let your users communicate with other users in your\nmarketplace. They can be exchanged freely between a customer and a\nprovider once they have engaged in a transaction. Messages always need\nto be associated with a transaction and can not be sent outside of one.\nThe default transaction process includes an enquiry transition, which\ninitiates a transaction without running any\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/references/transaction-process-actions/#actions"},"children":[{"type":"text","value":"actions"}]},{"type":"text","value":", allowing\nthe provider and customer to send messages to each other. Note that\nmessages do not alter the transaction or transition state."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"sending-messages","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#sending-messages","ariaLabel":"sending messages permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Sending messages"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can send messages using the\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/api-reference/marketplace.html#send-message","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"send message endpoint"}]},{"type":"text","value":",\nwhich requires an authenticated user’s access token to call. The\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/introduction/getting-started-with-integration-api/"},"children":[{"type":"text","value":"Integration API"}]},{"type":"text","value":"\ndoes not offer an endpoint to send messages, and therefore, only\nauthenticated users can send messages through the Marketplace API."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"querying-messages","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#querying-messages","ariaLabel":"querying messages permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Querying messages"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can query messages through the query messages endpoint, which\nreturns all messages in a given transaction. Messages can also be\nincluded as a relationship when\n"},{"type":"element","tagName":"a","properties":{"href":"https://www.sharetribe.com/api-reference/marketplace.html#query-transactions","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"querying transactions"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"email-notifications","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#email-notifications","ariaLabel":"email notifications permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Email notifications"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"New messages trigger a\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/concepts/email-notifications/"},"children":[{"type":"text","value":"built-in email notification"}]},{"type":"text","value":" sent to\nthe receiving party of the message. You can edit built-in email\nnotifications through\n"},{"type":"element","tagName":"a","properties":{"href":"https://flex-console.sharetribe.com/email-templates/new-message","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Console"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"zapier-events-and-messages","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#zapier-events-and-messages","ariaLabel":"zapier events and messages permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Zapier, events and messages"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Using "},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/how-to/set-up-and-use-zapier/"},"children":[{"type":"text","value":"Zapier"}]},{"type":"text","value":" you can connect your\nmarketplace with other web applications and create automated workflows.\nEven though you can’t listen for new messages through Zapier, messages\ncan easily be retrieved as a transaction relationship. For more complex\ncustomisations, you can use events to listen to new or deleted messages."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"how-to-retrieve-messages-in-zapier","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#how-to-retrieve-messages-in-zapier","ariaLabel":"how to retrieve messages in zapier permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"How to retrieve messages in Zapier"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can use Zapier to access messages using the transaction ID that is\nassociated with them. By default, when you listen to transaction events,\nthe message relationship is not included. To include the message\nrelationship, add the action \"Show Transaction\" to the trigger\n\"Transaction events\" and select messages from the dropdown menu."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"video","properties":{},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"source","properties":{"src":"/docs/legacy/06d90691ec97fddc3c3eb7bcba659ac6/zapier.mp4","type":"video/mp4"},"children":[]},{"type":"text","value":"\n    "},{"type":"element","tagName":"source","properties":{"src":"/docs/legacy/b28c1d90930baef3150a2a3eb1cc00a1/zapier.webm","type":"video/webm"},"children":[]},{"type":"text","value":"\n    "},{"type":"element","tagName":"source","properties":{"src":"/docs/legacy/8536f40e591b6b9d012a3d4b354e8cf6/zapier.ogv","type":"video/ogg"},"children":[]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"From the dropdown menu, you can select messages, and you are then able\nto use the message content in your Zap."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"events-and-messages","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#events-and-messages","ariaLabel":"events and messages permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Events and messages"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Listening to "},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/how-to/reacting-to-events/"},"children":[{"type":"text","value":"events"}]},{"type":"text","value":" through the\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/introduction/getting-started-with-integration-api/"},"children":[{"type":"text","value":"Integration API"}]},{"type":"text","value":"\nis the most versatile way to react to what is happening in your\nmarketplace. As sending new messages does not affect transaction state\nor transitions, you can’t use Zapier to detect new messages as it can\nonly react to transactions, listing and user events. Events allow you to\nlisten to "},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/references/events/#supported-event-types"},"children":[{"type":"text","value":"created messages"}]},{"type":"text","value":"\nand react directly to them. See how to\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/how-to/reacting-to-events/"},"children":[{"type":"text","value":"react to events"}]},{"type":"text","value":" and the\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/integration-api-examples","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"Integration API example script repository"}]},{"type":"text","value":"\nif you’re unsure where to start building your integration."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"message-notifications-in-flex-templates-for-web-ftw","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#message-notifications-in-flex-templates-for-web-ftw","ariaLabel":"message notifications in flex templates for web ftw permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Message notifications in Flex Templates for Web (FTW)"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"By default, FTW renders a notification symbol when the provider has\ntransactions that require action, i.e. transactions that require\nacceptance of a booking request."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 538px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/81b43/notification.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 25.157232704402517%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAwElEQVQY051QyQrCQAztF3r0pB68Fs9+mSiKC+JAQVHqAoJ4EHEBW5ci2s40edoRyigexMDLRhJenoU/jb/VzLCYGRzHIKVAUurcRNJnIiRzURhCKoX4dtNHZKuKe6kA1W28jhLBSlzkHXCZuji7QwTzGa7LhcZlNtaQRx9hFKHvOOgKgZUQQBBgY+exzmWwL9spUyulbDL6zInSBTLe9OoVTIpZ+M2awZD5J81OowEO7Qb8XkfH+277rmUi3VPDBwJDfUTYeIHHAAAAAElFTkSuQmCC'); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/82e29/notification.webp 159w","/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/ef33f/notification.webp 318w","/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/620c1/notification.webp 538w"],"sizes":"(max-width: 538px) 100vw, 538px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/8b9b5/notification.png 159w","/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/fa108/notification.png 318w","/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/81b43/notification.png 538w"],"sizes":"(max-width: 538px) 100vw, 538px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/94bf0995e96b11f5153ea9fccc8a9427/81b43/notification.png","alt":"Notification symbol","title":"Notification symbol","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This is how the default logic works:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"A\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/master/src/ducks/user.duck.js#L300","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"query is made"}]},{"type":"text","value":"\nthat retrieves all sales transactions (i.e. transactions where the\ncurrent user is the provider) transactions that are in the\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/85e9291a3078c54d6531ad465276f03847882911/src/util/transaction.js#L214","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"confirm payment state"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The amount of sales transactions determines the\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/master/src/ducks/user.duck.js#L104","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"notification count"}]},{"type":"text","value":"\nshown\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/master/src/components/TopbarDesktop/TopbarDesktop.js#L55","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"in the badge"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The variable\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/master/src/ducks/user.duck.js#L63","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"currentUserNotificationCount"}]},{"type":"text","value":"\nstores the number of active notifications."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can extend the messaging logic in many ways. For example, a common\ncustomisation is to display a notification every time a user receives a\nnew message. To achieve this, you could change the logic behind\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/ftw-daily/blob/master/src/ducks/user.duck.js#L63","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"currentUserNotificationCount"}]},{"type":"text","value":"\nto display a number stored in extended data. The data attribute would\nrepresent the number of unread messages, and could be updated every time\na new message is detected using "},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/how-to/reacting-to-events/"},"children":[{"type":"text","value":"events"}]},{"type":"text","value":"."}]}],"data":{"quirksMode":false}},"headings":[{"value":"What are messages?","depth":2},{"value":"Sending messages","depth":3},{"value":"Querying messages","depth":3},{"value":"Email notifications","depth":3},{"value":"Zapier, events and messages","depth":2},{"value":"How to retrieve messages in Zapier","depth":3},{"value":"Events and messages","depth":3},{"value":"Message notifications in Flex Templates for Web (FTW)","depth":2}]}},"pageContext":{"slug":"messages","category":"concepts-messages"}},
    "staticQueryHashes": ["3794076007","439097193","717698143"]}