簡體   English   中英

Instagram API-無法請求訪問令牌

[英]Instagram API - Unable to request access token

我使用HTTParty嘗試請求訪問令牌,如下所示:

result = HTTParty.post("https://api.instagram.com/oauth/access_token",
{ 
  :body => [ { "client_id" => xxxxxxxxxx, "client_secret" => xxxxxxxxxxxxx,
  "grant_type" => "authorization_code",
  "redirect_url" => 'http://localhost:4000/access_token', "code" => xxxxxxxx } ].to_json,
  :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json'}
})

但是響應說#400,“ error_type” =>“ OAuthException”,“ error_message” =>“您必須提供一個client_id”},@ response =#,@headers = {“ content-language” => [“ en “],” expires“ => [” Sat,01 Jan 2000 00:00:00 GMT“],........

不知道為什么..幫助!

您可以將內容類型更改為:

'Content-Type' => 'application/x-www-form-urlencoded'

有關更多信息,請單擊instagram-api-authentication-must-provide-client-id

希望對您有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM