Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.airys.chat/llms.txt

Use this file to discover all available pages before exploring further.

Setup Line app integration on your local machine

Please follow the steps if you are trying to work with the Line integration on your local machine.

Prerequisites

  • Line Developer Account
  • Access to Line Developer Console
  • Ngrok or similar tunneling service
  • Running AirysChat development environment

Setup Steps

1. Start Ngrok Server

Start a Ngrok server listening at port 3000 or the port you will be running the AirysChat installation:
# Install ngrok if you haven't already
# Download from https://ngrok.com/download

# Start ngrok tunnel
ngrok http 3000

2. Update Environment Variables

Update the .env variable FRONTEND_URL in AirysChat with the https version of the Ngrok URL:
# In your .env file
FRONTEND_URL=https://your-ngrok-subdomain.ngrok.io

3. Configure Line Developer Console

  1. Access Line Developer Console: Go to Line Developer Console
  2. Create a Provider (if you don’t have one)
  3. Create a New Channel and select “Messaging API”
  4. Configure Basic Settings:
    • Channel name
    • Channel description
    • Category
    • Subcategory

4. Get Required Credentials

From the Line Developer Console under the “Messaging API” channel, collect the following values:
  1. Channel Name
  2. LINE Channel ID
  3. LINE Channel Secret
  4. LINE Channel Token

5. Start AirysChat Server

Start the AirysChat server and create a new Line channel with the values obtained from Line Developer Console:
# Start the development server
make run
# or
foreman start -f Procfile.dev

6. Create Line Channel in AirysChat

  1. Access AirysChat: Go to your AirysChat instance (http://localhost:3000)
  2. Navigate to SettingsInboxesAdd Inbox
  3. Select Line as the channel type
  4. Enter Line Credentials:
    • Channel Name
    • LINE Channel ID
    • LINE Channel Secret
    • LINE Channel Token
  5. Save Configuration

Configure Webhook in Line Developer Console

After creating the channel, AirysChat will provide a webhook URL for the channel. You need to configure this webhook URL in the Line Developer Console:

Steps to Configure Webhook

  1. Go to Line Developer Console → Your Channel → Messaging API
  2. Find Webhook Settings
  3. Set Webhook URL: Use the URL provided by AirysChat
    https://your-ngrok-subdomain.ngrok.io/webhooks/line/your-channel-id
    
  4. Enable Webhook: Toggle the webhook to “Enabled”
  5. Verify Webhook: Use the “Verify” button to test the connection

Additional Line Settings

Configure these settings in the Line Developer Console:
  • Auto-reply messages: Disable (so AirysChat can handle responses)
  • Greeting messages: Optional
  • Webhook redelivery: Enable for reliability

Testing the Integration

If the webhook is registered correctly with Line, your Ngrok server should receive events for new Line messages, and new conversations will be created in AirysChat.

Test Steps

  1. Add your Line bot as a friend using the QR code or bot ID
  2. Send a message to your Line bot
  3. Check Ngrok logs to see if the webhook request is received
  4. Check AirysChat to see if a new conversation is created
  5. Reply from AirysChat to test bidirectional communication

Troubleshooting

Problem: Line webhook verification fails in Developer ConsoleSolution:
  • Ensure your Ngrok URL is accessible publicly
  • Check that FRONTEND_URL is set correctly in your .env file
  • Verify the webhook URL format is correct
  • Restart AirysChat after updating environment variables
Problem: Line messages don’t create conversations in AirysChatSolution:
  • Check Ngrok logs for incoming webhook requests
  • Verify webhook is enabled in Line Developer Console
  • Check AirysChat logs for any error messages
  • Ensure all Line credentials are entered correctly
  • Verify the channel is enabled in AirysChat
Problem: SSL certificate issues with webhookSolution:
  • Use the https version of your Ngrok URL
  • Ensure Ngrok is running properly
  • Line requires HTTPS for webhook URLs
  • Try restarting Ngrok and updating the webhook
Problem: Line API authentication failuresSolution:
  • Verify Channel ID, Channel Secret, and Channel Token are correct
  • Check that the channel is published and not in development mode
  • Ensure the Messaging API is enabled for your channel
  • Regenerate Channel Token if necessary

Line API Features

Line offers various features you can integrate:
  • Rich Messages: Cards, carousels, quick replies
  • Flex Messages: Custom layouts
  • LIFF (Line Frontend Framework): Web apps within Line
  • Line Login: User authentication

Next Steps

After successful setup:
  1. Test message flow between Line and AirysChat
  2. Configure agent assignments for Line conversations
  3. Set up automated responses if needed
  4. Explore rich message features for enhanced user experience
  5. Review webhook logs for debugging

Getting Help

If you encounter issues:

Useful Resources


Your Line integration is now ready for development and testing! 💬