403 Forbidden message when calling the v3 Google Calendar API using a Service Account via OAuth 2.0

后端 未结 3 1174
盖世英雄少女心
盖世英雄少女心 2020-11-30 11:26

This is a follow on from my thread about a 401 error when using the Google Calendar API and OAuth2, which can be found here

This contains details of the account setu

相关标签:
3条回答
  • 2020-11-30 12:20

    Solved, thanks to this post.

    You have to share the calendar from your Google Calendar account with the Service Account email that is generated in the Google API Console, e.g. 284XXXXXXXX@developer.gserviceaccount.com.

    I can now update my calendar from my web service.

    0 讨论(0)
  • 2020-11-30 12:27

    I was also getting the same error even after sharing the calendar as in the Justin's answer. After comparing with another working sample figured out that I have set

    var SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"];
    

    instead of

    var SCOPES = ["https://www.googleapis.com/auth/calendar"];
    

    Hope this helps anyone who has done a similar mistake and getting this error.

    0 讨论(0)
  • 2020-11-30 12:27

    In my case I had to enable the CalDAV API in the Google API console. It gives a 403 response if disabled.

    I know this is an old question, but this might be helpful for someone.

    0 讨论(0)
提交回复
热议问题