MRT
MRT

Reputation: 49

Graph API - as user?

I am trying to get to grips with the Graph API. Is i,t correctly understood that if I want to ask for my own, say friends, through code, I should

  1. register my application and get an app access token
  2. Login with my own credentials and get an user access token?

I find it difficult to grasp the concepts from the documentation.

Upvotes: 0

Views: 50

Answers (2)

Kishor
Kishor

Reputation: 1513

The flow should go like :

  1. User adds the app and gives the permissions.
  2. Which returns the access_token (user access token) which is used to query datas.

Generally speaking, You ask for permissions, and you get a key which can open the locked contents. That is the access_token.

Difference between App Access_token and User access_token :

App access_token is needed when you do something as the app. Like getting the insights for the app, or working with subscriptions, so and so.

User access_token is needed when you want to act as the user who have the app added in their account.

With reference to your question, You clearly doesnt need App access_token.

Upvotes: 1

cpilko
cpilko

Reputation: 11852

You need to do both.

Registering your application tells Facebook where those requests are coming from. They monitor what requests your app is making to police apps that violate your terms.

Once you have that app, you personally authenticate it to get information from or post information to Facebook on your behalf. The app must ask for specific permissions and you have to grant these for it to work.

Upvotes: 0

Related Questions