1

I trying to use the Google OAuth 2.0 playground to query for realtime updates on a Google Docs File ID. For every request using either the get or update Realtime api calls I receive an error and have tried sending in numerous file ids. Do you have any advice as to how to use this API?

Below is the URL I am sending along with the error returned:

https://www.googleapis.com/drive/v2/files/1IT1qIuM6QsqV7D--69uv0sn4OSQ24UQKos3x0P3BQjc/realtime

Error Returned:

GET /drive/v2/files/1IT1qIuM6QsqV7D--69uv0sn4OSQ24UQKos3x0P3BQjc/realtime HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Authorization: Bearer ya29.LgDc0oNUU_4cuhoAAAAjT4pqiLwlIpoRV7ll_QEJp1QayB49KOwIYKHVK5rMww
HTTP/1.1 400 Bad Request
Content-length: 172
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Expires: Wed, 25 Jun 2014 10:08:21 GMT
Server: GSE
Cache-control: private, max-age=0
Date: Wed, 25 Jun 2014 10:08:21 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
{
  "error": {
    "code": 400, 
    "message": "Invalid Value", 
    "errors": [
      {
        "domain": "global", 
        "message": "Invalid Value", 
        "reason": "invalid"
      }
    ]
  }
}

Thanks, Michael

1 Answers1

0

You need to provide your API key at the end. You can see what the requests should look like in the API explorer.

Note however that realtime documents are scoped to a particular app, so anything you've created in your app won't show up in the API explorer. You can update and the get it from that using the explorer app though.

Cheryl Simon
  • 46,552
  • 15
  • 93
  • 82
  • Hi Cheryl I tried this by passing in an API key but am now receiving the following error: "error": { "code": 401, "message": "Invalid Credentials", "errors": [ { "locationType": "header", "domain": "global", "message": "Invalid Credentials", "reason": "authError", "location": "Authorization" } ] } Have you experienced this ? – Michael Miscampbell Jun 26 '14 at 13:36
  • As the message indicates, you are passing invalid credentials. You need to make sure you have proper oauth 2 setup. – Cheryl Simon Jun 26 '14 at 14:40
  • Are you able to query this in your OAuth Playground? As I have tried adding my own custom OAuth settings, passing in an API key with the Realtime get query but each time I receive either error code 400 or 401 Can you confirm you are able to query the API using your own OAuth playground? If yes are customising any of the default settings in the playground? – Michael Miscampbell Jun 27 '14 at 10:22