Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating app_token #23

Open
jackstruck opened this issue Mar 25, 2023 · 0 comments
Open

Generating app_token #23

jackstruck opened this issue Mar 25, 2023 · 0 comments

Comments

@jackstruck
Copy link

Currently I generate an access token in pretty much the same steps as @skylarcheung outline's here however I'd like to try to do this programatically instead of manually every 60 days. With access to the app id and secret, what call would I need to make to get the token, and then extend it?

Currently trying the following to get the token:
response = requests.get(f"https://graph.facebook.com/oauth/access_token?client_id={app_id}&client_secret={app_secret}&grant_type=client_credentials")
but the returned app_token does not work when I try to pull political ads data or try to extend it:
second_response = requests.get(f"https://graph.facebook.com/oauth/access_token?client_id={app_id}&client_secret={app_secret}&grant_type=fb_exchange_token&fb_exchange_token={app_token}")

(I am verified and when I manually generate the token and extend it I am able to pull ads without issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant