Čamo
Čamo

Reputation: 4163

How to get Facebook access token

According this documentation i tried to send get request to graph api

curl -X GET "https://graph.facebook.com/oauth/access_token
  ?client_id={your-app-id}
  &client_secret={your-app-secret}
  &grant_type=client_credentials"

but I am getting an error message

{
    "error": {
        "message": "Missing redirect_uri parameter.",
        "type": "OAuthException",
        "code": 191,
        "fbtrace_id": "AFBj5BLV5WZ0ZTlT62XuaVb"
    }
}

Does anybody know what am I doing wrong? Thanks.

PS: I dont want to log in user I want to download Instagram images for FB app....

Upvotes: 0

Views: 3108

Answers (1)

Adhitya
Adhitya

Reputation: 665

In your case, I seen you need a application in Facebook Apps
Now you can see in https://developers.facebook.com/apps/

With example:
You make a application
After it, Facebook will regenerate App ID and App Secret
Then Input them to

curl -X GET "https://graph.facebook.com/oauth/access_token
  ?client_id={your-app-id}
  &client_secret={your-app-secret}
  &grant_type=client_credentials"

Example:

curl -X GET "https://graph.facebook.com/oauth/access_token
  ?client_id=336055786532989
  &client_secret=46ff578663d95d62fa22f257cabe62ce
  &grant_type=client_credentials"

Upvotes: 1

Related Questions