🕸️🪝 Webhooks are available on all paid plans.
A webhook is the act of Submit JSON making an HTTP POST
request to an external API when a submission occurs. This way Submit JSON is able to immediately notify you and your services, and your application doesn’t have to perform complicated polling of our API to determine if a submission happened.
Testing webhooks can be a difficult process. Here are some recommendations from Submit JSON.
When creating or updating a webhook you can send HTTP POST
requests to your webhook destination with custom headers. Simply click the "test webhook" button to fire a test off.
A great tool for dealing with APIs (and many other things) is curl. In this context, you can use curl to make HTTP requests to your API in the same way that Submit JSON would make requests to your API. You can find an example curl call below.
curl <your-url> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"createdAt": "2023-11-28T03:23:07.668Z",
"data": {
"example": "Webhook Test",
"example2": 1234
},
"emailNotification": false,
"endpointName": "Your Endpoint",
"endpointSlug": "XxXxXxXx",
"seenAt": null,
"submissionId": "xxx-xxx-xxx-xxx-xxx",
"submissionFormat": "pretty",
"submissionSound": "coin"
}'
Ngrok is a great tunneling service to create a live https url to localhost.
RequestBin is a great service to inspect HTTP requests. You can create a temporary RequestBin URL and use the temporary URL as your webhook URL in Submit JSON. RequestBin will then record the HTTP requests and allow you to inspect the HTTP requests to verify headers, JSON bodies, and other information about the request. This will provide you with information about the HTTP requests used in the webhook if you don’t have a public URL set up yet and want to start developing right away.