LINE QR Login: Retrieve the Missing QR URL and PIN
A successful LINE QR-start request in UnifyPort does not have to contain a QR image. LINE login material arrives asynchronously through account.auth.required and is cached in the authentication resource. Read data.auth_payload.url and data.auth_payload.pin from that resource, display the returned material to the account owner, and poll the QR check operation. Do not keep restarting authorization because the first response lacks an image.
Key takeaways
- The LINE-specific flow uses a returned QR image URL and PIN; do not blindly copy another provider’s
qr_codeexample. - Display the PIN for the owner’s login interaction. Do not submit it through the verification-code API.
account.auth.requiredcan be part of first-time login, not proof that an existing session failed.- Authorization success and a running connection are separate checks.
Separate LINE’s login interaction from the API contract
LINE’s official PC login help explains scanning the displayed QR code with LINE on the main device and confirming login there. A verification code can also appear when logging in on a PC for the first time or after reinstalling. The owner completes that verification on the main device after checking the requested device.
That help explains the user interaction—not UnifyPort’s endpoint names or response fields. For those, use the LINE authorization reference. This tutorial concerns UnifyPort’s unofficial interface for a connected LINE account, not a LINE Official Account channel access token or a website login integration.
1. Prepare authorization-event delivery before starting
Create an active signed receiver using Create webhook endpoint. For an explicit subscription set, include the authorization events you need, such as account.auth.required, account.auth.succeeded, and account.auth.failed, as well as message.received for the later receiving test. Preserve other subscriptions when updating an existing endpoint.
Verify deliveries according to the webhook delivery contract: X-Device-Signature is the HMAC-SHA256 of the timestamp, a dot, and the raw request body. Keep authorization payloads in protected, short-lived storage rather than general application logs, analytics, or a shared support transcript.
If the workspace receiver gets other accounts’ events but not this account’s authorization prompts, inspect the account-webhook inheritance rules. An independent account configuration can override the workspace even when inactive or missing the desired subscription. Adding a workspace wildcard does not repair that override.
2. Start one LINE QR flow
For a new messaging account, follow the account-creation reference with provider=line and auth_mode=qrcode, using an available region. Save the returned account ID and use that same account throughout the flow. The LINE guide documents QR authorization; do not substitute a Telegram code flow.
The following are request-shape examples, not executed requests. Send them from your backend with X-Api-Key; POST requests shown here use a JSON body of {}.
POST /v1/accounts/{account_id}/auth/qr/start
Content-Type: application/json
{}
Disable duplicate Start actions while this request is in progress. If its response is lost, read current authentication state before deciding whether another start is appropriate. A missing QR field is not, by itself, a failed start.
3. Retrieve the asynchronous QR URL and PIN
Use Get authentication state for the cached material, and the QR check operation to poll authorization progress:
GET /v1/accounts/{account_id}/auth
POST /v1/accounts/{account_id}/auth/qr/check
Content-Type: application/json
{}
For the LINE flow, the guide identifies auth_payload.url as the QR image URL and auth_payload.pin as the PIN. In the REST response, read them under data. In an authorization-required webhook, inspect data.auth_status and data.auth_payload, with the envelope’s account_id identifying the account.
Render the returned QR image rather than turning its image URL into a new QR code. Show the supplied PIN alongside it; do not invent a PIN if absent. Keep the screen waiting when material has not arrived, and refresh from current state instead of interpreting absence as rejection.
Treat webhooks as prompts to reconcile the selected account. A delayed event must not replace a completed login screen with old login material. As an application design precaution, serialize state reads and discard results belonging to a previous account selection or an abandoned local screen.
4. Keep the PIN on the user-interaction side
UnifyPort’s LINE guide says the PIN is for caller display, not submission back through the API. If LINE asks the owner for verification on the main device, the owner follows that prompt. Do not send the displayed PIN to auth/code merely because that endpoint exists for other authorization flows.
LINE’s PC help describes regenerating an expired QR code, but it does not establish a universal expiry timer for UnifyPort. The current product documentation does not provide a LINE QR expiry time. Do not copy Telegram’s timing or fabricate an expiration timestamp. If the material is no longer usable, read current state and follow the LINE authorization flow for a deliberate new attempt.
5. Confirm readiness, then test reception
When authentication is authorized or account.auth.succeeded arrives, clear the QR/PIN display and read the account resource. Confirm runtime_status=running separately before treating the account as ready. Authorization normally starts the runtime automatically; do not issue Start unconditionally or wait for an event that the LINE provider does not promise to emit.
If authorization is complete but the connection is not healthy, use the runtime recovery decision guide to distinguish observation from connection control. A connection problem does not automatically require another QR scan.
Then send a controlled message from a consenting tester. Confirm the expected account’s message.received event reaches the verified receiver and is stored. Successful login alone does not prove webhook reception, and a successful fresh message does not prove recovery of previously missed traffic.
FAQ
Why is there no QR URL in the LINE start response?
The LINE flow delivers QR material asynchronously. Check the authorization event path and the cached authentication resource instead of repeatedly starting new flows.
Can I use the generic auth_payload.qr_code example for LINE?
Do not assume identical payloads across providers. The LINE guide specifically documents auth_payload.url and auth_payload.pin; implement that provider-specific display path.
Does account.auth.required mean the account was logged out?
Not necessarily. It also occurs during initial authorization. Read the current state and available material before deciding what happened.
What should I test before shipping the login screen?
Test delayed QR material, an absent PIN, a lost start response, stale responses after switching accounts, authorization success before the next poll, and authorization completed while runtime is still starting. These are proposed acceptance checks, not reported test results.
Next step and sources
Implement the display and polling sequence against the LINE authorization reference, then validate it with an account whose owner has approved the connection. API access does not remove LINE’s login checks or account rules.
References checked on 2026-12-03:
Turn messaging integration into a stable product pipeline.
Start by sending through one API, then bring every inbound message back into your business system with standard events.