kulpa / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Example given doesn't work #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
https://developers.google.com/api-client-library/python/start/get_started

I am new to this and trying the "SIMPLE" example given on that page and I 
copied it VERBATIM and I get the following error when run:

python ./simple_api_cmd_line_books.py 
./1d0f3b4be3f160ee3c7fdb0f70c368d4107fa793-privatekey.p12 
Traceback (most recent call last):
  File "./simple_api_cmd_line_books.py", line 43, in <module>
    response = request.execute()
  File "/usr/local/lib/python2.7/dist-packages/apiclient/http.py", line 654, in execute
    raise HttpError(resp, content, self.uri)
apiclient.errors.HttpError: <HttpError 400 when requesting 
https://www.googleapis.com/books/v1/volumes?q=android&source=public&alt=json&key
=.%2F1d0f3b4be3f160ee3c7fdb0f70c368d4107fa793-privatekey.p12 returned "Bad 
Request">

For some reason, the code seems to be adding some characters to my key.  

Original issue reported on code.google.com by paulst...@gmail.com on 5 Aug 2012 at 4:58

GoogleCodeExporter commented 9 years ago
The argument is supposed to be a Simple API Key, as shown in this section of 
the APIs Console docs:

   https://developers.google.com/console/help/#generatingdevkeys

The .p12 key you generated is actually a public-private key pair and is the 
kind that is used by the SignedJwtAssertionCredentials.

  https://developers.google.com/api-client-library/python/guide/aaa_oauth#SignedJwtAssertionCredentials

Original comment by jcgregorio@google.com on 5 Aug 2012 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by afs...@google.com on 6 Aug 2012 at 7:05

GoogleCodeExporter commented 9 years ago
I've updated the documentation to be more clear.

Original comment by afs...@google.com on 6 Aug 2012 at 8:25