Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Marketplace

TaskRouter supports Marketplace Add-ons, an easy way to make routing decisions based on third party data. You can access the Add-on data from within workflow expressions to make routing decisions based on demographic, location, or other information derived from a customer. After you install the desired Add-on and enable TaskRouter access, TaskRouter will automatically include the Add-on data whenever a new Task is created.

Suppose you are a real-estate agent, and you have an inbound phone number for each of the properties you’ve listed for sale. A customer calls the number, goes through the IVR, and is about to be routed to an agent for further qualification. With Add-on support, it is easy to prioritize these calls based on the data returned by the Advanced Caller ID by Next Caller Add-on. For example, you can give higher priority to high net worth callers that are currently renting, second priority to callers that are high net worth but not renting, and low priority for all other callers. Click here to see an example of data returned by Advanced Caller ID by Next Caller Add-on.

Let’s walk through how you can do that with TaskRouter using Marketplace integration:

First, go to the marketplace and install the Advanced Caller ID by Next Caller Add-on.

TR-Add-On-img-1

TR-Add-On-img-2

Once the Add-on is installed, you’ll see the following options,

TR-Add-On-img-3

Enable the Creating TaskRouter Tasks option and save. The Add-on is now ready to be used by TaskRouter whenever a new Task is created.

Go to TaskRouter and create a workflow that looks like the following,

{
  "task_routing": {
    "filters": [
      {
        "targets": [
          {
            "queue": "WQ37bdc895ddf52018980f530f119d793b",
            "expression": "1=1",
            "priority": "100"
          }
        ],
        "filter_friendly_name": "High Networth and Renting",
        "expression": "addons.nextcaller_advanced_caller_id.records[0].high_net_worth == \"Yes\" AND addons.nextcaller_advanced_caller_id.records[0].home_owner_status == \"Rent\""
      },
      {
        "targets": [
          {
            "queue": "WQ37bdc895ddf52018980f530f119d793b",
            "priority": "50"
          }
        ],
        "filter_friendly_name": "High Networth",
        "expression": "addons.nextcaller_advanced_caller_id.records[0].high_net_worth == \"Yes\""
      },
      {
        "targets": [
          {
            "queue": "WQ37bdc895ddf52018980f530f119d793b",
            "priority": "0"
          }
        ],
        "filter_friendly_name": "All other Calls",
        "expression": "1=1"
      }
    ]
  }
}

Whenever a Task is created, TaskRouter will get additional information from the installed Add-ons and make it available via addons.<addon_name\>. In this case the addon_name we’ve used when installing the Add-on was nextcaller_advanced_caller_id.

When you are ready to route the inbound call to an agent, use the following TwiML to queue the call and create a Task,

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Enqueue workflowSid="WWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
        <Task>{}</Task>
    </Enqueue>
</Response>

When the above TwiML is executed, TaskRouter will receive a request to create the Task along with call information. It will automatically retrieve data from the Advanced Caller ID by Next Caller Add-on and make it available via the task.addons attribute in the workflow.

Note: TaskRouter will retrieve data for installed Add-ons for any task created through the use of <Enqueue\>, as well as any task where the Task has a from attribute set to an E1.64 formatted phone number.

This is just one example of what you can do with the TaskRouter marketplace integration. If you have any further questions or have a request for specific Add-on's to use with TaskRouter, please contact support.

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

Loading Code Sample...