How to set up custom integrations with Webhooks

Anedot programmatically posts donation data to other applications in realtime when there's a change in your account.

Webhooks allow an application to be notified of changes in Anedot. They are intended to provide an efficient way for integrations which react to changes of state in Anedot to take action only when something has actually changed.

How to set up a Webhook

  1. Visit your Account Settings page
  2. Select Webhooks under the Integrations section.
  3. Add the appropriate endpoint URL to accept POST JSON requests.

Note

Signatures are provided for each webhook request to verify the authenticity of the request. Verify the signature by producing a SHA-256 HMAC hexdigest using the webhook's secret token as the private key and the webhook body represented as a JSON string. The hexdigest you calculate should match the value in our "X-Request-Signature" header for that webhook request.

Webhook Example

Anedot Webhooks deliver a default payload similar to this example.

{

"uid": "xxxxxxxxxxxx",
"name": "John Smith",
"amount_in_dollars": 110.75,
"event_amount": 110,75,
"source": "cash",
"source_code": null,
"origin": "api",
"date": "2016-03-26T03:29:27.234Z",
"processed_date": "2017-03-01T03:29:27.234Z",
"status": "completed",
"donor_type": "individual",
"organization_name": null,
"recurring": false,
"frequency": "Once",
"email": null,
"title": null,
"first_name": "John",
"middle_initial": null,
"last_name": "Smith",
"suffix": null,
"address": {
  "street": "1 Broadway",
  "street_2": null,
  "city": "New York",
  "state": "NY",
  "zip": "70119",
  "country": "US"
},
"street": 1 Broadway,
"street_2": null,
"city": New York,
"state": NY,
"zip": 70119,
"country": "US",
"phone": null,
"employer": null,
"occupation": null,
"comments": null,
"check_number": null,
"custom_fields": null,
"items": [
  {
    "amount": 10.25,
    "campaign_item_uuid": "18640c5a-516e-46a2-91c4-05f5633a1773",
    "description": null,
    "name": "Victory Fund",
    "quantity": 1,
    "total": 10.25,
    "type": "amount",
    "uuid": "3edf6a00-49ab-4ef3-baaa-0c0a673c3861"
  },
  {
    "amount": 50.25,
    "campaign_item_uuid": "f2387aca-41a6-4ee3-aaed-769c0381fba6",
    "description": null,
    "name": "Seats",
    "quantity": 2,
    "total": 100.5,
    "type": "quantity",
    "uuid": "5ac5fe0a-5522-4339-bc63-6b7d3fe9ce08"
  }
]
}

Available custom template fields

Use these fields to develop custom templates.



{
"account_directory_name": "{{account_directory_name}}",
"account_name": "{{account_name}}",
"account_uid": "{{account_uid}}",
"address": "{{address}}",
"amount": "{{amount}}",
"campaign_identifier": "{{campaign_identifier}}",
"campaign_name": "{{campaign_name}}",
"campaign_uid": "{{campaign_uid}}",
"card_last_digits": "{{card_last_digits}}",
"card_type": "{{card_type}}",
"check_number": "{{check_number}}",
"address": {
"street": "{{street}}",
"street_2": "{{street_2}}",
"state": "{{state}}",
"city": "{{city}}",
"zip": "{{zip}}",
"country": "{{country}}"
},
"comments": "{{comments}}",
"commitment_index": "{{commitment_index}}",
"commitment_recurring_until": "{{commitment_recurring_until}}",
"commitment_recurring_until_iso8601": "{{commitment_recurring_until_iso8601}}",
"commitment_uid": "{{commitment_uid}}",
"created_at": "{{created_at}}",
"created_at_iso8601": "{{created_at_iso8601}}",
"credit_card_expiration": "{{credit_card_expiration}}",
"custom_field_multi_term_key": "{{custom_field_multi_term_key}}",
"custom_field_single_term_key": "{{custom_field_single_term_key}}",
"custom_fields": "<<custom_fields>>",
"date": "{{date}}",
"date_iso8601": "{{date_iso8601}}",
"donor_type": "{{donor_type}}",
"email": "{{email}}",
"employer": "{{employer}}",
"employer_address": "{{employer_address}}",
"employer_city": "{{employer_city}}",
"employer_state": "{{employer_state}}",
"employer_zip": "{{employer_zip}}",
"event_amount": "{{event_amount}}",
"first_name": "{{first_name}}",
"frequency": "{{frequency}}",
"items": "<<items>>",
"last_name": "{{last_name}}",
"legal": "{{legal}}",
"middle_initial": "{{middle_initial}}",
"mobile_phone": "{{mobile_phone}}",
"originating_uid": "{{originating_uid}}",
"payment_method_type": "{{payment_method_type}}",
"name": "{{name}}",
"occupation": "{{occupation}}",
"organization": "{{organization}}",
"origin": "{{origin}}",
"phone": "{{phone}}",
"recurring": "{{recurring}}",
"referred_by": "{{referred_by}}",
"referrer": "{{referrer}}",
"referrer_to_form": "{{referrer_to_form}}",
"source": "{{source}}",
"source_code": "{{source_code}}",
"source_description": "{{source_description}}",
"status": "{{status}}",
"suffix": "{{suffix}}",
"title": "{{title}}",
"uid": "{{uid}}",
"updated_at": "{{updated_at}}",
"updated_at_iso8601": "{{updated_at_iso8601}}",
"upsell_type": "{{upsell_type}}",
"upsold_from_donation_uid": "{{upsold_from_donation_uid}}",
"utm_campaign": "{{utm_campaign}}",
"utm_content": "{{utm_content}}",
"utm_medium": "{{utm_medium}}",
"utm_source": "{{utm_source}}",
"utm_term": "{{utm_term}}"
}