# Development guidelines

Follow the development guidelines below when developing a LINE bot that uses the Messaging API.

Note

The basic rules for LINE bot development are based on what is stated in the terms and policies.

# Prohibiting mass requests to the LINE platform

Don't send a large number of requests to the LINE platform for load testing purposes.

Don't send requests beyond the specified rate limits for any purpose.

Note

If you send requests exceeding the rate limit, you will receive an error message saying, 429 Too Many Requests.

# Prohibiting LINE platform load tests

There is no service to load test bot servers from the LINE platform.

For load testing purposes, don't send large numbers of messages via the LINE platform. Prepare a separate environment for load testing of bot servers.

# Prohibiting mass transmission to the same user

Don't send too many messages to the same user for any purpose.

# Prohibiting requests for non-existent user IDs

When sending a request, don't specify a non-existent user ID.

# Saving logs

We recommend saving logs for Messaging API request and webhooks received for a certain period of time so that developers themselves can smoothly investigate the cause and scope of a problem when it occurs.

# Logs for Messaging API request

We recommend saving the following information as a log when making a request to the Messaging API.

  • Request ID (x-line-request-id) of the Response header
  • Time of API request
  • Request method
  • API endpoint
  • Status code returned in response by the LINE Platform

More specifically, save it in a log file using the following format.

Request ID (x-line-request-id) Time of API request Request method API Endpoint Status code
8e36bade-c5d6-4d00-9e69-72244675a9a1 Mon, 05 Jul 2021 08:14:35 GMT POST https://api.line.me/v2/bot/message/push 200

# Logs for webhooks received

We recommend saving the following information as a log when you receive a webhook from the LINE Platform through the bot server.

  • IP address of the webhook sender
  • Time webhook was received
  • Request method
  • Request path
  • Status code the bot server returned in response to the received webhook

More specifically, save it in a log file using the following format.

Sender IP address Time webhook was received Request method Request path Status code
xxx.xxx.xxx.xxx Mon, 05 Jul 2021 08:10:00 GMT POST /linebot/webhook 200
Additional information that would be useful to keep in log

Depending on the requirements of the bot, the following information, in addition to the above, can be stored for investigation when problems occur.

  • Messaging API request body
  • Response body returned by the LINE Platform after the API request
  • Signature (x-line-signature) of the request header when webhook is sent from the LINE Platform
  • Webhook event object returned by the LINEE Platform
We don't provide logs

We don't provide logs of Messaging API requests, or logs of webhooks sent from the LINE platform to the bot server, etc. despite inquiries. Logs should be saved by the LINE bot developers themselves.