-1

I am new to using Google API and I am struggling to understand how it works. I want to be able to access a calendar and add events to it. I don't want the user to login every time because it will be a universal calendar that holds invoice due dates so from what I understand I want to use a service account. I created a calendar api project and a service account. I set the calendar share permissions to the project email. I have an API key and a service account key. However, I get confused with understanding how it needs to be authenticated. Unfortunately I am using Filemaker so I don't have any helper libraries to help me. I basically just have a POST option.

The google api documentation states that the insert event call requires authorization:

"This request requires authorization with the following scope (read more about authentication and authorization)" https://www.googleapis.com/auth/calendar" https://developers.google.com/google-apps/calendar/v3/reference/events/insert

So if I was just using basic POST requests how would I authorize this and which keys do I need? Do I need the API key and Service Account Key? Do i have to use a client key even if I want all users to access the same calendar?

If I need to clarify anything just let me know.

Thanks!

greyer
  • 97
  • 1
  • 13

1 Answers1

0

You will need to include a valid access_token in the HTTP headers of your POST request, e.g. Authorization: Bearer ya29.xxxxxxxxxxxxxxxxxx

In order to get a valid access_token, you will need to go through the OAuth2 Authorization process as described at https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests

Note: Please click on "HTTP/REST" to see the details of doing that without using any specific client libraries.

enter image description here

some1
  • 857
  • 5
  • 11