Creating a New Bot and a Communications Orchestrator Project
  • 05 Mar 2024
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Creating a New Bot and a Communications Orchestrator Project

  • 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. Follow the contact form link to submit your application for a Viber bot registration. Our Support team will guide you through the procedure and provide all the necessary information.

Facebook Messenger

  1. Log in to your Facebook account.

  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. Connecting Bots to Communications Orchestrator in Corezoid

Use the following procedure to create Communications Orchestrator:

  1. Go to Corezoid admin panel.

  2. In the Corezoid main menu, open the Workspace tab and go to your projects in the Projects folder.

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

  1. Click the Create button and choose Orchestrator from the dropdown menu.

create-orchestrator.png

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

bots selection.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 given below.

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

comms orch folder.png

To subscribe to Facebook Webhook manually (for other messengers it’s done automatically), take the following steps

  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.


Was this article helpful?