Webhook Sandbox Testing

After you've configured your system to receive Branch Webhook notifications, you can use the Branch sandbox environment to manually trigger and test webhooks.

Prerequisites

  • Two api keys. See Webhook Security for more details.
  • Organization ID
  • The name of the webhook you want to test. For example, ACCOUNT_VERIFIED_AS_WORKER

NOTE: When you manually trigger webhooks in the sandbox, it will autogenerate values for response fields that you do not provide in the data block of your request. For example, if you omit employee_id from the request shown below, Branch will send a webhook with employee_id: 1inserted.

Testing

Starting with this API Post template, modify it by inserting your org ID, webhook type, and apiKey where indicated in the template:

curl --location --request POST 'https://sandbox.branchapp.com/v1/organizations/<your_org_id>/webhooks/<webhook_type>' \
--header 'apiKey: <your api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "employee_id": 123,
    "account_number": 123,
    "routing_number": 123
}'

Using cURL

To test a Webhook from a terminal or command prompt, paste the code above with your details inserted into the terminal or prompt window.

For example, to trigger an ACCOUNTVERIFIED_AS_USER webhook in a case where your org ID is _999, the employee ID you're checking 123, and your api key abcdefghijklmnopqrstuvwxyz, your code would look like this:

curl --location --request POST 'https://sandbox.branchapp.com/v1/organizations/999/webhooks/ACCOUNT_VERIFIED_AS_USER' \
--header 'apiKey: abcdefghijklmnopqrstuvwxyz' \
--header 'Content-Type: application/json' \
--data-raw '{
    "employee_id": 123,
    "account_number": 123,
    "routing_number": 123
}'

If you receive any errors in return, check your details for accuracy or troubleshoot any security or access issues. A successful call will not return anything in the terminal, since the goal is to trigger a webhook event being sent to your system.

Using Postman

If you want to test webhooks using Postman, follow these steps.

  1. Open a Postman collection and select New Request.
  2. Enter the POST URL from the code template as shown in the image below.
  3. Click the Authorization tab.
  4. Next to Type, use the drop-down menu to select Api Key.
  5. Next to Key, enter apiKey in the field.
  6. Next to Value enter your API key in the field.
  7. Leave Add to set to Header.
img
  1. Click the Body tab.
  2. Select the raw button.
  3. Paste the body of your request as shown here. Only insert the lines enclosed in curly brackets, don't include other lines from the curl request.
img

If your POST is successful, Status: 200 OK appears at the bottom right, or if there are errors you see an error response.