Google Drive SDK - Java sample not working

后端 未结 4 921
猫巷女王i
猫巷女王i 2021-01-06 10:54

I\'m trying to get familiar with the Google Drive API using the official Java sample. However, after wasting a few hours and attempting to set the sample up two times, I\'m

4条回答
  •  臣服心动
    2021-01-06 11:16

    As per your logs it seems that your 404 error is caused by a 403 error returned on the request to the Drive API.

    Errors from Google APIs usually contains an explanations in their body. In your case:

    "error": {
      "errors": [
       {
        "domain": "usageLimits",
        "reason": "dailyLimitExceededUnreg",
        "message": "Daily Limit Exceeded. Please sign up",
        "extendedHelp": "https://code.google.com/apis/console"
       }
      ],
      "code": 403,
      "message": "Daily Limit Exceeded. Please sign up"
     }
    }
    

    This one would typically mean that you have not enabled access to the Google Drive API on your Google APIs Console project. In order to do this:

    • Open your project in the Google APIs Console
    • Go to the Services section
    • Enable the Drive SDK and Drive API by clicking the On/Off toggle
    • Don't forget to configure your app in the Drive SDK section and your OAuth settings in the **API Access" section

    This is all described in the Get started > Register an App section of our documentation. You should also make sure that you go through the other sub-sections of Get started.

提交回复
热议问题