Solved

Detecting inboxes and identifying the owner

  • 20 December 2022
  • 2 replies
  • 37 views

Badge +2

We are writing an app that processes message body and attachments in an inbox. As you know, an inbox can have multiple channels. When a rule files on arrival of a new message in the inbox and Front sends a notification to our webhook, we want to be able to identify which inbox this message is from and whether that inbox has a subscription with us. One way that we thought we could identify inboxes was using the Inbox Id that is in the JSON payload. To use this, we’d need the user to provide the identifier (id) of the inboxes that they want to be supported to the app. I am wondering whether the Inbox ID is accessible somewhere in the Front Admin UI we cannot find the client admin users can find them and enter them into a configuration page on the app side (we could not find them in an initial look)?

 

If this is not the best way to identify inboxes and inbox owners, based on the message payload that Front sends, do you have any alternative suggestions?

icon

Best answer by Support Engineering 20 December 2022, 22:33

View original

2 replies

Userlevel 1
Badge +5

Detecting the inbox

As you mentioned, inspecting the "source" object in the payload you receive is an effective way to identify the inbox this conversation was in when the message was sent/received.

 

 

Identifying the owner (company)

What might be the most simple option here, is when creating these "send to webhook" rules (I presume this is what you're using?) Give the customer a token to attach to their webhook URL. This could look like sending the payload to 
htpps://webhooks.yourCompany.com/front?token=XXX

 

When your application router receives the payload, you can extract the token query string parameter, and connect the payload to a customer based on this token. 

 

Another option might be to first have the customer select a list of inboxes they want to monitor.

 

Instead of having customers manually enter inboxes, would it be possible for you to dynamically fetch a list of the customer's inboxes using the list inboxes endpoint, then have them check to select any inboxes they want to monitor. Doing this will allow you to collect a list of inbox IDs up-front for that customer, so when you receive a payload, you can immediately see if the inbox ID is in your list of monitored inboxes or not. 

 

--Jason & Molly

Badge +2

Thank you. Both are great suggestions. Indeed, was looking for a place to have Front include the token in the header, nevertheless, this should work, too.  Also, the idea of fetching the inbox list and letting the user choose among them is a good one as clients may want selected inboxes to be monitored.

Reply