Appearance
Setting Up a Custom Webhook Integration
Overview
This document provides technical specifications for integrating with our webhook endpoint to trigger direct mail campaigns.
Endpoint Details
- URL:
https://integrations.navistone.com/feed
- Method: POST
- Content-Type: application/json
- Authentication: API Key (required in header)
Authentication
Include your API key in the request headers, formatted as:
api_key: YOUR_API_KEY
Request Body
The webhook expects a JSON payload with the following schema:
json
{
"action": "triggerdm",
"campaign_id": "string",
"first_name": "string",
"last_name": "string",
"address_line_1": "string",
"address_line_2": "string", // Optional
"city": "string",
"state": "string",
"postal_code": "string",
"reference_id": "string"
}
Field Descriptions
- action: Static value; must be
"triggerdm"
. - campaign_id: Unique identifier for your campaign (provided by NaviStone).
- first_name: Customer's first name.
- last_name: Customer's last name.
- address_line_1: Primary address line.
- address_line_2: Secondary address line (optional).
- city: City name.
- state: Two-letter state code.
- postal_code: ZIP/Postal code.
- reference_id: Unique identifier for the customer in your system.
Example Payload
json
{
"action": "triggerdm",
"campaign_id": "bdb43bb4-8344-4995-9072-59be7a3f8dc6",
"first_name": "John",
"last_name": "Doe",
"address_line_1": "1234 Main St",
"address_line_2": "Unit 2",
"city": "Cincinnati",
"state": "OH",
"postal_code": "45202",
"reference_id": "0987654321"
}
Implementation Notes
- Dynamic Data Mapping:
- Replace placeholder values with dynamic variables from your system.
- Example: If your system uses
user.first_name
, map it accordingly in the payload.
- Campaign ID: Ensure each campaign uses a unique campaign ID.
- Reference ID: Use a unique identifier for each customer.
Testing and Error Handling
- Use a tool like Postman to test the endpoint with sample payloads.
- Steps for Postman Testing:
- Open Postman and create a new request.
- Set the method to POST and paste the endpoint URL.
- Add the API key in the headers section (
api_key: YOUR_API_KEY
). - In the Body tab, paste your JSON payload and set the content type to JSON.
- Click "Send" and monitor the response.
- Steps for Postman Testing:
- Common Errors:
- HTTP 400: Invalid payload.
- HTTP 401: Unauthorized (check API key).
- HTTP 500: Server-side issues (contact support).