Closed dgmouris closed 3 months ago
Here's how you get to the settings for adding the service account's permissions to the users calendar
For the service account creation.
Hopefully this helps and I can delete this message whenever if it's not useful.
@MandyMeindersma Let me know what you think about this whenever you have time.
Just for completionists sake, the endpoint json would return something like this (these are throw away events)
{
"statusCode": 200,
"message": "Success",
"events": [
{
"kind": "calendar#event",
"etag": "\"3429537132936000\"",
"id": "6q60o3fo5sqnkeq68j6bhjlsfc",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NnE2MG8zZm81c3Fua2VxNjhqNmJoamxzZmMgc3RldmUuc2hlZXRzZmFjZUBt",
"created": "2024-05-03T01:11:57.000Z",
"updated": "2024-05-03T20:36:06.468Z",
"summary": "Test event friday.",
"creator": {
"email": "steve.sheetsface@gmail.com",
"self": true
},
"organizer": {
"email": "steve.sheetsface@gmail.com",
"self": true
},
"start": {
"dateTime": "2024-05-04T20:00:00-06:00",
"timeZone": "America/Edmonton"
},
"end": {
"dateTime": "2024-05-04T21:00:00-06:00",
"timeZone": "America/Edmonton"
},
"iCalUID": "6q60o3fo5sqnkeq68j6bhjlsfc@google.com",
"sequence": 1,
"reminders": {
"useDefault": true
},
"eventType": "default"
},
{
"kind": "calendar#event",
"etag": "\"3429542509008000\"",
"id": "5civg5i4e3btljevb9jup2bpfj",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=NWNpdmc1aTRlM2J0bGpldmI5anVwMmJwZmogc3RldmUuc2hlZXRzZmFjZUBt",
"created": "2024-05-03T21:19:05.000Z",
"updated": "2024-05-03T21:20:54.504Z",
"summary": "Second Event",
"creator": {
"email": "steve.sheetsface@gmail.com",
"self": true
},
"organizer": {
"email": "steve.sheetsface@gmail.com",
"self": true
},
"start": {
"dateTime": "2024-05-04T21:00:00-06:00",
"timeZone": "America/Edmonton"
},
"end": {
"dateTime": "2024-05-04T22:00:00-06:00",
"timeZone": "America/Edmonton"
},
"iCalUID": "5civg5i4e3btljevb9jup2bpfj@google.com",
"sequence": 0,
"attendees": [
{
"email": "steve.sheetsface@gmail.com",
"organizer": true,
"self": true,
"responseStatus": "accepted"
},
{
"email": "des-calendar-service-act-test@deveedmonton-testing-calendar.iam.gserviceaccount.com",
"responseStatus": "needsAction"
}
],
"reminders": {
"useDefault": true
},
"eventType": "default"
}
]
}
@dgmouris this is great! if you would like we can excract this later to a Nuxt Module so others can use it? that can be a cool project!
So @arashsheyda I think later is key here, right now people will be able to read the endpoint /api/events/
with a GET request so that its flexible.
@arashsheyda do you mean as another project as a whole? If so the options here are pretty limitless!
PS. I think this is good to go once we test it and set up the service account with the devedmonton email :) Let me know your folks' thoughts.
@dgmouris yes I meant after this PR gets merge we can create a new project e.g. devedmonton/nuxt-google-calendar-api
and submit that to Nuxt Modules
@ajyong @MandyMeindersma I'm still getting familiar with the contributing to this site, I was wondering how I can get either some review/feedback/change requests on this PR :)
I would like to test this with the devedmonton google account as well if you folks feel comfortable with that:)
My apologies @dgmouris @ajyong Normally I would try to review it in 2-3 days. Things have been crazy with work.
I will try to look at it in the next two days, again really sorry! And I'll look at trying to get you access to our google calendar
No problem @MandyMeindersma I was assuming you folks got a little busy with work, I just wanted to make sure this isn't forgotten :)
As a note, I think it would be best to merge this once we've tested it with the calendar :) Let me know how I can help or who I should talk if you folks need help :)
Thanks again!
Still in the process of figuring out what I am supposed to be doing (the videos are very helpful @dgmouris thank you)
I did give you access to edit and add events on the public calendar for testing @dgmouris Feel free to make a mess of it. No one is currently using it. Also lemme know if I should add any of your students as well
I am making progress!!!
I used to be getting the 400 "No Service Account Credentials Provided" but now I am getting:
@allcontributors add @dgmouris for ideas, code and documentation
@MandyMeindersma
I've put up a pull request to add @dgmouris! :tada:
Thank you so much @dgmouris for making the videos and making it so easy to follow! I am so sorry it took me so long to do this. That is not normal. Normally I get to reviews and asks within 2-3 days and I will be more timely as y'all are making more prs
Also the calendar is kinda bare right now because I have to ask ben how he did the meetup import to the calendar. And I'll be asking other organizers to add their events too! Yay!
Hey @MandyMeindersma thanks for taking the time to review this! I'm excited because I hope this is the beginning of the ground work where we can display all events in one place.
What issue is this referencing?
This hopefully going to enable us to manage one google calendar and have ability to list those events so that we can see them on the website, which is the original issue referenced https://github.com/devedmonton/DES-Website/issues/312.
This requires and google service account that has permissions to "Make Changes to Events" in the user's google calendar account. Documentation for this will be added shortly.
It also introduces new environment variables that kind of look like this based on the working example shown below.![image](https://github.com/devedmonton/DES-Website/assets/8164434/839881eb-dc3f-4324-9f0f-30464d686a77)
Hopefully someone can help me get some credentials for a DES email that probably has all of these events so that I can double check the environment variables locally.
Do these code changes work locally and have you tested that they fix the issue yourself?
Does the following command run without warnings or errors?
npm run pr-checks
Have you taken a look at our contributing guidelines?
My node version matches the one suggested when running
nvm use
?