Ocriva Logo

Documents

LINE Integration

Integrate Ocriva with LINE for mobile document scanning and authentication.

lineliffmobilescanintegration

Published: 4/1/2026

LINE Integration

Overview

Ocriva integrates with LINE — Thailand's most popular messaging platform. The integration covers three distinct features that work together to provide a seamless mobile document processing experience:

  1. LINE Login — sign in to Ocriva using your LINE account
  2. LIFF Scanner — scan and upload documents directly from the LINE app camera
  3. Rich Menu — a branded chatbot menu that gives users instant access to Ocriva features

NOTE

LINE integration is especially useful for Thai users who already use LINE daily. All three features can be used independently — you do not need to use Rich Menu to use LINE Login, and vice versa.


LINE Login

LINE Login lets users sign in to Ocriva using their existing LINE account. No separate password is required and no new account needs to be created.

How It Works

  1. Click Sign in with LINE on the Ocriva login page
  2. You are redirected to the LINE authorization page (https://access.line.me/oauth2/v2.1/authorize)
  3. Grant the requested permissions (profile, email, OpenID)
  4. LINE redirects back to Ocriva with an authorization code
  5. Ocriva exchanges the code for tokens at https://api.line.me/oauth2/v2.1/token
  6. Your LINE profile is linked to your Ocriva account and a JWT session is issued

Permissions Requested

PermissionPurpose
profileDisplay name and avatar for your Ocriva profile
emailAccount identification and recovery
openidSecure, standards-based authentication

NOTE

Ocriva uses your LINE profile data only for authentication. Ocriva does not post anything to your LINE timeline, read your chats, or contact your LINE friends.


LIFF Scanner (Mobile Document Scanning)

What is LIFF?

LIFF (LINE Front-end Framework) allows web applications to run inside the LINE app browser. Ocriva's scan page (/scan) is deployed as a LIFF app, which gives it access to the LINE camera and LINE authentication — making it possible to scan, upload, and process documents entirely within LINE.

Scanning Flow

  1. Open the LIFF URL in the LINE app (via Rich Menu, a shared link, or a direct URL)
  2. The LIFF app initializes and authenticates with LINE automatically
  3. If you are logged in to LINE but not yet registered with Ocriva, the system auto-registers your account using your LINE profile
  4. Select the Project you want to file the document under
  5. Select the Template that matches your document type
  6. Tap Scan with LINE Camera to open the LINE in-app camera
  7. Capture your document — try to fill the frame and avoid shadows
  8. Preview the captured image — tap Retake if the image is unclear
  9. Tap Upload to send the image to Ocriva for processing
  10. The document is processed using the selected template
  11. View extracted results in Processing History

Supported Capture Methods

MethodWhen Available
LINE CameraInside LINE app with LIFF initialized
Device CameraAny mobile browser (automatic fallback)

WARNING

LINE Camera access requires the page to be opened inside the LINE app. If you open the scan URL in a standard mobile browser, the app automatically falls back to the device camera. All other features (template selection, upload, processing) work the same in both modes.

Template Selection

  • You must select a template before scanning
  • The template determines what fields are extracted from the document
  • You can switch projects and templates between scans without closing the app
  • The same templates available on the web upload page are available in the LIFF scanner

TIP

For best scan quality: use good lighting, hold the camera steady, and position the document so it fills most of the frame. Avoid photographing documents on glossy surfaces that cause glare.


Rich Menu

What is a Rich Menu?

A Rich Menu is a custom graphical menu displayed at the bottom of a LINE chat with your organization's bot. It provides large tap targets that link directly to Ocriva features, so users can launch the scanner or open the dashboard with a single tap.

Rich Menu Specifications

PropertyValue
Image size2400 × 809 pixels
Max file size1 MB
Supported formatsPNG, JPEG
Action areasConfigurable tap zones (up to 6 areas)

What a Rich Menu Typically Contains

  • Scan Document — opens the LIFF scanner page
  • Dashboard — opens the Ocriva web dashboard
  • Processing History — opens the results page

Setting Up Rich Menu

Rich Menu configuration is handled by your system administrator via the LINE Messaging API. The LineService in the Ocriva backend manages Rich Menu CRUD operations. Setup requires:

  1. A LINE Messaging API channel (separate from the LINE Login channel)
  2. MESSAGE_CHANNEL_ID and MESSAGE_CHANNEL_SECRET credentials configured in the environment
  3. A correctly sized Rich Menu image (2400 × 809 px, < 1 MB)
  4. Defined action areas pointing to your LIFF URL and web dashboard

IMPORTANT

LINE Login and Rich Menu use different LINE channels. LINE Login requires a LINE Login channel, while Rich Menu requires a Messaging API channel. Both must be created separately in the LINE Developers Console.


Environment Setup (for Administrators)

Required Environment Variables

VariablePurpose
LINE_CLIENT_IDLINE Login channel ID (from LINE Developers Console)
LINE_CLIENT_SECRETLINE Login channel secret
LINE_CALLBACK_URLOAuth2 callback URL (e.g., https://your-domain.com/auth/line/callback)
NEXT_PUBLIC_LIFF_IDLIFF application ID (configured on the web frontend)
MESSAGE_CHANNEL_IDMessaging API channel ID (for Rich Menu)
MESSAGE_CHANNEL_SECRETMessaging API channel secret (for Rich Menu)

LINE Developer Console Setup

  1. Go to LINE Developers Console and create or select a provider
  2. Create a LINE Login channel — copy the Channel ID and Channel Secret into LINE_CLIENT_ID and LINE_CLIENT_SECRET
  3. Set the Callback URL in the channel settings to match LINE_CALLBACK_URL
  4. Under the LINE Login channel, create a LIFF app — set the endpoint URL to your /scan page URL, and copy the LIFF ID into NEXT_PUBLIC_LIFF_ID
  5. Create a Messaging API channel (separate from the Login channel) — copy its Channel ID and Channel Secret into MESSAGE_CHANNEL_ID and MESSAGE_CHANNEL_SECRET
  6. Design and upload your Rich Menu image via the LINE Official Account Manager or the Messaging API

NOTE

The NEXT_PUBLIC_LIFF_ID variable is used by the Next.js frontend. It must be prefixed with NEXT_PUBLIC_ so it is available in the browser bundle.


Use Cases

Field Document Scanning

  • Sales teams capture receipts and invoices on the go without visiting the office
  • Delivery drivers scan package labels and consignment notes at the point of delivery
  • Field inspectors photograph completed inspection forms and checklists

Customer Self-Service via LINE

  • Customers photograph their own documents (ID cards, invoices, forms) directly in the LINE chat
  • Rich Menu guides them to the scanner without needing to know a URL
  • Documents are processed automatically and results are available immediately

Mobile-First Workflows

  • No desktop or laptop required — the entire scan → process → review workflow runs on a smartphone
  • Teams in the field can submit documents in real time, while back-office staff review results in the web dashboard

TIP

Combine LINE scanning with Batch upload on desktop. Field workers scan individual documents via LINE throughout the day, while back-office staff upload bulk document sets from the web interface. Both flows feed into the same Processing History and can be filtered by project.


Summary of Integration Points

FeatureChannel TypeKey Env Vars
LINE LoginLINE Login channelLINE_CLIENT_ID, LINE_CLIENT_SECRET, LINE_CALLBACK_URL
LIFF ScannerLIFF app (under Login channel)NEXT_PUBLIC_LIFF_ID
Rich MenuMessaging API channelMESSAGE_CHANNEL_ID, MESSAGE_CHANNEL_SECRET