2016-04-04 6 views
0

新たなリフレッシュトークンを取得しようとしたとき、私はこのエラーを取得しています:YouTubeの:{ "エラー" => "INVALID_REQUEST"、 "しましたerror_description" => "必須のパラメータが欠落しています。grant_typeを"}

{ "エラー" => "INVALID_REQUEST"、 "しましたerror_descriptionは" => "必要なパラメータ が欠落しています。grant_type"}

は、ここで私は要求を生成するために使用しているコードです:

HTTParty.post("https://accounts.google.com/o/oauth2/token", 
{ 
    client_id: Figaro.env.google_client_id, 
    client_secret: Figaro.env.google_client_secret, 
    refresh_token: Figaro.env.google_client_refresh_token, 
    grant_type: "refresh_token" 
}) 

grant_type paramをインクルードしていますが、まだエラーが発生しています。なぜどんなアイデア?まもなく掲載後に答えを発見

答えて

0

:それを行うだろうbody`セクション...大漁:

HTTParty.post("https://accounts.google.com/o/oauth2/token", 
{ 
    :body => { 
    client_id: Figaro.env.google_client_id, 
    client_secret: Figaro.env.google_client_secret, 
    refresh_token: Figaro.env.google_client_refresh_token, 
    grant_type: "refresh_token" 
    } 
}) 
+0

は '忘れました。 – Codexer