Search code examples
androidgoogle-classroomsigned-apk

403 Forbidden error while fetching courses list for Google Classroom


I have integrated Google Classroom Api's in my android application and every thing was working fine for last couple of months but now I am start getting below error every time I am trying to fetch courses list from classroom

Error:

403 Forbidden { "code":403, "errors":[ { "domain":"global", "message":"Google Classroom API has not been used in project google.com:api-project-60894XXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/classroom.googleapis.com/overview?project=google.com:api-project-60894XXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", "reason":"forbidden" } ], "message":"Google Classroom API has not been used in project google.com:api-project-608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/classroom.googleapis.com/overview?project=google.com:api-project-60894XXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", "status":"PERMISSION_DENIED" }

Note: I have implemented Google Classroom integration from the below documentation https://developers.google.com/classroom/quickstart/android

Also, Every thing is working fine on my unsigned/debug build.

So my question is as I haven't disabled any permission and also it is working fine on debug/unsigned build/apk what could be the possible reason and solution.


Solution

  • You release build should use a different key than the debug one (in the classroom they create a debug one in /.android/debug.keystore).

    The key SHA1 must be entered on Google API console, make sure your release SHA1 is entered on the console as well. Re-do the step 2.a of the classroom with the release SHA1 if needed.