Route messages

Apple Messages that you receive from your customers can be routed to specific agents or teams using Flows.

To do this, you'll need to know how to get the biz-intent-id and biz-group-id from the message.

Not sure what biz-intent-id and biz-group-id are, or how to set them up? Learn about URL entry points first.

Extract biz-intent-id and biz-group-id from a message

Follow these steps to learn how to find and pass on the biz-intent-id and biz-group-id from an Apple Messages message in Flows.

What you'll need

To set this up for Apple Messages that are sent to you without using a URL entry point, follow these steps.

Set up your flow

  1. Go to Flows and set up a new flow. In this example, we'll use the Conversation started trigger.

  2. For the 'Channel', select Apple Messages for Business, then select the specific channel instance you want to use.

  3. For the 'Trigger event', select Conversation started.

  4. For the 'Participant type', select Contact.

  5. Click Save.

  6. Click Add new action.

  7. Under 'Select an action', go to MessageBird API > Conversations > Get Message.

  8. In the 'Message ID' field, search for lastMessageId from the 'Trigger'.

  9. Test the step.

Extract IDs from the test

The test will display data from the most recent message that has been sent to the Apple Messages for Business channel. As long as the most recent message has been sent from a URL entry point with biz-intent-id and biz-group-id, then this information will also be present in the test's Output.

Let's take a look at how we can find these IDs.

Here's an example output:

{
  "requestId": "0d87bfa9-0d83-4835-b5c8-8bf7a0936607",
  "result": {
    "body": {
      "text": {
        "text": "Start a return"
      },
      "type": "text"
    }
  },
  "conversationId": "d21340ea-9fac-46e4-aa6b-2f3fbfb65fd",
  "createdAt": "2023-12-15T18:20:43.712",
  "draft": false,
  "id": "e4d7026b-30f5-4f63-be4f-dcf9e1f1e0a",
  "interactions": null,
  "meta": {
    "referral": {
      "group": "returns_department",
      "metadata": {
        "sourceId": "question"
      },
      "source": "intent"
    }
  }
}

biz-intent-id

First, let's find the biz-intent-id.

In the test output, it's located at meta.referral.metadata.sourceid.

"meta": {
    "referral": {
      "group": "returns_department",
      "metadata": {
        "sourceId": "question"

So in this example, the biz-intent-id is "question".

biz-group-id

Now, let's find the biz-group-id.

In the test output, it's located at meta.referral.group.

"meta": {
    "referral": {
      "group": "returns_department",
      "metadata": {
        "sourceId": "question"

So in this example, the biz-intent-id is "returns_department".

Extract IDs without a URL entry point

If the message from the customer has come through a source other than a URL entry point, you will need to do one of the following

  • Assign the values to variables that are then modified as strings (to avoid null comparisons).

  • In your conditional, add 'IF' sourceid = present 'AND' group = present 'AND' sourceid = your value 'AND' groupid = your value.

Next steps

Now that you've found this data, you can use it to set up conditional routing.

Last updated