Platform Contributor Guide
[Legacy v3] Platform
[Legacy v3] Platform
  • 👋[Legacy v3] Welcome | README
  • Contributing | Getting Involved
    • Specific tasks needed for COVID19-support
    • Add code to Ushahidi
    • Encouraging contribution from non-developers
  • Frequently Asked Questions
  • Join the Ushahidi community
  • Contributors ✨
  • 🛣️ The Ushahidi Platform Roadmap
    • V2-V3+ Migration tool
  • Privacy and security best practices
    • Security as a user
    • Security for deployment admins
    • Security for deployment hosts
  • Development & Code
    • Development: Overview
    • How to get the source code
    • Setup Guides
      • Installing for production environments
      • Development environment with XAMPP
      • Development environment setup with Vagrant
      • [Client] Setting up the Platform Client for development
        • Migration from AngularJS
      • Setting up the Pattern Library for development
      • [API & Client] Bundled release install
    • Add code to Ushahidi
    • Development process
    • Coding Standards
    • Track and submit issues in Github
    • Upgrading Ushahidi
      • Upgrading to latest release
      • Upgrading from V3.x.x to V4.x.x
    • ⚙️ Installation Helper‌
  • Tech Stack
    • API Documentation
    • Third party app development
      • Web hooks
    • Database | Tables overview
    • Database | Database Schema Diagram
    • Database | Table details
    • 📐Architecture
    • Use case internals
  • QA & Testing
    • The QA process
    • How to run QA tests
    • Defect Management
    • How to write QA test scripts
    • Hotfixes
  • Front-end development
    • Changing UI styles: introduction to the pattern library
      • File-structure
      • Installing new packages
      • How to Apply to the Platform
      • Using the changed styles in platform-client
      • Syntax and Formatting
      • Grid, Breakpoints, & Media Queries
      • Variables
      • Mixins
      • Helpers
      • Icons
      • Create a New Component from Scratch
      • Read Direction
  • Design
    • 🎨Design: overview
    • 'Best practice' design
    • Ushahidi Platform 'Sticker Sheet'
    • User testing process
    • User testing script examples
    • Synthesising user testing results examples
      • Synthesis example 1
      • Synthesis example 2
      • Synthesis example 3
      • Synthesis recommendations example 1
      • Synthesis recommendations example 2
    • Open Source Design
  • Documentation
    • Documentation
    • Contributing docs via GitHub
  • Translation
    • Localization and Translation
  • The Ushahidi Platform Facebook bot
    • The Facebook bot
      • Installing the bot
      • The bot script
  • Hackathon and events
    • Installathon, May 2019
      • Welcome to the hackathon!
    • Write/Speak/Code 2019
    • Open Design: Bangalore
    • Open Design: Taipei
    • 📑Google season of docs
    • 💻Google Summer of Code
      • GSoC 2024
  • Enhancement Proposals
    • Exchange Format
    • Importing data from previous versions
Powered by GitBook
On this page
  • Facebook Bot Setup
  • Prerequisites
  • Set-up
  1. The Ushahidi Platform Facebook bot
  2. The Facebook bot

Installing the bot

PreviousThe Facebook botNextThe bot script

Facebook Bot Setup

The Ushahidi facebook-bot is built with Lumen and a mysql database. To set it up you need to

Prerequisites

  1. Make sure you have the following installed:

  2. You must have an instance of the COMRADES Platform deployed and accessible via the internet, as you will need to point the facebook bot to your deployment.

Set-up

  • Clone the repo:

  • Create a .env file. An example-file is found in .env.example

The script

Bot uses a predefined script when talking to the users. It is not possible to adjust the questions themselves without doing some coding, but during setup, some information about the ushahidi-deployment and the campaign is needed. That information is added in the .env file and is used to create and adjust this script to the organisation using the bot. These are:

TITLE: The title of the Ushahidi-deployment connected to the the bot is used

AIM: The aim/a short description of the campign where the bot is used.

NAME: The name of the bot

TWITTER_NAME: The twitter-name for the organisation/campaign using the bot

TWITTER_HASH: The hashtag used for the organisation/campaign

Credentials

After creating the app, select “Messenger” under “Add a product” in your app-settings:

In order to get an access-token, you need to connect it to a facebook-page. If you don’t have one already, go to the “normal” facebook (not the developer-one) and create a page:

After that, go back to developer-facebook and your app, in the messenger-settings, you can select your page and generate an access-token:

Add the access-token to your .env file together with a verify-token of your choice and the facebook secret token found here:

When all those credentials are in your .env-file, together with the credentials for the Ushahidi-deployment you want to use to send reports with, you start the application with

  • vagrant up and then

  • artisan php migrate --seed (this sets together the script for the bot, using the variables you added to the .env-file)

Now go back to developers.facebook.com and click on Messenger->settings to set up your webhooks.

Use your-url/webhook as callback-url and verify-token is the same as you choose in the .env file. Select messages and messaging_postbacks. Click on verify and save.

Go to your page and send a message to the page to start talking to the bot. It is good to add a start-button and a persistent-menu, instructions for those could be found in the facebook-documentation:

The full script of the bot can be found .

For some of the credentials in the .env-file you need to create a “Facebook-app”. You do that here: .

Composer
Vagrant
Virtual box
https://github.com/ushahidi/platform-facebook-bot
here
https://developers.facebook.com
https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/get-started-button
https://developers.facebook.com/docs/messenger-platform/send-messages/persistent-menu