I would like to get a list of events between two dates (start /end) or all events for the next (3 / 7) days.
I'm currently using # node-red-node-google 0.1.4
My problem is, that these nodes only provide the option to get the next event and nothing more.
Sorry, I'm not a Javascript programmer. That is why I asked here to e.g. get a hint to use another node or something like that.
I can try to write a python script but that won't help the node.
Too sad, that there seems no other already working node for that task.
If you think you can write it in python then with a minimal bit of learning you should be able to do it in javascript. Especially when you are starting with a working node and just need to add features to it.
node-red-node-google is not working at all. However, there is node-red-contrib-google node which is wrapping Google API and is working like a charm. It's also much more flexible.
to google node. On google node set API to calendar:v3 and Operation to events.list (of course you could leave that empty and provide everything by input node). timeMin and timeMax is what you want to create time window. Just checked it, works perfectly.
Of course, you need to configure google node but that is extremely simply (not like node-red-node-google):
Whist node-red-node-google was not working for you, there are others, that for what it was designed to do, it works perfectly well. It is incorrect to say it is not working at all.
But I'm happy you have managed to achieve what you want and thanks for sharing it.
I've tested it on 3 completely different instances of NR on different machines and even architecture with different Google accounts. Every time the result was the same: success but no credentials were stored preventing that node from working - hence my comment.
Anyway, we can agree that the second node wrapping whole API fits the requirements and do the job.
Thanks, I installed the node. Copied the complete credentials.json file into the config node.
After that I tried your example. The configuration seems ok, but as response in the debug tab, I only get "Error: Not found".
Pick CalendarList.list as Operation and check if you have access to that particular calendar. If you see something in payload.items then copy id of that calendar and us it as calendarId for events.list call.
Yes, it seems to work. Thank you. I didn't konw that I have to "open" the calendar for that generated email address. I thought all the keys and ids would be enough
Well, you don't have to "open" the calendar for that generated email. You have to open any calendar you would like to view in NR and share it with that generated email So that generated email (service account) is like a user for your API (NodeRed).
Yeah, that's the small issue with this node. It stores this JSON key in a way that it's being shared with the flow, so be careful with sharing your flow or pushing it to git.
Hi,
I am lost after generate JSON key.
in IAM & admin I can see an related mail account fo rthe key.
But how to use ?
I tryed to put in the key in the JSON field of the connection node. But what about the Scopes field ?
@uwaechte using the email account you found in the 'IAM & Admin' section, go to your calendar's settings in Google Calendar and share the calendar with that email address.
EDIT: Figured it out! I used the following template with a timestamp inject and moment conversion. No idea if this is the best way to do what I need but it works...
Thanks for the help - this topic helped me set this up.
Just struggling with one thing - how do I return just the next occurring event? I have a recurring event and I need just the next instance returned, but it's giving me all events ever added to calendar. I've read through the Google Calendar API documents and have tried a bunch of stuff. I can get it to give me only one result but can't figure out the rest. For some reason it only lets you sort by date.
I tried using simpletime and passing myrawdate into a template of this:
But it obviously doesn't work. I know no programming, so I'm kind of just guesting here...I think it's changing the format of myrawdate but not sure why. Using moment, I can get the right time stamp but getting a different error.
"Error: The requested ordering is not available for the particular query."