Nothing at all or just no results?
There should be no results but under links a long list of API end points
Weird your previous picture shows timestamp?? but that one looks good.
Here is a quick flow I threw together, modify the API for your log types and enter your calendar ID in the credentials node. It’s just a rough example and needs a little more work, it will create duplicate calendar entries if it is run more than once. There is a few possible solutions, but try it and see if it works first. Probably a good idea to have a “Test” calendar.
[
{
"id": "bd36b327375f5e3f",
"type": "inject",
"z": "03ce168ba8e7e926",
"name": "",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 90,
"y": 180,
"wires": [
[
"5ec60f1ab3da0cc2"
]
]
},
{
"id": "5ec60f1ab3da0cc2",
"type": "sf:949541c9b70110d5",
"z": "03ce168ba8e7e926",
"name": "",
"API": "log/observation?filter[status]=pending",
"Method": "GET",
"x": 250,
"y": 180,
"wires": [
[
"53819989470988cf"
]
]
},
{
"id": "05c03b2077ab988b",
"type": "function",
"z": "03ce168ba8e7e926",
"name": "POST Calendars",
"func": "var token = global.get('Google_token');\nvar name = msg.payload.name\nvar notes = msg.payload.notes\nvar timestamp = msg.payload.timestamp\nvar date = timestamp.substring(0, 10);\n\nmsg.headers = {};\nmsg.headers['Authorization'] = \"Bearer \"+token;\nmsg.headers['Accept'] = \"application/json\";\nmsg.headers['Cache-Control'] = 'no-cache';\n\nmsg.url = \"https://www.googleapis.com/calendar/v3/calendars/\" + msg.calendar + \"/events\";\nmsg.method = \"POST\";\n\nmsg.payload = {\n \"end\": {\n \"date\": date\n },\n \"start\": {\n \"date\": date\n },\n \"description\": notes,\n \"summary\": name\n};\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 260,
"wires": [
[
"f6e125f66b856ce7"
]
]
},
{
"id": "f6e125f66b856ce7",
"type": "http request",
"z": "03ce168ba8e7e926",
"name": "",
"method": "use",
"ret": "obj",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"x": 590,
"y": 260,
"wires": [
[
"ee884d093860e958"
]
]
},
{
"id": "ee884d093860e958",
"type": "debug",
"z": "03ce168ba8e7e926",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 770,
"y": 260,
"wires": []
},
{
"id": "ff355d077cdaa495",
"type": "credentials",
"z": "03ce168ba8e7e926",
"name": "Calendar ID",
"props": [
{
"value": "calendar",
"type": "msg"
}
],
"x": 190,
"y": 260,
"wires": [
[
"05c03b2077ab988b"
]
]
},
{
"id": "53819989470988cf",
"type": "function",
"z": "03ce168ba8e7e926",
"name": "",
"func": "msg.payload.data.forEach(data => {\n msg.payload.name = data.attributes.name;\n msg.payload.timestamp = data.attributes.timestamp;\n msg.payload.notes = data.attributes.notes;\n node.send(msg)\n })\n\nreturn;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 420,
"y": 180,
"wires": [
[
"ff355d077cdaa495"
]
]
}
]