1. Documents
  2. Web API

Getting user profiles

Once the user logs in to your app using LINE Login and you have retrieved an access token, you can call the Social REST API to get the user’s LINE profile information. You can get the user’s user ID, display name, profile media URL, and status message.

Before you begin

To call the Social REST API, you must have an access token retrieved through the authentication and authorization process. See the following pages for more information.

Getting user profiles

To get a user’s profile information, send an HTTP GET request to the /profile endpoint with the access token in the request header.

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

Request header

Header Description
Authorization Bearer {ACCESS_TOKEN}

Example request

curl -X GET \
-H 'Authorization: Bearer bNl4YEFPI/hjFWhTqexp4MuEw5YPs7qhr6dJDXKwNPuLka...' \
https://api.line.me/v2/profile

Response

If successful, a JSON response is returned with the user ID, display name, profile media URL, and status message. The profile media URL and status message are not returned if they have not been set by the user.

{
  "userId":"Ufr47556f2e40dba2456887320ba7c76d",
  "displayName":"Brown",
  "pictureUrl":"https://example.com/abcdefghijklmn",
  "statusMessage":"Hello, LINE!"
}

Error responses

The following HTTP status codes are returned when an API is called.

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 limits for requests.
500 Internal Server Error Temporary error on the API server.

Related pages

For more information on the Social REST API, see the following pages.