This node.js example connector allows you to make your Teneo bot available on LINE. This guide will take you through the steps of creating a new LINE Provider and deploying the connector to respond to events sent by Teneo.
You can find the source code of this project on Github.
Making the connector available via https is preferred. Ngrok is recommended for this.
The LINE app should already be running with an active account on your device.
Your bot needs to be published and you need to know the engine URL.
git clone https://github.com/artificialsolutions/tie-api-example-line.git
.envfile in the folder where you stored the source, and add values for CHANNEL_SECRET and TENEO_ENGINE_URL. CHANNEL_ACCESS_TOKEN will be set later on.
TENEO_ENGINE_URL=<your_engine_url> CHANNEL_SECRET=<that value obtained in the previous section> CHANNEL_ACCESS_TOKEN=<value issued in the upcoming section>
Next, we need to make the connector available via https. We'll use ngrok for this.
ngrok http 3000
Next, in the 'LINE Official Account Features' section > 'Auto-reply messages', click on 'Edit'.
Set 'Response mode' to Bot. Disable 'Auto-Response' and 'Greeting Message'. Set 'Webhooks' to Enabled.
Go back to 'Messaging API' > 'Webhook Settings' and set 'Webhook URL' by using the public https URL obtained from ngrok in the previous step, and attaching the suffix '/callback'. The URL will look roughly like this:
Click 'Verify' and also Enable 'Use Webhook'.
Browse to 'Message API' > Channel Access Token. Click issue, and copy the 'Channel Access Token' value for later use. It is very important to note that this token must be re-issued everytime the Webhook URL is changed, to prevent authentication errors.
TENEO_ENGINE_URL=< your_engine_url > CHANNEL_SECRET=< The value obtained in previous steps> CHANNEL_ACCESS_TOKEN=< 'Channel Access Token', from the previous step >
Go back to the Basic Settings section of your Provider, and locate the QR code shown in the bots section. Use it to add your bot as a new contact to your LINE app.
That's it! Your bot should now be available in LINE and responding to messages that are sent to it.
Was this page helpful?