Graph API Basics: Starting with the User Profile
Learn how to access a user profile with a long-lived access token.
The /me
endpoint
The /me
endpoint is an excellent starting point for using the Facebook Graph API. Through this endpoint, we will be able to retrieve basic user profile data belonging to our Facebook user.
In our last lesson, you took the short-lived user access token associated with one of your test users and exchanged it for a long-lived token. Now, we will use that long-lived token to make requests to the /me
endpoint. User-related endpoints on the Facebook Graph API start with /{user-id}
. But since you are using a user access token associated with a specific user, the /me
endpoint is just a shortcut/alias to the /{user-id}
endpoint for that user’s ID.
Let’s send a basic request to the /me
endpoint, including the access_token
as a query parameter. In the previous lesson, we already updated ACCESS_TOKEN to the value of the long-lived access token. Now, just click on Run below:
Get hands-on with 1400+ tech skills courses.