WeatherBot in Line
- Log in Line
- Webhook and Access token
- Webhook instal
- What Weatherbot does
- Integration with OpenWeatherMap
- Testing and launch
Log in Line
Register your Line@ account in Line business Center, select Messaging API in the Services category:
Then you choose Start using Messaging API.
Put required information about your Bot (account name, business type) for your LINE@ account.
And then select LINE@ MANAGER.
- Next, press Enable API on “Bot Settings” page
- Customize your bot with Your Bot Settings by making next additional parameters: click on "Allow" for "Send event notifications" and "Bot access in group chats" and also "Forbid" for "Answering machine messages" and "Greeting messages"
Webhook and Access token
- In “LINE Business Center", in Accounts section, choose LINE Developers to go to Channel Console.
- In order to get Channel access token for API access, press ISSUE near “Channel access token” area.
- Press EDIT and setup webhook URL.
- After making this steps, your bot will interact with your users using API provided by Messaging API and you can go on and customize your bot.
Clone template "WeatherBot"
WeatherBot - receives webhooks with city name or your coordinates, receives air temperature and sends a message.
In case if message does not contain city name or city is specified incorrectly and also if there is an error occurred in process, bot sends an appropriate message.
Next, in the "Set access_token and APPID_key" node, in the values of the variables:
- access_token put your personal Channel Access Token, that you recieved when created Bot in “LINE Business Center" in sections Accounts - LINE Developers - Channel Console.
- APPID_key put test access key for OpenWeatherMap API.
For getting webhook-url of WeatherBot process, select "Connect to messenger":
Get webhook-url of WeatherBot for LINE Messenger. Then there is the empty field where you should put your personal Channel Access Token, that you get when created Bot in “LINE Business Center" in section Accounts - LINE Developers - Channel Console.
What Weatherbot does
It will be enough to specify city name or your coordinates and this information your Bot receives air temperature and sends a message.
In case if city or coordinates are specified incorrectly and also if there is an error occurred in process, bot sends an appropriate message.
Integration with OpenWeatherMap
In "Set access_token and APPID_key" node, replace test OpenWeatherMap API key to the one that you received in value of the APPID_key parameter.
Testing and launch
In order to test your bot, add it to your friendlist with ID Line - @zvm1764c or QR code:
Just add your bot in Line and start a chat:
Switch to View or Debug modes to see the stream of requests, how it is moving and distribute to all process nodes.