How to get user access token from Facebook API with curl

15,747

You can only get a User Token with user interaction, not by curl. It does not work like that, and it should not work like that.

You can use an Extended User Token though, it is valid for 60 days. After that, the user has to refresh it.

More information about Tokens:

Share:
15,747
Nir Ben Yaacov
Author by

Nir Ben Yaacov

Updated on June 05, 2022

Comments

  • Nir Ben Yaacov
    Nir Ben Yaacov almost 2 years

    I am writing a program that retrieves our marketing data from facebook. the program i am writing can only use curl to retrieve the user access token and there is no UI, the only info I found is to call this url

    Curl('https://graph.facebook.com/oauth/authorize?client_id=1534273216862757&response_type=token&redirect_uri=https://www.facebook.com/connect/login_success.html','GET')
    

    However, when I send this, i get back the entire html of the redirect page and no token.

    do you know of another way I can accomplish this?

    thanks