Overview: What are we talking about?
To learn more about what a webhook is, click here.
Third-party integration services (like Zapier and IFTTT) are able to receive Webhooks from Gingr and can be used to integrate with any of the thousands of apps they are integrated with. Alternatively, you can create your own web service that receives webhooks from Gingr.
This article includes:
- Activate Webhooks
- Event Types
- HMAC Signature Verification
- Response Codes
- Event Data Structure Examples
Helpful Hints: Before you begin.
- This functionality is offered by Gingr, but in many cases requires the help of a 3rd party web developer hired by your business. Our support and development teams are not able to provide guidance for implementing the following instructions.
- When you create 2nd, 3rd, etc. 'zaps' in Zapier, you will be given a new URL for each. Enter them into the Webhook URL field in Gingr (Left-hand Navigation: Admin » Custom Configurations separated by commas.
Video Tutorial: A helpful tour.
How to: Use Webhooks.
Activate Webhooks
To activate webhooks in your Gingr app, navigate to Left-hand Navigation: Admin » Custom Configurations and set a valid URL in the Webhook URL as well as a random Webhook Signature Key field.
Important! The Webhook URL field can contain multiple URLs. Separate URLs with a comma (,).
Event Types
Once webhooks are activated in your application, a HTTP(s) request will be sent to the URL configured above when one of the following event occurs with relevant data in JSON format.
Technical Event Name | Human Readable Event Name | Event Description |
check_in | Reservation checked in | This event is triggered when a reservation is checked in. |
check_out | Reservation checked out | This event is triggered when a reservation is checked out |
checking_in | Reservation checking in | This event is triggered when a user displays intent to check a reservation in. This can happen when a pet parent texts HERE to Gingr, or when an employee clicks on the check-in button from the dashboard. |
checking_out | Reservation checking out | This event is triggered when a reservation is added to the shopping cart. |
email_sent | Email sent | This event is triggered when a system generated email is sent from Gingr. |
owner_created | Owner created | This event is triggered when a new owner record is created, either from the customer portal or the app by an employee. |
owner_edited | Owner edited | This event is triggered when an existing owner record is updated, either from the customer portal or the app by an employee. |
animal_created | Animal created | This event is triggered when a new animal record is created, either from the customer portal or the app by an employee. |
animal_edited | Animal edited | This event is triggered when an existing animal record is updated, either from the customer portal or the app by an employee. |
incident_created | Incident created | This event is triggered when a new incident is created for an animal by an employee in the app. |
incident_edited | Incident edited | This event is triggered when an existing incident is updated for an animal by an employee in the app. |
lead_created | Lead created | This event is triggered when a lead form is filled out by a pet parent either using the Gingr embeddable lead capture form or from the Gingr customer portal. |
Response Code | Description | Helpful Hint |
200 | Webhook was successfully received and processed. | Gingr will not re-attempt delivery. |
403 | Your application does not want this event. | Gingr will not re-attempt delivery. |
Any other response code | Some sort of error happened. | Gingr will retry 10 times, with increasing timeout durations between each subsequent attempt. |
Email events have the following structure:
{
"webhook_url": "https://borg.gingr.io/webhooks.php", //The URL Gingr is sending this request to
"webhook_type": "email_sent", //The event type that occurred
"entity_id": 5917, //The ID of this webhook. I.e. a reservation ID
"entity_type": "owner", //The type of entity of this webhook. I.e. a reservation
"signature": "91a12089c1223b700b7afd4f86b90105285bf9d58984a7d2042fc483f3e7d4f5", //The SHA256 HMAC of the {webhook_type} {entity_id} and {entity_type} fields concatenated together using the Signature Key set in System wide Settings
"entity_data": { //The data associated with the above entity type and entity ID
"id": "5917",
"first_name": "Mickey",
"last_name": "Mouse",
"address_1": "841 Lookout Rd",
"address_2": null,
"city": "Winston Salem",
"state": "North Carolina",
"zip": "27104",
"email": "demo@gmail.com",
"home_phone": "(303) 555-5555",
"cell_phone": "(303) 555-5555",
"emergency_contact_name": "",
"emergency_contact_phone": "",
"notes": null,
"default_payment_method_fk": null,
"home_location": "2",
"opt_out_email": "0",
"opt_out_sms": "0",
"opt_out_marketing_email": "0",
"opt_out_marketing_sms": "0",
"opt_out_photo_sharing": "0",
"opt_out_reminder_email": "0",
"opt_out_reminder_sms": "0",
"current_balance": "-2.56",
"latitude": "35.23509",
"longitude": "-75.1280061",
"stripe_customer_id": null,
"stripe_default_card": null,
"payment_processor_id": "1",
"key": "576bf720b3b6a",
"barcode": null,
"allow_online_login": "1",
"created_at": "1361422800",
"created_by": null,
"kl_owner_id": "1002782-2",
"form_token": "577fd1f2c5347"
},
"email_data": { //The data for the email that was sent
"subject": "Test email subject",
"value": "<p>Test email message</p><div style=\"line-height: 22.2222px;\"><br></div>"
},
"recipients": [ //The recipients of this email
{
"name": "Mickey Mouse",
"email": "demo@gmail.com"
}
]
}
Comments
0 comments
Article is closed for comments.