HTTP Webhook Integration Guide Print

  • 1

This guide explains how to set up your HTTP endpoint so we can push live delivery, bounce, and defer logs directly to you.

1. Submit Important Information (click here)

1.1. Provide Endpoint URL

Full HTTPS URL you’d like us to POST to.

  • Example: https://your-domain.com/webhook/ipwarmup?token=ABC123

  • We’ll attach the URL (including your token) to your account.

1.2. Choose Data Format

We support two formats—just tell us your preference:

  • NDJSON (newline-delimited JSON)

    • Content-Type: application/x-ndjson

    • Easy to parse line-by-line in any language.

  • CSV

    • Content-Type: text/csv

    • Good if you plan to import into spreadsheets or BI tools.

1.3. Select Events to Receive

Let us know which event types you want:

  • Deliveries Only

  • Bounces Only

  • Deferrals Only

  • All of the above

We’ll configure your feed so only the selected events get POSTed.

 

2. Testing & Verification

  1. Staging a Test Payload
    We can push a small test record whenever you’re ready—just let us know.

  2. Successful Response
    Your endpoint must return HTTP 2xx for each POST to acknowledge receipt.

  3. Error Handling

    • Any non-2xx response triggers automatic retry after a short delay.

    • If no data is sent within 5 minutes, we’ll POST an empty heartbeat payload so you know the connection is alive.

 

3. Sample Receiver Script (PHP)

<?php
// webhook_receiver.php

// 1) Validate token
if ($_GET['token'] !== 'ABC123') {
http_response_code(403);
exit('Forbidden');
}

// 2) Read raw POST body
$raw = file_get_contents('php://input');
if (trim($raw) === '') {
http_response_code(204); // no content
exit;
}

// 3) Process NDJSON or CSV
$contentType = $_SERVER['CONTENT_TYPE'] ?? '';
if (strpos($contentType, 'ndjson') !== false) {
$lines = explode("\n", trim($raw));
foreach ($lines as $line) {
$rec = json_decode($line, true);
// Your logic here: insert into DB, log to file, etc.
}
} else {
// CSV: first line is header
$rows = array_map('str_getcsv', explode("\n", trim($raw)));
$header = array_shift($rows);
foreach ($rows as $row) {
$rec = array_combine($header, $row);
// Your logic here
}
}

// 4) Acknowledge success
http_response_code(200);
echo "OK";

Note: Adapt the token check, storage, and parsing logic to your environment.

 

Need Help?

If anything doesn’t work as expected—missing fields, authentication errors, or empty payloads—reach out to our support team with:

  • Your endpoint URL

  • Preferred format (NDJSON or CSV)

  • Desired event types

 

We’ll verify your configuration on our side to confirm everything is parsed correctly.


Was this answer helpful?

« Back