In aws pinpoint (NodeJS) how to trigger a email when custome event trigger by user - node.js

I am working on a NodeJs API which send a mail when New user added in AWS Pinpoint.
I need to trigger a mail when new user add in AWS Pinpoint or sign-in attempts or some transaction happens or credit in his/her account is less than 5.
I have already created a API which add and update user in AWS pinpoint as endpoints.But I stuck in, how to create a custom event which automatically do this task after updating the endpoint in AWS pinpoint.
I have referred https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Pinpoint.html link while trying to create custom event. But no proper solution found

you should only send an event, in the EndpointUser part of the payload, put your new user details, it will update the endpoint and will fire event, which you can catch with a campaign

Related

Deleting Events using Google API - Notifications 'From' coming from Admin account

I am currently working on a nest JS project that leverages the google node package to delete an event from a users calendar (gcal). Gcal successfully deletes the meeting, but the deletion notification to attendees comes from the administration account the api uses to connect.
Is there a way to alias the notification that is sent out to attendees so it looks like the owner of the calendar sent out the notification, not the google api administrator?
node package
https://www.npmjs.com/package/google
google api delete docs
https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete
This is the code snippet
// https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete
await this.calendar.events.delete({
calendarId,
eventId,
sendNotifications: true,
sendUpdates: 'all',
});
Google Calendar will trigger the respective notifications based on the authenticated actor.
In your scenario, that will be "administration account the api uses to connect".
If you are using this automation script in a Workspace Environment, you may want to impersonate another user (like the event organizer for example) to delete the event.
To achieve that in a Workspace scenario, you will need Domain-Wide Delegation of Authority set up.
NOTE: Make sure the authenticated user (and/or the actor of the delete call) has enough permissions over the affected event in order to delete it or use an account with Calendar Admin role (or Super Admin).

How to reply a custom header using a webhook triggered by an API

I need to know what am I doing wrong with my integration. I will explain first our main goal.
We need to detect new synced projects or created projects on Everhour API using a webhook.
Use that webhook to trigger automation on Zapier and do other APIs we need to do.
The process of creating a webhook using their API is like this:
Use the create a webhook endpoint ( link )
Pass the custom webhook(I created on Pipedream with custom header)
The Everhour API requirements say that I need to reply back a custom header of "X-Hook-Secret ":
So far I have created a webhook on Pipedream which you can create a custom header response see reference here:
This is the request body from the Everhour API to create a webhook, I passed in the Pipedream's custom webhook created.
Now, the problem is when I create a new project on Everhour the webhook doesn't get triggered. I don't know if it's because of the custom webhook from Pipedream that I miss something or else others.
Any useful tips will be a huge help.

Change Stripe example email in webhooks triggers

I want to be able to pass an email into the webhook I trigger. I have a setup where after a user pays I want to update their record on Mailchimp. To properly test this without pushing to production (or running a local server open to the internet) I need to pass an email to stripe trigger checkout.session.completed so that it can find an email in Mailchimp. Right now the email is always stripe#example.com.
It's not possible to pass in custom data to stripe-cli triggers currently. Instead you probably want to use a service like ngrok.io to test this in a local environment.

Google Directory API users endpoint sometimes doesn't return orgUnitPath

I have setup watch channels for the User resource via the Google Directory API to receive push notifications when the resource changes or is created.
When my app receives a notification, it reads the e-mail of the user which was changed/created, then calls the users.get endpoint of the Directory API to get the latest data for that user and finally updates my database with that data.
In most cases this flow works fine, but I've observed that every now and then when a new user is created, the response from the users.get endpoint does not include the orgUnitPath property. It's not set to null, it's not even there. However, if I hit the endpoint again a while later, the property is there.
Does anyone know why this happens?

Google Calendar live sync with node js app

I want to sync google calendar with my app.
When user add some event in the Google calendar at that time, I want these new event in my node server response
Means live sync with google calendar.
I want something like listener that listen new event.
With Google Calendar API you can watch for changes to Events or CalendarList resources, see this and this. Basically you will need to create an endpoint on your server which will receive events/calendars update notifications. When notification arrives, request a calendars/events synchronization. To make the synchronization efficient, use incremental sync. Check this question also to see the algorithm.
You may check this Quickstart tutorial and node-google-calendar.
You need to create a service account if you don't have one. A public/private key pair is generated for the service account, which is created from the Google API console. Take note of the service account's email address and store the service account's json or P12 private key file in a location accessible to your application. Your application needs them to make authorized API calls. If a user wants to give access to his Google Calendar to your application, he must give specific permission for each of the calendars to the created Service Account using the supplied email address under the Google Calendar settings.

Resources