# Social API v2.0 reference

# OAuth

# Verify access token

Verifies the access token

Example request

# HTTP request

POST https://api.line.me/v2/oauth/verify

# Request headers

Content-Type

application/x-www-form-urlencoded

# Request body

access_token

String

Access token

# Response

scope

String

Permissions obtained through the access token.

client_id

String

Channel ID for which the access token is issued.

expires_in

Number

Expiration date of the access token. Expressed as the remaining number of seconds to expiry from when the API was called.

Example response

# Refresh access token

Gets a new access token using a refresh token. Refresh tokens are returned with the access token when the user authorizes your app.

Note

This is the reference for the v2 endpoint. For information on the v2.1 endpoint, see Refresh access token.

Note

Cannot be used to refresh channel access tokens which are used for the Messaging API.

Example request

# HTTP request

POST https://api.line.me/v2/oauth/accessToken

# Request headers

Content-Type

application/x-www-form-urlencoded

# Request body

grant_type

String

refresh_token

refresh_token

String

Refresh token. Valid up until 90 days after the access token issued. You must log in the user again if the refresh token expires.

client_id

String

Channel ID. Found on the console.

client_secret

String

Channel secret. Found on the console.

# Response

Example response

{
   "token_type":"Bearer",
   "scope":"P",
   "access_token":"bNl4YEFPI/hjFWhTqexp4MuEw...",
   "expires_in":2591977,
   "refresh_token":"8iFFRdyxNVNLWYeteMMJ"
}

The response is returned in JSON.

token_type

String

Bearer

scope

String

Permissions obtained through the access token.

access_token

String

Access token

expires_in

Number

Expiration date of the access token. Expressed in the remaining number of seconds to expiry from when the API was called.

refresh_token

String

Token used to get a new access token. Valid up until 90 days after the access token issued.

# Revoke access token

Invalidates the access token.

Note

This is the reference for the v2 endpoint. For information on the v2.1 endpoint, see Revoke access token.

Note

Cannot be used to invalidate channel access tokens which are used for the Messaging API.

Example request

# HTTP request

POST https://api.line.me/v2/oauth/revoke

# Request headers

Content-Type

application/x-www-form-urlencoded

# Request body

refresh_token

String

Refresh token

# Response

Returns status code 200 and an empty response body.

# Profile

# Get user profile

Gets a user's display name, profile image, and status message.

Note

Requires an access token with the profile scope. For more information, see Making an authorization request and Scopes in the LINE Login documentation.

Example request

# HTTP request

GET https://api.line.me/v2/profile

# Request headers

Authorization

Bearer {access token}

# Response

displayName

String

User's display name

userId

String

User ID

pictureUrl

String

Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image.

statusMessage

String

User's status message. Not included in the response if the user doesn't have a status message.

Example response

# Profile image thumbnail

You can change the user's profile image size by adding a suffix to the URL.

Image size Suffix
200 x 200 /large
51 x 51 /small

Example profile image URL

# Errors

# Status codes

The following HTTP status codes are returned after an API call.

Status code Description
200 OK Request successful
400 Bad Request Problem with the request. Check the request parameters and JSON format.
401 Unauthorized Check that the authorization header is correct.
403 Forbidden Not authorized to use the API. Confirm that your account or plan is authorized to use the API.
429 Too Many Requests Make sure that you are within the rate limit for requests.
500 Internal Server Error Temporary error on the API server.