Integration

Integration

Bots, created on BRN platform, can be integrated into many Internet services: Facebook Messenger, Skype, Telegram, Kik, Slack, Line, WeChat, Viber and Twitter. Also you can create a widget with this bot and integrate it into your site.

To create a connection of your bot to one of Internet services you have to go to Setting section of your bot page and choose Connections at the left navigation.

Icons at this field mean:

  1. Messenger
  2. Telegram
  3. Widget
  4. Kik
  5. Slack
  6. Line
  7. Skype
  8. WeChat
  9. Viber
  10. Twitter

Integrating bots into Internet services has two parts:

  1. Creating of bot account on service, following service rules
  2. Integrated bot into account, setting data from account to our bot page and vise versa.

If you have just connected your bot to some of these services, icon of these services will be activated, other icons – deactivated. But you can to change every existing connections, clicking on activated icons, or add new connection, clicking on deactivated one.

If you will connect bot to some services, these connections will be shown at main section of your bot page at field Platforms below bot name and image, for example, like this:

If you click on icon of certain service, you will be able to speak with bot through this service (if you are registered in it).

Widget

  1. Click on widget icon at Connections section at bot Settings page


2. You will see form with three fields:
– Greetings text: text, written at widget window before user will talk with bot, for example: “Hello! I’d like to see you!”
– Sec delay – delay in seconds before bot’s answer, if you don’t want delay, set 0
– Dropdown with two values: left or right, one of which you have to select to set location of widget, for example: right.
3. After filling form you need to click button Save.
4. To see widget – go to main page of you bot (with bot name) and click widget icon at Platforms field (below bot name and image).

You will see page like this, with bot name, image and description (if you set it). Then you can click widget at the lesft link and talk with bot. You can test widget, writing something to bot, and then integrate this widget to your webpage.

Warning! If you use in bot buttons with different title and content, on button will be written title text, but if user click it, in his reply content text will be shown. Bot also will save content text in its variable.

Facebook Messenger

The most useful service for our bots is Facebook Messenger, because it supports showing cards, which are often used in our bot for showing information at our collections, shop and other.

We also support some additional features of Messenger, such as persistent menu and vertical list of cards.

To connect your bot to Facebook Messenger, you have to do next:

  1. Create account on Facebook
  2. Create Page, using dropdown at right sight of top navigation
  3. At shown page select type and category of your page. At field below type name for your page, which must correspond with name of your bot and click button Get started.
  4. Add a picture to your page, it may be the same as image of your bot. That’s all with Facebook.
  5. Go to the Settings page of your bot and click Messenger icon. Than, if you enter with your Facebook account, you will see window like this:

At the top of window you can see your pages, if there are more than one pages, you must select one of them. Then you must fill next settings:

  • Starting keyword – word, which is sending to bot, which user begins to talk with it first time. This must be keyword of scenario, which you want to run first. As default, if you leave empty field, it will be “start”. If you want, you can set other keyword or disable sending keywords, deactivating checkbox “Enable”.
  • Greeting text – text, that will be written under bot name and avatar in messenger before first user talk with bot.
  • Persistent menu – menu with buttons, which will be shown under dialog in all talks with this bot.

If you want to activate persistent menu – check checkbox Enable menu. Menu consists of buttons. You are able to create some levels of submenu – up to 3 levels. Each level may contain up to 5 buttons of different types.

If you want to create button for your menu – click Add button. Then you must enter button title – it will be written on button at menu and choose type of buttons. There are three different buttons types:

  • Nested – if user click on it, he will go to next level of submenu. If you create nested button, you will see two buttons Add button. If you click on button located under dropdown, from which you select Nested, you will create button of submenu, which will be opened on click of your previous button. If you click on Add button, located below, at section Buttons, you will create button at the same level, as your previous button.
  • Web_url – if user click on it, he will go to other Internet page. At field Url you must enter url of page, that you want to show.
  • Postback – if user click on it, bot will receive message from him, and will be able to work with this message using scenarios. Message may contain, for example, scenario keyword, and scenario, keyword of which user sended, will run. At field Postback you must enter a message, that will be sent to bot. Postback may be the same as title, but may be different.

If you create persistent menu, you may set special mode of bot operation, checking Disable User input. If bot works at this mode, user can’t send to it his own messages, and can talk with bot only using persistent menu.

After choosing Facebook page, that will be connected to bot, and setting all features, that you need, click button Save. Now connection is activated and you may go to main bot page (with bot name) and click on Messenger icon at section Platforms. Messenger will be opened, and you will be able to talk with your bot using it.

Skype

If you want to integrate your bot into Skype, go to the Settings page and click on Skype icon at the Connections section. You will see next window:

Then you must create new bot on dev.botframework.com/. Keep form at brn.ai open and go to dev.botframework.com/ in other window.

To create bot on this site, you must do next:

  1. Create Microsoft account and sign in botframework.com, using it.
  2. Click My bots at the main navigation.
  3. Click button Create a bot
  4. At the opened window click button Register in the middle of screen
  5. You will go to the page with bot creation form

At bot profile set avatar, name, handle and description of your bot

At Configuration section:

  1. Click button Create Microsoft App ID and password.
  2. At opened window you will see name of your bot, App ID and blue button Create password.
  3. Copy your App ID to Client ID field at the form on brn.ai and to field Microsoft App ID… at Configuration section of bot creation form at dev.botframework.com/.
  4. Copy url from the third field of form on brn.ai to Messnging endpoint field at Configuration section of bot creation form at dev.botframework.com/.
  5. Click button Create password at your last opened window and cope password to Secret field at form on brn.ai. Then close window with App ID and password.
  6. Click button Register at the bottom of bot creation form at dev.botframework.com/.
  7. Click button Save at the form on brn.ai.

After creating connection you can add bot to your Skype contacts using Skype icon at Platforms section of main page of your bot.

Telegram

If you want to integrate your bot into Telegram, you have to create account in Telegram, search for BotFather, add it to your contacts and send to it message “/start”. In its reply you will see all variants of commands, which you can send to it.

Click on command /newbot. Then tell to BotFather name and username of your bot, and you receive dialog like this:

Then go to Settings page of your bot on brn.ai and click on Telegram icon in Connections section. You will see next form:

At this form enter to field Username username of your bot, which you send to BotFather (that one, which must end in ‘bot’.

At field Token enter token, which you can find at second paragraph of final BotFather reply after phrase “Use this token to access the HTTP API:”.

Then click “Save”.

After this you can click on link of your bot at final BotFather reply and speak with it. Also you can go to main page of your bot at brn.ai and click on Telegram icon.

If you want to edit your bot, for example, set avatar or description, send command /mybots to BotFather, then click button with your bot username, and then click button EditBot.

You will see menu like this, in which choose action, that you want to do:

Kik

If you want to use Kik or to create bot account in it, you have to install it on your mobile device and register in it.

Then you must go to site https://dev.kik.com from your computer and scan image with your Kik mobile app to login at site.

If you login successfully, go to page Configuration at Kik site. Here you can set parameters of your bot. You must necessary enter bot name and generate API Key. Also you can add bot image.

Then not close this page and open in another window your bot page from brn.ai. Here open Settings page and in Connections field click on Kik icon. You will see next form:

At this form enter to field Username bot name from Kik site, and to field API Key – API key, that you generated at Kik site. Then click button Save.

When you will add Kik account to your bot, you can click on Kik Icon at Platforms section at main page of your bot (with bot name). If you do this, you will see instruction, how to talk with this bot using Kik from mobile devices.

Line

If you want to integrate your bot into Line, first of all you have to install Line on your mobile device and sign up.

Then Go to Settings and make Email Account Registration.

Now you can go to Line service from your computer. Go to https://business.line.me and Log in.

After login click on Accounts at main menu and then click button Create Business Account. Then choose Start using Messenger API.

Then set name of your account and choose Business Type – Websites and Blogs – Websites and Blogs (Other). Then click button OK.

Then press button LINE@ Manager, and in Line Manager click button Enable API.

Then go to Settings – Bot settings using left side navigation, fill Request settings and Details like it is shown below and click Save button.

Then at other window of browser in your bot page on brn.ai go to Setting page to Connections section and click Line icon:

Then at Line Manager window go to basic account settings at right navigation and fill them like is shown below:

Bring link at Add Friends field, such as underlined link, copy it to form in brn.ai, leave window with brn.ai opened at go to window with Line Manager, go to Account menu and choose your current account Messaging API Line developers:

At opened Line Developers site go to Channel -> Basic information fill fields as you need and copy and paste to your form at brn.ai Channel ID, Channel Secret and Channel Access Token.

Then press button edit and set Webhook URL, copying it from last field at form on brn.ai. Click button Save at form on brn.ai. Enter Webhook and click button Save at Line developers. Then click button Verify and word Success must be shown.

When you will create line account for your bot, you can go to main section of your bot page at brn.ai (with bot name) and click Line icon at Platforms section there. Link on your bot account at Line will be opened.

Slack

First of all, you must register on site api.slack.com and create your team. Then at start page of site click button Start Building.

You will see form for creation an app:

In this form enter name of your bot, choose your team from dropdown and click button Create app.

Then open in other window your bot page on brn.ai and go to Settings section. Here click on Slack icon at Connections field. You will see next form:

Don’t close this window and go to your window with api.slack.com. On page Basic information find section App Credentials. In it you will find Client ID and Client Secret (to see client secret click button show).

You must copy Client ID and Client Secret to fields Client ID and Secret ID in form on brn.ai.

Then set up permission scopes like it is shown below:

At OAuth & Permissions at left navigation set link from from last field at form on brn.ai to field Redirect URL(s):

Then go to Interactive Messages at left navigation and copy link from last field at form on brn.ai to field Request URL

After that go to Event subscriptions at left navigation, enable events and copy link from last field at form on brn.ai to field Request URL here.

And specify settings at Team Events and Bot Events sections like it is shown at images below:

Twitter

If you want to integrate your bot into Twitter, you must create special Twitter account for your bot and then go to setting page of your bot on brn.ai. If you click on Twitter icon at Connections section, you will see next form:

At this form click Connect Twitter and authorize with your bot’s Twitter account. Now your bot is connected to Twitter, and you can open its Twitter account, if you go to main page of your bot and click twitter icon at Accounts section.

Viber

First of all you have to install viber at your mobile device and register in it. Then open support.viber.com from computer and send request for Access public account.

After confirmation of registration Public account button will appear in viber mobile app.

If this button is shown, you can create public account. More information about creating public account you can read in article at support.viber.com

Then publish your new account clicking button “Publish”

Then go to Settings page of your bot at brn.ai and click Viber icon at the Connections section. You will see next form:

At Viber at your mobile device find App Key and ID, like it is shown below and enter them into fields of form from brn.ai. Then save changes in viber and click button Create. At brn.ai after filling form click Save.

WeChat

If you want to integrate your bot into Wechat, go to admin.wechat.com and create new account here.

Then open in another window settings page of your bot at brn.ai and click Wechat icon at Connections section. You will see next form:

At admin.wechat.com go to page Manage test account:

Copy appID and appsecret from Test account info to form at brn.ai, and copy link from form at brn.ai to field Url at API Config and token – from last field at form on brn.ai to field Token at API Config. Then click button Submit at admin.wechat.com and find bot link and copy it to form on brn.ai and click button Save.