Ryan1729
Ryan1729

Reputation: 1010

Google Drive Android API not activating

I'm trying to add the ability to upload a text file to Google Drive to an existing android application. I've used the instructions here and integrated the activity into the app. When I click on the "Call Drive API" button in the emulator I get a 403 error saying "Access not configured" and suggesting I enable the Drive API at https://console.developers.google.com/apis/api/drive/overview?project= then an id number.

403 error message

I've done that, and the developer console says the drive API is enabled, but I still get the 403 error in the app, even a few hours later.

screenshot of google developer console

Is there some step I'm missing or a way to get this working?

Upvotes: 2

Views: 88

Answers (1)

BNK
BNK

Reputation: 24114

403 Forbidden, look like that your request to Drive API has missed an authorization token?

Please read About Authorization:

Every request your application sends to the Drive API must include an authorization token

At Upload Files Guide, you will also find an simple example (pay attention to Authorization: Bearer your_auth_token):

POST /upload/drive/v3/files?uploadType=media HTTP/1.1
Host: www.googleapis.com
Content-Type: image/jpeg
Content-Length: number_of_bytes_in_file
Authorization: Bearer your_auth_token

JPEG data

Upvotes: 1

Related Questions