API used to fetch google calendar events.
You need to replace client_secret.json file with your own client_secret.json file.
You can get it from https://console.cloud.google.com/ , then going to APIs section, then in credentials section.
It uses oauth2.0 to get access token for the user and then included the access token in a request to the API in an Authorization HTTP header Bearer value.
Below are detail of API endpoint:
- /rest/v1/calendar/init/ : This starts the step 1 of the OAuth. It redirect the user to Google's OAuth 2.0 server to initiate the authentication and authorization process, which will prompt user for his/her credentials.
- /rest/v1/calendar/redirect/ : This view do two things: a) Handle redirect request sent by google with code for token and fetch authorization code from it and to exchange an authorization code for an access token, call the https://oauth2.googleapis.com/token endpoint. b) Fetch events from calendars API.
At the end you recieve a json response