[英]Troubles Fetching a Long-lived Access Token from the Instagram Basic Display API
我正在嘗試使用 Instagram 基本顯示 API,但在獲取長期訪問令牌時遇到了困難。 希望你們中的一些人可以幫助我縮小問題的范圍。 我一直在通過 Meta for Developers 'Get Started',目前停留在第 5 步:用代碼交換令牌:
我已經做到了,您可以單擊以對 Instagram 測試用戶進行身份驗證,您將獲得一個重定向的 URI,並附有“授權代碼”。 然后我使用該代碼並使用以下參數對https://api.instagram.com/oauth/access_token進行 POST:
client_id={insta-app-id}
client_secret={insta-app-secret}
grant_type=authorization_code
redirect_uri={redirect-uri} 代碼={授權碼}
然后我得到這個響應: { "error_type": "OAuthException", "code": 400, "error_message": "Missing required field client_id" }
如果你覺得它有幫助,這是關於我的方法的更多信息:
一切似乎都很完美。 嘗試使用郵遞員或網絡瀏覽器。
你能分享你做的確切帖子嗎?
這聽起來像是 POST 請求中的語法錯誤。
我打開了一個終端並運行了這個確切的 CURL 請求:
curl -X POST \
https://api.instagram.com/oauth/access_token \
-F client_id={app-id} \
-F client_secret={app-secret} \
-F grant_type=authorization_code \
-F redirect_uri={redirect-uri} \
-F code={code}
我回來了 json:
{"id":"<user_id>", "username":"<username>"}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.