Question about Pipedream - considering using Pipedream

I am looking for a service that will collect webhook information from my Sendinblue account and make it available to me via an API once a day. Is that a service that pipedream can provide. Is there a charge for Pipedream?

Welcome @parellifoundation100 ! Yes, there are a few ways you could accomplish this. Pipedream is currently free for up to 100,000 invocations (number of events processed through a workflow) per month. See our pricing page for more information.

The easiest way to solve your problem is to create an HTTP event source. This will generate an HTTP endpoint that you can deliver Sendinblue events to, and automatically expose the HTTP payloads via a Pipedream API for later retrieval.

Visit https://pipedream.com/sources, and click the New button in the top-right to create a new source. Select the HTTP / Webhook app. You can choose to either log the entire HTTP request (body, URL, method, etc.) using the New Requests source, or just log the request body using the New Request (Payload Only) option. I’ll use the latter in this example.

Create the source, and Pipedream will generate a unique HTTP endpoint URL for you. Add this to your Sendinblue webhook configuration, and generate an event from your Sendinblue account. You should see that event arrive in the left section of your event source in Pipedream’s UI, and can click on that event to manually inspect it. In this case, we receive the HTTP request and “emit” the payload:

You’ll also see an Integrations section in the UI for your source. If you click on the API header within that section:

you’ll see examples of how to pull events emitted by this source (any payloads you’ve received on this endpoint). For example, you can pull the last 100 events from the source like so:

curl -H "Authorization: Bearer <API_KEY>" \
  "https://api.pipedream.com/v1/sources/dc_abc123/event_summaries?expand=event"

You can learn more about pulling event data using the REST API here.

You can also create a Pipedream workflow that runs for every webhook sent from Sendinblue. Workflows can run any Node.js code or connect to hundreds of API integrations, so if you wanted to log the HTTP payload to another system, or save the payload to Google Sheets (for example), that’s all possible with a workflow.

Let me know if that helps and if you have any additional questions.

I hope this thread is still active. I am finally getting around to implementing this solution. I can’t believe how easy it is. SendInBlue is suggesting: " Once you have tested your notify URL properly receives webhook notifications from Sendinblue , you might want to make sure it’s not accessible in the web to other parties. To achieve this you need to apply a whitelist rule to Sendinblue’s IP addresses : First IP address: 185.107.232.0
Last IP address: 185.107.232.255". Your documentation suggests that I should contact you to find the best way to do this.

@parellifoundation100 yes, this is possible. Pipedream doesn’t operate a user-configurable firewall that would allow you to block this traffic completely, but we can prevent these HTTP requests from being emitted from the event source (which means they wouldn’t show up in your list of events, or via API).

Above the list of events in your event source, you’ll see a Configuration tab. Click that, then replace the code you see there with this:

const http_app = require('../../http.app.js')
const { isInSubnet } = require('is-in-subnet');

// Core HTTP component
// Returns a 200 OK response, emits the HTTP payload as an event
module.exports = {
  key: "http-new-requests-payload-only",
  name: "New Requests (Payload Only)",
  description: "Get a URL and emit the HTTP body as an event on every request",
  version: "0.0.2",
  props: {
    http: {
      type: "$.interface.http",
      customResponse: true,
    },
    http_app,
  },
  async run(event) {
    const ip = event.headers['x-forwarded-for']
    if (!isInSubnet(ip, ["185.107.232.0/24"])) {
      console.log(`IP ${ip} not allowed`)
      return
    }
    const { body } = event;
    this.http.respond({
      status: 200,
      body
    });
    // Emit the HTTP payload
    this.$emit({ body });
  }
};

This is the relevant part of the code:

const ip = event.headers['x-forwarded-for']
if (!isInSubnet(ip, ["185.107.232.0/24"])) {
  console.log(`IP ${ip} not allowed`)
  return
}

event.headers['x-forwarded-for'] contains the client IP address of the incoming request. We ask: “is that address in the 185.107.232.0/24 subnet?” (defines the range you noted above). If it is, we move on and emit the event. Otherwise, we log the IP address and return; in this case, we do not emit the event, so again, it won’t appear in your event data.

Let me know if that helps!

1 Like

By the way, if you’re sending test requests to the event source that arrive from your IP address (for example), you can add other IPs to that list:

if (!isInSubnet(ip, ["185.107.232.0/24", "1.2.3.4/32", ...])) {

See the is-in-subnet docs for more information on usage.