Creating a New Bot via Communications Orchestrator
  • 28 Jul 2022
  • 7 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Creating a New Bot via Communications Orchestrator

  • Dark
    Light
  • PDF

Article Summary

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.

The token storage and access to it must comply with security requirements for sensitive data.

Telegram

  1. Begin a chat with BotFather and click the Start button.
  2. Send the /newbot command to BotFather to create a new bot.
  3. 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.
  4. Save the access token to your bot.

Viber

  1. Log in to partners.viber.com with your Viber account.
  2. Click Create Bot Account.
  3. Fill in the bot creation form.
  4. Save the access token to your bot.

Facebook Messenger

  1. Log in to your Facebook accont.

  2. As each Facebook bot must be connected to a Facebook page, create a new page your bot will be connected following these instructions.

  3. Go to Facebook for Developers. If you are new here, you need to register as a developer.

  4. Point to My Apps and then click Create New App.

  5. 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.

create-a-new-app-id

  1. Click the icon of the creating app. You should land on the app’s setup page.
    facebook-app-name

  2. Go to the Dashboard category on the left side menu of the setup page.

  3. 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.

facebook-add-a-product

  1. 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.

facebook-page-access-tokens-start

  1. In the new browser dialog box appeared, click Continue as Your Profile Name to confirm assigning your bot to your Facebook account.

facebook-continue-as

  1. 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.

facebook-page-access

  1. 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.

facebook-allow-conversations

  1. Click Ok.

facebook-ok

  1. In Page Access Token field, the access token appears.

facebook-access-tokens-end

  1. Save this token.

Step 2. Creating a New Company in Sender

Along with communication automation, Communications Orchestrator 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 kind of app . This section covers the web one.

For signing up, you need to provide a cell phone number, where your Sender account and the first company will be registered.

To sign up with a mobile app, follow the procedure:

  1. Install the app at your device:
  2. Allow the access rights the app asks for.
  3. Provide the phone number for registration.

To sign up with a web app, follow the procedure:

  1. Go to the Sender web app apge.

sender-login-window

  1. Type the phone number for registration and click CONTINUE.

sender-otp

  1. Type the activation code received by SMS and click CONTINUE.

When signed up successfully, you are at the web app main page.

sender-chat

At signing up for Sender, a new Company is created and registered with 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:

  1. Created your Sender account.
  2. Went to the administrator page.

sender-admin

Your Sender Company is attached to your Corezoid account automatically during its creation if you registered it with 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 with a phone number.

To create a new Sender Company with automatic attaching it to Corezoid, follow the procedure:

  1. In the left side menu, go to the Companies > Create section.

sender-create-new-company

  1. Fill in the required fields Name and Phone.

  2. In the E-mail field, enter the email address your Corezoid account is registered at.

  3. If it is necessary, fill in other fields.

  4. Click Create. A new Company is created, which is also synchronized with Corezoid.

sender-edit-company

If for any reason you cannot provide a Sender Company with the email address used in your Corezoid account, you can try to attach such a Company to Corezoid using robots:
  1. In the left side menu, go to the Robots > Robots section.

sender-robots-empty

  1. Click Create. The New robot panel appears.

sender-create-new-robot

  1. Fill in the required Name field.
  2. Click Create. The new robot is created in the Sender company, and this Company is also synchronized with Corezoid.

sender-robots

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.

sender-manage-operators

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:

  1. Ensure the colleague is signed up for Sender; otherwise, you will not be able to add this person.

  2. Click ADD USER. The Invite user panel appears.

sender-add-new-user

  1. Enter your teammate’s phone number in the Phone field.

  2. Specify your teammate’s role at the Company in the Role field.

  3. Click INVITE. The teammate will receive invitation message in Sender.

  4. 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 a Bot to Communications Orchestrator in Corezoid

Use the following procedure to create Communications Orchestrator:

  1. Go to Corezoid admin panel.

  2. At the left top corner, click the Company drop-down list and select the created earlier Sender Company in it.

corezoid create selected company.png

  1. Click Create and then click Communications Orchestrator in the drop-down list.

create -orchestrator.png

  1. In the Communications Orchestrator dialog box, select check boxes for the messengers to be connected and enter a token for each selected messenger.

create orchestrator-next.png

  1. Click Next. The process of connecting messengers started - please, wait for notification about the successful completion of this process.

open created bot.png

  1. If the connecting process didn’t succeed, check each token to be valid.

  2. 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.

  3. Click Open the created Bot. You are in the Communications Orchestrator folder. This folder is discussed in details in section Components of Communications Orchestrator.

Comm Orchestrator 2.png

To subscribe to Facebook Webhook manually (for other messengers it’s done automatically), use the following procedure:

  1. Go to your Facebook app’s page at Facebook for Developers.
  2. Copy the access token, which is discussed at steps 12-13 of the creating a new Facebook Messenger bot procedure.
  3. In the left side menu, go to the Messenger > Settings section and click Subscribe to Events.

facebook-subscribe-to-events

  1. Paste the copied token in the Verify Token field of the New Page Subscription dialog box appeared.

facebook-new-page-subscription

  1. Go to the Communications Orchestrator dialog box of Corezoid and click Copy under Webhook URL for Facebook Messenger.

facebook-copy-webhook

  1. Go to the New Page Subscription dialog box of Facebook, and past the copied Webhook URL in the Callback URL field.

  2. Select the check boxes of events, the Corezoid process should receive. It is recommended to select: messages, messaging_postbacks and messaging_optins.

facebook-webhooks

  1. 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.

facebook-webhooks-select-page

  1. In this drop-down list, select the page, at the events of which your page will be subscribed. There should appear the Subscribe button.

facebook-webhooks-subscribe

  1. Click Subscribe.

facebook-webhook-connected

🎊 Congratulations! You’ve created your first Communications Orchestrator.