Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. While on the code root folder, navigate to MoodleBot > appsettings.json. The following are some of the most important parameters to configure.

    1. TwilioNumber: chatbot telephone number. Users have to write a message to this number to start the conversation. All numbers need to have the following format: whatsapp:<telephone number>.

      Code Block
      "TwilioNumber": "whatsapp:+447862143841",
    2. TwilioAccountSid: can be found in the Twilio console dashboard, in the ‘Account info’ section.

    3. TwilioAuthToken: can be found in the Twilio console dashboard, in the ‘Account info’ section.

    4. TwilioValidationURL: this URL hast to be the same you use as the webhook URL for incoming messages on Twilio (read why here). Remember, the webhook URL has to point to the port 3979 of the server where the chatbot is hosted.

      Code Block
      "TwilioValidationUrl": "http://<host>:3979/api/twilio",

      Image RemovedImage Added

    5. Moodle.AuthToken: authentication token, used to consume Moodle’s API.

    6. Moodle.MoodleAPI.BaseUrl: Moodle instance URL for all API calls.

      Code Block
      "BaseUrl": "https://<host>/webservice/rest/server.php?moodlewsrestformat=json",

...

Code Block
ngrok start --config=ngrok_composer.yml --all
  1. You will be presented with two URLs: one for localhost:80 and the other for localhost:3979. Use these URLs to configure the chatbot appsettings.json and the Twilio number webhook.

...

  1. After the configuration is done, proceed to run the code using the ‘DialogBot’ startup profile. If it was successfully compiled, you should see the following screen in the browser.

...

Test the Moodle Chatbot App

To confirm the installation was successful, write any message to the chatbot telephone number you configured in the appsettings.json file. The chatbot should answer with a welcome message and start the registration process.

Info

To see in detail the chatbot flow and all the interactions users will have, please go to Moodle Chatbot App Interactions.