- This project uses Go Lang version 1.22. You can view the instructions on how to install it here.
- Access to a Google Account
- Uses the latest OpenAPI doc which you can find here
We will be connecting to the google calendar you will need to have and account there and set-up access to Google Calendar. You can read up about the Google Calendar API.
To create a new API project go to Google Console
- Beside the Google Cloud icon in the top right click on the drop down and click on
New Project
. - Name the project
google-calendar-sample
. You do not have to connect it to an organisation and click next.
We can head to the project api dashboard found here. Make sure the dropdown is still selecting your project.
From the API dashboard.
- Click on
Library
- Click on
Google Calendar API
- Click on
Enable
. This will turn on the calendar APIs
This will allow people to log into their accounts to access their own google calendar From the API dashboard.
- Click on
Credentails
- Click on
+ Create Credentails
andOAuth Client ID
- Click on
Configure Consent Screen
- Click on
External
this will allow people to use the project - Fill in the form with
- App Name:
Hootsuite Sample Calendar App
- User Support Email:
<Your email>
- Authorised Domains:
hootsuite.com
- Contact Information:
<Your email>
- App Name:
- Click
Save
- Click on
Add or Remove Scopes
and add the following:../auth/calendar.readonly
- Click on
Update
- Click on
- Click on
Save and Continue
- Now add Test Users that you want to test out your app (probably want to add yourself to this list)
- Click on
Save and Continue
- Click on
+ Create Credentails
andOAuth Client ID
again.- Application Type:
Web application
- Name:
Sample App
- Name:
- We will have to come back to this once we have more information for the redirect url
- Click
Save
- Copy the
Client ID
andClient Secret
we will need these to set-up on the Hootsuite side
- Application Type:
Once your developer account is active you can go to My Apps
- Click on
Create New App
- Fill out the form:
- App Title:
Google Calendar Sample App
- Description:
This is a sample app to connect to Planner Content to Google Calendar
- The rest can be black for the sample
- App Title:
- Click on the app you just created
- Click on
Edit
- In the
Extension Authentication (OAuth 2.0)
section.- Client ID: This is the id from Google
<pattern>.apps.googleusercontent.com
- Client Secret: This is the secret from Google
GOCSPX-<pattern>
- Token URL: From Google
https://oauth2.googleapis.com/token
- Authorization URL: From Google
https://accounts.google.com/o/oauth2/auth
- Scope: From Google
https://www.googleapis.com/auth/calendar.readonly
- Client ID: This is the id from Google
- Click
Save
- Copy
Redirect URI
that was generated will need to add this to the Google Settings- Go to the Credentails in Google
- Click on
Sample App
underOauth 2.0 Client IDs
- Click
+ Add URI
underAuthorised redirect URIs
- Paste the Redirect URI from Hootsuite here
- Click on
New App Extension
- App Extension Type:
Planner
- App Extension Title:
Sample Google Calendar App
- App Extension Type:
- CLick
Add
There is 3 commands in the Makefile
:
generate
: Will re-generate the.gen.go
filesbuild
: Will compile the code into a binaryrun
: will run the code locally