# Server API

Version number differs from LIFF SDK

The version number of the server API is different from that of LIFF SDK. The currently released version of LIFF SDK is v2, but the version of the server API is v1.

# Server API

# Preparing a channel access token

You need a channel access token for the LINE Login channel to use the LIFF Server API. For more information, see Issue short-lived channel access token in the Messaging API reference.

# Adding the LIFF app to a channel

Adds the LIFF app to a channel. You can add up to 30 LIFF apps on one channel.

Example

# HTTP request

POST https://api.line.me/liff/v1/apps

# Request headers

Authorization

Required

Bearer {channel access token}
For more information, see Preparing a channel access token.

Content-Type

Required

application/json

# Request body

view.type

String

Required

Size of the LIFF app view. Specify one of these values:

  • compact
  • tall
  • full

For more information, see Size of the LIFF app view.

view.url

String

Required

Endpoint URL. This is the URL of the web app that implements the LIFF app (e.g. https://example.com). Used when the LIFF app is launched using the LIFF URL.

The URL scheme must be https. URL fragments (#URL-fragment) can't be specified.

view.moduleMode

Boolean

Optional

true to use the LIFF app in modular mode. When in modular mode, the action button in the header is not displayed.

description

String

Optional

Name of the LIFF app.

The LIFF app name can't include "LINE" or similar strings, or inappropriate strings.

features.ble

Boolean

Optional

true if the LIFF app supports Bluetooth® Low Energy for LINE Things. false otherwise.

features.qrCode

Boolean

Optional

true to use the 2D code reader in the LIFF app. false otherwise. The default value is false.

permanentLinkPattern

String

Optional

How additional information in LIFF URLs is handled. Specify concat.

For more information, see Opening a LIFF app in the LIFF documentation.

scope

Array of strings

Optional

Array of scopes required for some LIFF SDK methods to function.

  • openid
  • email
  • profile
  • chat_message.write

The default value is ["profile", "chat_message.write"]. For more information on each scope, see Adding the LIFF app to your channel in the LIFF documentation.

botPrompt

String

Optional

Specify the setting for bot link feature with one of the following values:

  • normal: Display the option to add the LINE Official Account as a friend in the channel consent screen.
  • aggressive: Display a screen with the option to add the LINE Official Account as a friend after the channel consent screen.
  • none: Don't display the option to add the LINE Official Account as a friend.

The default value is none.

# Response

Returns status code 200 and a JSON object with the following properties.

liffId

String

LIFF app ID

Example

# Error response

One of the following status codes is returned.

Status code Description
400 This status code means one of the following:
  • The request contains an invalid value.
  • The maximum number of LIFF apps that can be added to the channel has been reached.
401 Authentication failed.

# Update LIFF app settings

Partially updates LIFF app settings.

Example

# HTTP request

PUT https://api.line.me/liff/v1/apps/{liffId}

# Request headers

Authorization

Required

Bearer {channel access token}
For more information, see Preparing a channel access token.

Content-Type

Required

application/json

# Path parameters

liffId

Required

ID of the LIFF app to be updated

# Request body

view.type

String

Optional

Size of the LIFF app view. Specify one of these values:

  • compact
  • tall
  • full

For more information, see Size of the LIFF app view.

view.url

String

Optional

Endpoint URL. This is the URL of the web app that implements the LIFF app (e.g. https://example.com). Used when the LIFF app is launched using the LIFF URL.

The URL scheme must be https. URL fragments (#URL-fragment) can't be specified.

view.moduleMode

Boolean

Optional

true to use the LIFF app in modular mode. When in modular mode, the action button in the header is not displayed.

description

String

Optional

Name of the LIFF app.

The LIFF app name can't include "LINE" or similar strings, or inappropriate strings.

features.ble

Boolean

Optional

true if the LIFF app supports Bluetooth® Low Energy for LINE Things. false otherwise.

features.qrCode

Boolean

Optional

true to use the 2D code reader in the LIFF app. false otherwise.

permanentLinkPattern

String

Optional

How additional information in LIFF URLs is handled. Specify concat.

For more information, see Opening a LIFF app in the LIFF documentation.

scope

Array of strings

Optional

Array of scopes required for some LIFF SDK methods to function.

  • openid
  • email
  • profile
  • chat_message.write

For more information on each scope, see Adding the LIFF app to your channel in the LIFF documentation.

botPrompt

String

Optional

Specify the setting for bot link feature with one of the following values:

  • normal: Display the option to add the LINE Official Account as a friend in the channel consent screen.
  • aggressive: Display a screen with the option to add the LINE Official Account as a friend after the channel consent screen.
  • none: Don't display the option to add the LINE Official Account as a friend.
Note

Only the properties specified in the request body are updated.

# Response

Status code 200 is returned.

# Error response

One of the following status codes is returned.

Status code Description
400 The request contains an invalid value.
401 Authentication failed.
404 This status code means one of the following:
  • The specified LIFF app does not exist.
  • The specified LIFF app has been added to another channel.

# Get all LIFF apps

Gets information on all the LIFF apps added to the channel.

Example

# HTTP request

GET https://api.line.me/liff/v1/apps

# Request headers

Authorization

Required

Bearer {channel access token}
For more information, see Preparing a channel access token.

# Response

Returns status code 200 and a JSON object with these properties.

apps

Array of objects

Array of LIFF app objects

apps[].liffId

String

LIFF app ID

apps[].view.type

String

Size of the LIFF app view. One of these values:

  • compact
  • tall
  • full

For more information, see Size of the LIFF app view.

apps[].view.url

String

Endpoint URL. This is the URL of the web app that implements the LIFF app (e.g. https://example.com). Used when the LIFF app is launched using the LIFF URL.

apps[].view.moduleMode

Boolean

true to use the LIFF app in modular mode. When in modular mode, the action button in the header is not displayed.

apps[].description

String

Name of the LIFF app

apps[].features.ble

Boolean

true if the LIFF app supports Bluetooth® Low Energy for LINE Things. false otherwise.

apps[].features.qrCode

Boolean

true if the 2D code reader can be launched in the LIFF app. false otherwise.

apps[].permanentLinkPattern

String

How additional information in LIFF URLs is handled. concat is returned.

For more information, see Opening a LIFF app in the LIFF documentation.

apps[].scope

Array of strings

Scopes of the LIFF app.

  • openid
  • email
  • profile
  • chat_message.write

For more information on each scope, see Adding the LIFF app to your channel in the LIFF documentation.

apps[].botPrompt

String

The setting for bot link feature.

  • normal: Display the option to add the LINE Official Account as a friend in the channel consent screen.
  • aggressive: Display a screen with the option to add the LINE Official Account as a friend after the channel consent screen.
  • none: Don't display the option to add the LINE Official Account as a friend.

Example

# Error response

One of the following status codes is returned.

Status code Description
401 Authentication failed.
404 There is no LIFF app on the channel.

# Delete LIFF app from a channel

Deletes a LIFF app from a channel.

Example

# HTTP request

DELETE https://api.line.me/liff/v1/apps/{liffId}

# Request headers

Authorization

Required

Bearer {channel access token}
For more information, see Preparing a channel access token.

# Path parameters

liffId

Required

ID of the LIFF app to be deleted

# Response

Status code 200 is returned.

# Error response

One of the following status codes is returned.

Status code Description
401 Authentication failed.
404 This status code means one of the following:
  • The specified LIFF app does not exist.
  • The specified LIFF app has been added to another channel.