Creating a New Bot and a Communications Orchestrator Project
A bot in Corezoid is a separate project, which is created from scratch following a simple procedure:
You can connect Communications Orchestrator to new or earlier created messenger bots.
Step 1. Creating bots in messengers
Communications Orchestrator accesses bots in the messengers using HTTP API with token identification. This section discusses the procedures of obtaining access tokens for each supported messenger. If you want to connect an existing bot to Communications Orchestrator, you can go to the next phase.
A token is a key for accessing your bot. Anyone who possesses this key can control your bot.
- Begin a chat with BotFather and click the Start button.
- Send the
/newbotcommand to BotFather to create a new bot.
- Follow the BotFather’s instructions:
- Give your bot name.
- Give your bot username to be displayed in contacts, chats, and address. A username must have the bot ending, for example, TetrisBot or tetris_bot. A name and username of a bot must be unique in Telegram.
- Save the access token to your bot.
- Log in to partners.viber.com with your Viber account.
- Click Create Bot Account.
- Fill in the bot creation form.
- Save the access token to your bot.
Log in to your Facebook account.
As each Facebook bot must be connected to a Facebook page, create a new page your bot will be connected following these instructions.
Go to Facebook for Developers. If you are new here, you need to register as a developer.
Point to My Apps and then click Create New App.
In the Create a New App ID dialog box appeared, fill in all the fields and then click Create App ID. Your new application is created.
Click the icon of the creating app. You should land on the app’s setup page.
Go to the Dashboard category on the left side menu of the setup page.
In the Add a Product panel, find Messenger and click the Set Up button below it. The Messenger entry appears under Products on the left side menu, and you will be at the Messenger Platform settings page.
- Go to the Access Tokens section, where select the necessary page in the Page drop-down list, and then click Edit Permissions. This should be the page you created at step two.
- In the new browser dialog box appeared, click Continue as Your Profile Name to confirm assigning your bot to your Facebook account.
- Then, set the check box for the page your bot will be attached and click Next. This should be the page you created at step two.
- Set the toggle for your page to YES to allow your bot to participate in the P2P chats in the messenger at this page and then click Done.
- Click Ok.
- In Page Access Token field, the access token appears.
- Save this token.
Step 2. Connecting Bots to Communications Orchestrator in Corezoid
Use the following procedure to create Communications Orchestrator:
Go to Corezoid admin panel.
In the Corezoid main menu, open the Workspace tab and go to your projects in the Projects folder.
Create a new Project or open an existing project in the Stages section. Navigate to the stage where you want to create a new folder with Communications Orchestrator functionality.
To create a Communications Orchestrator project, choose a non-immutable stage.
- Click the Create button and choose Orchestrator from the dropdown menu.
- In the Communications Orchestrator creation menu, select the messengers you want to integrate using checkboxes (1). Paste the access token you copied when creating the corresponding bot into the corresponding field (2) and click Next (3).
If the connecting process didn’t succeed, check each token to be valid.
If you connect Facebook Messenger, you also need to subscribe to Facebook Messenger Webhooks at the Facebook admin panel. The procedure of subscribing to Facebook Messenger Webhook is given below.
After that, click Open the created Bot in the creation dialog to open the Communications Orchestrator folder. Working with this folder is described in details in Communications Orchestrator Components.
To subscribe to Facebook Webhook manually (for other messengers it’s done automatically), take the following steps
- Go to your Facebook app’s page at Facebook for Developers.
- Copy the access token, which is discussed at steps 12-13 of the creating a new Facebook Messenger bot procedure.
- In the left side menu, go to the Messenger > Settings section and click Subscribe to Events.
- Paste the copied token in the Verify Token field of the New Page Subscription dialog box appeared.
- Go to the Communications Orchestrator dialog box of Corezoid and click Copy under Webhook URL for Facebook Messenger.
Go to the New Page Subscription dialog box of Facebook, and past the copied Webhook URL in the Callback URL field.
Select the check boxes of events, the Corezoid process should receive. It is recommended to select:
- Click Verify and Save. The dialog box should disappear. Also, the selected events and the Select a Page drop-down list should appear in the Webhooks panel.
- In this drop-down list, select the page, at the events of which your page will be subscribed. There should appear the Subscribe button.
- Click Subscribe.
🎊 Congratulations! You’ve created your first Communications Orchestrator.