Generating app_token
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- api, authentication
Research direction
No repository file or test is named. Start by reproducing the two requests in Python with the documented app credentials, compare their responses with the manually generated token flow described in issue #3, and consider the work done when the programmatic flow reliably produces a token that can retrieve political ads and be extended.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- Python
- Stars
- 338
- Forks
- 131
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from facebookresearch/Ad-Library-API-Script-Repository
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
facebookresearch/Ad-Library-API-Script-Repository#62 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
facebookresearch/Ad-Library-API-Script-Repository#51 · 6 comments ·
All issues in facebookresearch/Ad-Library-API-Script-Repository
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·