Creating a New Bot via Bot Platform 2.0
A bot in Corezoid is a separate project, which is created from scratch following a simple procedure:
You can connect Bot Platform with new or earlier created messenger bots.
Step 1. Creating bots in messengers
Bot Platform 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 Bot Platform, 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.
The token storage and access to it must comply with security requirements for sensitive data.
- 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 accont.
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 pane, 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.
In Page Access Token field, the access token appears.
Save this token.
Step 2. Creating a New Company in Sender
Along with communication automation, Bot Platform features an ability to involve an operator in a conversation for providing client support if it is necessary. The operator’s workplace is organized using the Sender messenger.
When creating a new bot project, you need to select an existing Sender Company or create a new one.
This section discusses how to sign up for Sender and to create the new Company there. If you want to connect the existing company you can go to the next section.
There are mobile (Android, iOS) and web Sender client applications. You can sign up and work as an operator with any app kind. This section covers the web one.
For signing up, you need to provide a cell phone number, at which your Sender account and the first company will be registered.
To sign up with a mobile app, use this procedure:
Install the app at your device:
Allow the access rights the app asks for.
- Provide the phone number for registration.
To sign up with a web app, use this procedure:
Go to the Sender web app apge.
Type the phone number for registration and click CONTINUE.
Type the activation code received by SMS and click CONTINUE.
When signed up successfully, you are at the web app main page.
At signing up for Sender, a new Company is created and registered at the phone number given for registration. For working with a bot project, you need to create another new Company.
All further procedures in this section assume that you:
- Created your Sender account.
Went to the administrator page.
Your Sender Company is attached to your Corezoid account automatically during its creation if you registered it at the same email address as provided at your Corezoid account. The default Company created during signing up for Sender is not automatically attached to Corezoid because it is registered at a phone number.
To create a new Sender Company with automatic attaching it to Corezoid, use this procedure:
In the left side menu, go to the Companies > Create section.
Fill in the required fields Name and Phone.
In the E-mail field, enter the email address your Corezoid account is registered at.
If it is necessary, fill in other fields.
Click Create. A new Company is created, which is also synchronized with Corezoid.
If of any reason you cannot provide for a Sender Company the email address used at your Corezoid account, you can try to attach such a Company to Corezoid using robots:
In the left side menu, go to the Robots > Robots section.
Click Create. The New robot pane appears.
Fill in the required Name field.
Click Create. The new robot is created in the Sender company, and this Company is also synchronized with Corezoid.
Sender is the workspace of operators. The user created a new Sender Company is the only Operator there having the Owner Role. For adding new Operators, go to Operators > Manage.
You can use Roles to delimitate access within your colleagues in the scope of one Sender Company.
To do so, you need to add a colleague as an Operator and to set the necessary Role for this person:
Ensure the colleague is signed up for Sender; otherwise, you will not be able to add this person.
Click ADD USER. The Invite user pane appears.
Enter your teammate’s phone number in the Phone field.
Specify your teammate’s role at the Company in the Role field.
Click INVITE. The teammate will receive invitation message in Sender.
The teammate must confirm your invitation. After confirmation, this person appears in the Operators grid in the Operators > Manage section.
You can find more information about Sender in its documentation.
Step 3. Connecting Bot to Bot Platform at Corezoid
Use the following procedure to create Bot Platform:
Go to Corezoid admin panel.
At the left top corner, click the Company drop-down list and select the created earlier Sender Company in it.
Click Create and then click Bot Platform in the drop-down list.
In the Bot Platform dialog box, select check boxes for the messengers to be connected and enter a token for each selected.
Ensure the Bot Platform 2.0 version is selected.
Click Next. The process of connecting messengers started - please, wait for notification about the successful completion of this process.
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 discussed below in this section.
Click Open created Bot. You are in the Bot Platform folder. This folder is discussed in details in section Bot Platform 2.0 Components Overview.
To subscribe to Facebook Webhook manually (for other messengers it’s done automatically), use the following procedure:
- 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 Bot Platform 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 pane.
In this drop-down list, select the page, at the events of which your page will be subscribed. There should appear the Subscribe button.
🎊 Congratulations! You’ve created your first Bot Platform.
Open the created bot at the messenger and follow to the next section: Built-in features of Bot Platform 2.0