0

現在、座標APIからジョブを取得しようとしており、Google座標APIにGoogle APIクライアントジェムを使用しています。すべて問題ないようです。ターミナルで呼び出しを確認できますが、応答は常にコード 500 で null です。誰か助けてくれませんか????

api_client = Google::APIClient.new  
        path_to_key_file ="app/assets/2.p12"
        passphrase = "notasecret"
        key = Google::APIClient::PKCS12.load_key(path_to_key_file, passphrase)
        asserter = Google::APIClient::JWTAsserter.new(
       'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
       'https://www.googleapis.com/auth/coordinate',
       key)
        api_client.authorization = asserter.authorize()
        @code=api_client.authorization.access_token
        @token=api_client.authorization.fetch_access_token
        #api_client.execute
        coordinate = api_client.discovered_api('coordinate')
        @response = api_client.execute(
        :api_method => coordinate.jobs.list,
        :parameters => {
          'teamId' => "xxxxxxxxxxxxxxxxxxxxxx",
          #"lat" => 47.670188,
          #"lng"=> -122.196335,
          #"address" =>"747 6th St S, Kirkland WA 98033",
          #'title' => "from local",
          'key' => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
     }
      )
4

1 に答える 1

0

解決策を見つけました..... Coordinate を使用しているユーザーに代わってサービス アカウントを動作させる必要があります。ドキュメントはhttps://developers.google.com/drive/delegationにあります。

于 2013-10-21T08:04:15.440 に答える