2015-11-05 94 views
0

使用HTTParty我試圖以請求訪問如下令牌:Instagram的API - 無法請求接入令牌

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」=> [「星期六,01 Jan 01 00 :00:00 GMT「],........

想不通爲什麼..幫助!

回答

相關問題