Hello there,
I am fairly new to this. I am trying to create a workflow from google calendar to node.js [to record an event when it starts]. Means getting the information about a meeting from google calendar api and when it starts I record using node.js code:
Here is the code I have used:
import axios from “axios”;
export default defineComponent({
async run({ steps, $ }) {
// Replace ‘primary’ with the actual calendar ID and specify the event ID
const calendarId = ‘steps.trigger.context.id’;
const eventId = ‘steps.trigger.context.ts’;
const apiKey = ‘’; // Use an API key or OAuth 2.0 token as per your setup
const url = https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events/${eventId}?key=${apiKey}
;
try {
const response = await axios.get(url); // Adjust HTTP method and body as needed for your specific call
return response.data; // The API response
} catch (error) {
console.error("Error accessing Google Calendar API:", error);
return { error: error.message };
}
},
});
The Error Number I am getting is this:
steps.code.$return_value.error -
error:
Request failed with status code 400
Any guidance will greatly appreciated.
Cheers