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.
Anybody who knows how to get achieve my goals?
The node currently doesn't do that.
You could write your own, or even better, add the functionality to the current node after speaking to it's author and benefit the entire community.
Indeed... we would welcome improvements to that node.
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.
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.
Put inject node and send
google node. On
google node set
events.list (of course you could leave that empty and provide everything by input node).
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 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".
Any idea what I did wrong?
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
items is empty, so you have no access to any calendar from this account.
- If you go to console and click
IAM & admin on the left, do you see
service account item in the table? (key icon, hover over to see type in string)
- now if you go to your calendar settings, can you see the exact mail in
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).
Yes, that's ok. You need a "user" to access the calender. But I thought giving the crendentials.json file to the configuration node would be enough.
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.
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.
Within the 'Scopes' field put the following:
Having all of those might be overkill for your use but that is all the Scopes for the Calendar API
many thank's that was the missing information
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:
I get this as the payload:
timeMin: "Sun Feb 17 2019 22:51:53 GMT-0500 (EST)"
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."