Web Hooks
What is a webhook?
A webhook is the TallyMarks platform making an HTTP/S request to your application’s API when an event occurs. This way TallyMarks is able to notify you when an event occurs and your application doesn’t have to poll the TallyMarks API to determine that something has taken place.
Protecting webhooks
For TallyMarks to access your application, you will need a publicly accessible URL. You will want to protect this URL so that malicious actors cannot manipulate your data.
Basic HTTP authentication
Another easy way to protect your API is through basic HTTP authentication. Almost all web servers can be configured to require a user name and password for access to a URL. You can configure your webhook URL with basic HTTP authentication by adding the user name and password to the URL https://yourapi.com/ webhook and setting the result as the webhook URL
Http Headers
The TallyMark's console supports the addition of Http Headers to its Web Hook calls, you may with to configure API keys or similar header elements to secure you API.
Web Hook Body
The web hook body can be populate with elements from the customer and event using handle bars syntax (https://handlebarsjs.com/guide/) of the event and associated customer and customer points balance triggering the web hook to be executed, for example:
Testing your webhook
Testing webhooks can be a difficult process.
The TallyMark's console includes the ability to execute a test web hook call against your web hooks with a sample payload.
Last updated