Google Drive API message “Daily Limit for Unauthenticated Use Exceeded.” while viewing files from Salesforce

后端 未结 2 1496
旧时难觅i
旧时难觅i 2021-01-27 14:20

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

2条回答
  •  太阳男子
    2021-01-27 14:37

    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 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;
    }
    

提交回复
热议问题