Creation at: 2024-11-28 | Last modified at: 2024-12-31 | 2 min read
Use Dify AI’s powerful features to quickly create and integrate a LINE chatbot, making automated conversations easier. This tutorial will guide you step-by-step through the integration process using dmflow.chat, complete with examples and important tips.
Dify is an open-source large language model (LLM) application platform designed to simplify the development and deployment of generative AI applications. It integrates core technologies, combining Backend as a Service (BaaS) with LLMOps, allowing developers (even non-technical users) to quickly build and manage production-grade AI applications.
Dify AI offers a graphical design interface and API integration capabilities, enabling you to streamline complex workflows into a LINE chatbot for various use cases.

For this example, we will use the default template: SaaS Startup Mentor.

The template includes a variable called founder_profile, but it is optional and not used in this example.
Variables used:
userconversation_idRequest Example:
curl -X POST 'https://api.dify.ai/v1/chat-messages' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"inputs": {},
"query": "What are the specs of the iPhone 13 Pro Max?",
"response_mode": "streaming",
"conversation_id": "",
"user": "abc-123",
"files": [
{
"type": "image",
"transfer_method": "remote_url",
"url": "https://cloud.dify.ai/logo/logo-site.png"
}
]
}'
Response Example:
{
"event": "message",
"message_id": "9da23599-e713-473b-982c-4328d4f5c78a",
"conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
"mode": "chat",
"answer": "iPhone 13 Pro Max specs are listed here:...",
"metadata": {
"usage": {
"prompt_tokens": 1033,
"prompt_unit_price": "0.001",
"prompt_price_unit": "0.001",
"prompt_price": "0.0010330",
"completion_tokens": 128,
"completion_unit_price": "0.002",
"completion_price_unit": "0.001",
"completion_price": "0.0002560",
"total_tokens": 1161,
"total_price": "0.0012890",
"currency": "USD",
"latency": 0.7682376249867957
},
"retriever_resources": [
{
"position": 1,
"dataset_id": "101b4c97-fc2e-463c-90b1-5261a4cdcafb",
"dataset_name": "iPhone",
"document_id": "8dd1ad74-0b5f-4175-b735-7d98bbbb4e00",
"document_name": "iPhone List",
"segment_id": "ed599c7f-2766-4294-9d1d-e5235a61270a",
"score": 0.98457545,
"content": "\"Model\",\"Release Date\",\"Display Size\",\"Resolution\",\"Processor\",\"RAM\",\"Storage\",\"Camera\",\"Battery\",\"Operating System\"\n\"iPhone 13 Pro Max\",\"September 24, 2021\",\"6.7 inch\",\"1284 x 2778\",\"Hexa-core (2x3.23 GHz Avalanche + 4x1.82 GHz Blizzard)\",\"6 GB\",\"128, 256, 512 GB, 1TB\",\"12 MP\",\"4352 mAh\",\"iOS 15\""
}
]
},
"created_at": 1705407629
}
We use two resources:
conversation_id is empty.conversation_id exists.Additionally, save the temporary conversation_id in the session by adding it to the memory template.

conversation_id exists.conversation_id does not exist.conversation_id to session.conversationId.session.conversationId exists.
After integration, the LINE chatbot will respond in real time with processed results.
Click to view the detailed tutorial: Channel Integration Tutorial

By following these steps, you have successfully integrated Dify with the LINE chatbot! Start creating efficient automated conversations now to improve service quality.