1. Documents
  2. Messaging API

Obtaining user consent

This page explains the different types of consent users can provide to your bot (LINE@ accounts or official accounts) and how that affects the JSON data returned in your webhooks from groups or rooms. User consent for your account is obtained differently depending on the version of the LINE app.

Types of user consent

The type of consent provided by users is different depending on whether they are using LINE version 7.5.0 or higher.

Users using versions 7.5.0 or higher

Users using LINE version 7.5.0 or higher will see a consent screen (called the Official Accounts Terms of Use) the first time they add any official account or LINE@ account as a friend or invite an account to a chat. Once users have agreed to this consent screen, they no longer have to provide consent individually to subsequent official accounts or LINE@ accounts that they add as friends or interact with.

official accounts terms of use

If a user has already agreed to the Official Accounts Terms of Use when adding your bot as a friend, no consent screen is displayed and your bot will automatically be able to get the user’s profile information (display name, profile image, status message, and user ID). If the user has not agreed to the Official Accounts Terms of Use, the consent screen is displayed and the user must agree before it can add your account as a friend.

Note: To see how this affects the data that you can retrieve in webhooks, see the example below.

Users using a version below 7.5.0

Users who are using a version of the LINE app below 7.5.0 must agree to a consent screen for every individual bot that they add as a friend or invite to a chat. By default, the consent screen asks for the user’s permission to retrieve the user’s profile information (display name, profile image, status message, and user ID).

bot demo consent screen

Differences between the types of consent

You can get the user ID of a user who sends your bot a message in a group chat depending on the type of consent that the user has provided. When a user, who is using LINE version 7.5.0 or higher and has agreed to the Official Accounts Terms of Use, sends your bot a message in a group or chat, the user’s user ID is included in the source group or source room object that is sent in the webhook. The user ID is not included in the webhook if the user is using a version below 7.5.0.

Data sent for users using version 7.5.0 or higher

The following is an example of source group object sent for a user who is using LINE version 7.5.0 or higher and has agreed to the Official Accounts Terms of Use.


{
  ...
  "source": {
    "type": "group",
    "groupId": "Ca56f94637cc4347f90a25382909b24b9",
    "userId": "U206d25c2ea6bd87c17655609a1c37cb8"
  },
  ...
}

Data sent for users using a version below 7.5.0

The following is an example of a source group object sent for a user who is using a version of LINE below 7.5.0.


{
  ...
  "source": {
    "type": "group",
    "groupId": "Ca56f94637cc4347f90a25382909b24b9"
  },
  ...
}