I created a service account, got json configuration file and I request an access token using it. The response is ok, I receive token. When I upload file using it everything is o
For the error Daily Limit for Unauthenticated Use Exceeded. Continued use requires sign, try to check in your Google developer console under APIs, the project associated with the API key. Example: https://console.developers.google.com/project/<your app id>/apiui/api
. Make sure that the status for Google+API was set to ON.
Based from this SO question, that error implies that you haven't set up a Google APIs console project.
- Create a Google APIs Console project
- On the Services pane, enable all of the APIs that your project requires.
- On the API Access pane, click Create an OAuth 2.0 client ID. A dialog opens. Fill in your project's information. Click Next
- Choose the appropriate application type. Based on the tags you used for this post, I am guessing this is an iOS project so select Installed application.
- Enter your bundle ID. You don't need to enter an App Store ID until your app is listed there.
- Click Create Client ID.
You will see the client ID and client secret values. You will use these values to enable communication with your project and the Google APIs.
If you aren't already using it, see the Google+ iOS SDK and documentation for a full walk through. The task called "write moments" is similar in implementation and demonstrates how to connect to and use the Google+ REST APIs from within an iOS project that uses the SDK.
You'll need to specify the scope of plus.me to get the profile information.
Hope this helps!
I found out what was the problem. I was sending access token in the url address instead of in the header. Eventually I did it like this:
public List<String> getFilesList() {
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint('https://www.googleapis.com/drive/v2/files);
req.setHeader('Authorization', 'Bearer '+accessToken);
HttpResponse resp = http.send(req);
return null;
}