Click "Use this process" and template of this process "WeatherBot" will copy in your environment.
There are two processes placed in a folder: Set Welcome Message and WeatherBot:
Set Welcome Message designed to fit a welcome message to user.
WeatherBot - accepts webhooks with city name, receives air temperature with it and sends the message.
In case if message does not contain city name or city specified incorrectly, also if there is an error in process, it sends appropriate message
1) Create facebook [application] (https://www.facebook.com/login.php?next=https%3A%2F%2Fdevelopers.facebook.com%2Fquickstarts%2F%3Fplatform%3Dweb) and page. Get Page ID.
2) In Facebook app settings click on "+add product" and choose Messenger
3) Receive page access marker - Page Access Token
4) Connect Weatherbot process to FB Messenger by specifying page access marker
5) Recieve webhokk-url of WeatherBot process for FB Messenger
6) Set webhook in facebook app settings by specifying received webhook-url of WeatherBot process in Reverse URL-address field and also put the page access marker to Confirm marker field
7) When you have chosen the page, sign webhook to its events More detailed instruction on Facebook
Integration with OpenWeatherMap
For user's comfort we added test key for OpenWeatherMap API to WeatherBot template.
In order to get your OpenWeatherMap API access key, follow the [link] (http://openweathermap.org/register) and register.
In Set APPID_key node replace test OpenWeatherMap API key by the one that you received in APPID_key parameter value
Testing and launch
Set Bot's welcome message
Switch to Debug mode of Set Welcome Message process
Press button Add task.
Specify required parameters in appeared window.
- access_token - page access marker
- welcome_text - Your Bot's welcome message. For example, Hi! Here you can get the weather. Enter city name
After specifying all parameters, press Send task button.
And next, just add your bot to Facebook and start chat
Switch to View or Debug mode WeatherBot
in order to see request flow, their transit and node distribution process.
As long as your app is in development mode, its functionality and API will work only for administrators, developers and app testers. After approval and publishing, your app will be available to the general public.