Skip to main content
Skip table of contents

Instagram DM Routings

Set up chat routings from your Instagram Business Account.

For instructions on how to authorise your Instagram account for Daktela, see Authorise your Instagram Business Account below.


Inbound Routings/Connectors

Inbound Routings/Connectors

Go to Manage → Routings → Instagram DM → Inbound routings/connectors. You will see an overview of your inbound routings/connectors.

You can view a diagram tree of each inbound routing/connector by clicking the grey tree button in the Actions column.

Click the Title of an inbound routing/connector to open its details or click Add new to create a new inbound routing/connector. The inbound routing/connector details will open.

Access token: this field will be filled in automatically after you save the routing/connector.

Title: enter a title.

Description: enter a description.

Next destination: select where the chat should be routed.

You can select:

  1. Terminate. The chat will end or be offline – select which Terminate option to use.

  2. Queue. Select which queue the chat will be routed to.

  3. Time condition. Decide where the chat will be routed depending on the date/time.

  4. Decision tree. Route the chat to a chat bot.

Allow attachments: choose whether to allow uploads from customer or both directions.

Authorise Your Instagram Business Account

Authorise Your Instagram Business Account

To use Instagram DMs in Daktela, you need an Instagram Business Account connected to a Facebook Page.

Follow the steps below to set up and connect your account:

Creator accounts don’t work with Daktela.

  • Connect your Instagram Business account with your Facebook page.

  • Allow your Facebook page access to messages:

    • In the Instagram App, tap your Instagram Business Account profile picture in the bottom right corner.

    • Tap the hamburger menu in the top right corner.

    • Go to SettingsPrivacy → Messages.

    • Under Connected tools, turn on Allow access to messages.

Now that your account is ready an linked, set up the Connector in Daktela. You will need to authorise the Facebook page that you have previously connected with your Instagram Business account.

Follow the steps below authorise the Facebook page in Daktela:

If you are setting up a new Connector, first fill out Title, Description, Next destination and Allow file uploads. Save the Connector and reopen it to authorise it on Facebook.

Click the Authorise IG direct page button at the bottom of the Connector details. The Authorise Daktela to access Facebook page window will open.

Click Continue with Facebook and log in or click Continue as if you are already logged in.

If this is the first page you are authorising using this FB user (1), click Continue as. If you have previously authorised a page using this FB user (2) and want to add a new page, click Edit settings.

(1) First-time authorisation

(2) Previous authorisation

Select your Instagram Business account and click Next.

Select the Facebook page that is connected to your Instagram Business account and click Next.

Grant Daktela permissions. We recommend to leave all permissions on. Click Done.

When you return to the Authorise Daktela to access Facebook page, select the Facebook page that is connected to your Instagram Business account by clicking the use page button. You will see all the pages you have selected above but will only be able to select those that have not yet been linked to another connector.

Daktela is now set up to receive your Instagram DMs.


Automessages

Automessages

Route your web chat to automessages if you want to send customers messages.

To set up automatic messages, go to Manage → Routings → Instagram DM→ Automessages. You will see an overview of your automessages.

You can view a diagram tree of each automessage by clicking the grey tree button in the Actions column.

Click the Title of an automessage to open its details or click Add new to create a new automessage. The automessage details will open.

When you are done creating or editing an automesaage, click Save to return to the automessage overview and make sure to click the Apply configuration changes button in the top right corner.

It will take a few minutes for the changes to take effect on your website. If you want to see them immediately, open your website in a new incognito mode window.

Sandbox

Set up your automessages in this column. If you are editing an automessage, you can compare your new settings to those currently in use in the Production column.

All fields are mandatory except Description and Text.

Fill out the Title and Description.

Next destination: select where the web chat should be routed next.

You can select:

  1. Another automessage.

  2. Terminate. The chat will end or be offline – select which Terminate option to use.

  3. Queue. Select which queue the web chat will be routed to.

  4. Time condition. Decide where the chat will be routed depending on the date/time.

  5. Decision tree. Route the chat to a chat bot.

Message

Time: select the delay between when the chat is routed to the automessage and when the message is sent. The timer starts as soon as the chat is routed here – take this into account when setting up multiple messages (Time is not the interval between messages).

Text: enter your message.

Time Conditions

Time Conditions

To set up your business hours and bank holidays, go to Manage → Routings → Instagram DM → Time conditions. You will see an overview of your time conditions.

You can view a diagram tree of each time condition by clicking the grey tree button in the Actions column.

Click the Title of a time condition to open its details or click Add new to create a new time condition. The time condition details will open.

When you are done creating or editing a time condition, click Save to return to the time conditions overview and make sure to click the Apply configuration changes button in the top right corner.

Sandbox

Set up your time conditions in this column. If you are editing a time condition, you can compare your new settings to those currently in use in the Production column.

All fields are mandatory except Description.

Title: enter your time condition title. Select the title in Inbound routings/connectors to use the time condition in the routing/connector.

Description: enter a description.

Time group: select the Time group you would like to use from the drop down menu. You need to have at least one Time group set up to use Time conditions. You can also use the blue drop down menu to view or edit the selected time group or to create a new one – this will open Manage → Settings → Time groups.

If it is open select what to do if the current day and time matches that of the time group.

You can select:

  1. Terminate. The chat will end or be offline – select which Terminate option to use.

  2. Queue. Select which queue the chat will be routed to.

  3. Another time condition (we recommend to set up your time groups in a way that you don't need to route from a time condition to another one).

  4. Decision tree. Route the chat to a chat bot.

If it is closed: select what to do if the current day and time does NOT match that of the time group. The options are the same as above.


Decision Trees

Decision Trees

Use decision trees to set up your Messenger chatbot.

Go to Manage → Routings → Instagram DM → Decision trees. You will see an overview of your Decision trees.

You can view a diagram tree of each decision tree by clicking the grey tree button in the Actions column.

Click the Title of a decision tree to open its details or click Add new to create a new decision tree. The decision tree editor will open.

When you are done creating or editing a decision tree, click Save to return to the decision tree overview and make sure to click the Apply configuration changes button in the top right corner.

The decision tree editor will display a diagram of individual decisions. When creating a new decision tree, you will only see the first step, "Welcome message". Click a decision to select it, then click the edit button on the right hand side:


The decision details will open.

Fill out the decision Title and Description (optional) in the header, then set up your decision. We recommend reading through the templating language documentation.

Actions

Request: request data from a URL. Fill out the URL address where your data is stored and name the object that will contain the returned data so you can display it in the chat.

Send message: send a message in the web chat. Enter a default message and any language variations – the customer's language will be detected automatically.

Save data: store own data for later usage.

Create ticket: enter the ticket's Title, select a Category and enter a Comment.

Groups

Condition: set up conditional actions. First set up your condition parameters, click Done and then drag and drop actions into the fields in the condition.

Loop: walk through array items. If you use action Target, loop ends.

Targets

Target

  1. Next destination: select if the target is another decision in the tree (Decision) or a final target such as a queue or a time condition (App).

    If you have selected:

    • Decision – choose a target decision from the drop down list or click the blue plus button to add a new decision. Type the new decision name. You can edit the new target decision in the diagram once you save the current one and return to the decision tree editor.

    • App – select the target type (Automessages, Terminate, Decision tree, Queue, weertggij) and the target.

  2. Execution: select whether to go to the target as soon as the customer reaches the decision (Immediately) or whether action from the customer's side is necessary (When client choses it).

    If you have selected When client choses it, select your Answer type:

    • Pattern: the customer can type their answer. Enter a pattern in backslashes that the customer's answer must fit to trigger this action. E.g. /[0-9]{6}/ will fit if the customer enters at least a six digit number. See Regular expression syntax for more info.

    • Similar: the customer can type their answer. Enter a list of words that will trigger this action separated by commas.

You can set up language variants in all combinations except Decision-Immediately and Decision-When client chooses it-Generated buttons.

Add another target to set up different targets depending on the customer's answer.

If you use Similar or Pattern as an answer in your decision, a "Default answer" radio button will appear next to each answer. Select the answer that should be triggered when the customer's answer does not fit any of the patterns or words.


Chatbots

Chatbots

Set up a connection to a third-party chatbot.

Go to Manage → Routings → Instagram DM → Chatbots. You will see an overview of your chatbots.

Click the Title of a chatbot to open its details or click Add new to create a new one. The chatbot details will open.

When you are done creating or editing a chatbot, click Save to return to the chatbot overview and make sure to click the Apply configuration changes button in the top right corner.

It will take a few minutes for the changes to take effect on your website. If you want to see them immediately, open your website in a new incognito mode window.

Set up your chatbot set up in the Sandbox column. If you are editing a chatbot, you can compare your new settings to those currently in use in the Production column.

Title: enter a title.

Description : enter a description.

Fallback: select where the chat should be routed if the Callback URL is not available.

Callback URL: enter the endpoint where data from the chatbot should be sent. Filled in automatically – you do not need to change it.

Chatbot URL: enter the URL of your chatbot.

Send start message: forward the client initialisation message (if it exists) as part of the first chatbot request.

Send attachments: send the structure of any attachments the client sends.

Send customFields: select the custom input fields that should be sent to the chatbot.

Structure of Data Sent to the Chatbot

Structure of Data Sent to the Chatbot

  • message = message object

  • interaction = interaction object

  • ? = if empty, null is sent


'?name' => '{{message.name}}',
'?time' => '{{message.time_created}}',
'?direction' => '{{message.direction}}',
'conversation.name' => '{{interaction.name}}',
'conversation.title' => '{{interaction.title}}',
'conversation.time' => '{{interaction.time}}',
'conversation.response_url' => '{{config.callback}}?hash={{interactionHash}}',
'text' => '{{text}}',
'attachments' => object array, each object contains: 'title', 'type', 'size', 'link'

Example 1:


//request data - text message and list of attachments
POST chatbotURL
{
"name": "messages_62fe1518a9820077126134",
"time": "2022-08-18 12:31:52",
"direction": "IN",
"conversation": {
"name": "web_62fe14acd567e380992326",
"title": "",
"time": "2022-08-18 12:30:04",
"response_url": "https://XXX.daktela.com/external/web/api/chatbotUpdate?hash=b9f68fa377263e8f3018a405f25f44add10fab4c",
"customFields": [
{
"name": "number",
"title": "Number we want to know",
"value": "22"
},{
"name": "...",
"title": "....",
"value": "...."
},
]
},
"text": "xxx",
"attachments": [
{
"link": "https://xxx.daktela.com/external/web/chat_file.php?accessToken=on87q29oq60q02nqo6nr3oo7s5r7r607&chat=web_62fe14acd567e380992326&mapper=chatsMessage&name=29",
"title": "Name of screenshot.png",
"type": "image/png",
"size": "122221"
},
{
"link": "...",
"type": "....",
"size": "...."
}
],
"referer": "https://xxx.com/demo/chat.html"
}


Example 2:

//request data example - pressed quick reply button
POST chatbotURL
{
"name": "messages_62fe1518a9820077126134",
"time": "2022-08-18 12:31:52",
"direction": "IN",
"conversation": {
"name": "web_62fe14acd567e380992326",
"title": "",
"time": "2022-08-18 12:30:04",
"response_url": "https://XXX.daktela.com/external/web/api/chatbotUpdate?hash=b9f68fa377263e8f3018a405f25f44add10fab4c",
"customFields": []
},
"quickreply":
{
"name": "quickReplyName1",
},
"referer": "https://xxx.com/demo/chat.html"
}

Expected Structure of Received Data

Expected Structure of Received Data

'conversation.name' – interaction name
'hash' – identifies into which conversation the incoming message belongs
'text' – incoming message
'transfer' – name of queue where the conversation should be transferred


Example:


//response example
POST https://XXX.daktela.com/external/web/api/chatbotUpdate
{
"conversation": {
"name": "web_62fe14acd567e380992326"
},
"text": "textMessage",
"button": [
{
"text": "xxx.com",
"url": "https://xxx.com/api/"
},
{
"text": "...",
"url": "...."
}
],
"quickreply": [
{
"name": "quickReplyName1",
"text": "Quick reply Name 1"
},
{
"name": "...."
"text": "...."
}
],
"queue": "10001",
"hash": "b9f68fa377263e8f3018a405f25f44add10fab4c",
}


Terminate

Terminate

Set up how your chats will end in different scenarios.

Go to Manage → Routings → Instagram DM → Terminate. You will see an overview of your terminate set ups.

You can view a diagram tree of each terminate set up by clicking the grey tree button in the Actions column.

Click the Title of a terminate set up to open its details or click Add new to create a terminate set up. The terminate details will open.

When you are done creating or editing a terminate set up, click Save to return to the terminate overview and make sure to click the Apply configuration changes button in the top right corner.

Set up your terminate set up in the Sandbox column. If you are editing a terminate set up, you can compare your new settings to those currently in use in the Production column.

Title: enter a title.

Description : enter a description.

Disconnection cause: select from the dropdown list. This is for internal use only – the customer will not see this info.

Queue: select which queue the chat will belong to if it is terminated using this set up.

If you want to receive missed chat notifications, you must select a queue.

Auto response: select a template to send to the customer if the chat is terminated using this set up.

Answered: toggle whether a chat terminated using this set up is logged as answered.




JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.