WeatherBot in Line

Log in Line

  1. Register your Line@ account in Line business Center, select Messaging API in the Services category:

  2. Then you choose Start using Messaging API.

  3. Put required information about your Bot (account name, business type) for your LINE@ account.

  4. And then select LINE@ MANAGER.

  5. Next, press Enable API on “Bot Settings” page
  6. 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

  1. In “LINE Business Center", in Accounts section, choose LINE Developers to go to Channel Console.
  2. In order to get Channel access token for API access, press ISSUE near “Channel access token” area.
  3. Press EDIT and setup webhook URL.
  4. 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.

WeatherBot

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.

Webhook instal

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.

Specify received process webhook-url in your bot's settings at “LINE Business Center" in section Accounts -LINE Developers-Channel Console, more details described here.

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

For user's comfort, we added test access key for OpenWeatherMap API into "WeatherBot" template. In order to get your access key for OpenWeatherMap API, follow link and register there.

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.

results matching ""

    No results matching ""

    Would you recommend to your colleagues Corezoid.com documentation for learning?
    Please enter your email to feedback
    Thank you!