facebookresearch / facebookresearch/Ad-Library-API-Script-Repository

Generating app_token

オープン
#23 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
337
フォーク
130
PR マージ指標
30日以内にマージされた PR はありません

説明

Currently I generate an access token in pretty much the same steps as @skylarcheung outline's [here](https://github.com/facebookresearch/Ad-Library-API-Script-Repository/issues/3#issuecomment-638988172) 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)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リポジトリ内のファイルやテストは指定されていません。まず、文書化されているアプリの認証情報を使って2つのリクエストを Python で再現し、そのレスポンスを issue #3 で説明されている手動生成トークンのフローと比較します。プログラムによるフローで、政治広告を取得でき、拡張も可能なトークンを安定して生成できるようになったら、作業完了とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, authentication
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。