Skip to main content
Blog
Home/

Replaying webhook messages with Postman

Author Ivan Dinkov
Ivan DinkovSr. Developer Support Advisory Engineer
    • How does it work?
    • The problem
    • The answer: replaying notifications with Postman
    • Summary
    • Additional resources

    Table of contents

    en-US

    Docusign Connect is the webhook feature for Docusign’s eSignature product. In your eSignature Admin panel, you can specify for which envelope event or events to notify your application. When an envelope event occurs, Docusign Connect will notify your application: Connect as the client will make an HTTPS request to your application’s webhook URL.

    How does it work?

    You provide a publicly accessible HTTPS URL that can be accessed from the internet and the event types to trigger the notification. For example, your application can be notified when the envelope is complete—all signers have signed, copies have been sent to all cc recipients, etc.

    One possible solution (recommended) is to use a Platform-as-a-Service (PaaS) system as an intermediate queuing system. This solution enables your production and localhost development machines to pull notifications from the queue from behind your firewall. See the blog post Building best practices webhook listeners, part 4 for more information.

    Another solution is to build your own custom listener implementation, which usually needs firewall changes to be available from the public internet.

    The problem

    You are developing your application on your development machine (http://localhost), but since your machine is not on the public internet, how can you test your application with incoming webhook notifications from Docusign?

    The answer: replaying notifications with Postman

    Postman can be used to mimic the notifications received from Docusign. Since Postman runs on your development machine, it can also make HTTP or HTTPS calls to your application running on localhost.

    To send messages with Postman, first use webhook.site to record a notification from Docusign and then export the received notification message as CURL instructions:

    1. Go to webhook.site to get a unique URL that you’ll use as the destination URL for your webhook.

    2. Using the Docusign eSignature Admin (settings) tool, set your webhook to use the URL from step 1 for your webhook.

    3. Configure the event triggers, such as “Envelope Send,” that you want to test.

    4. Create and send an envelope.

    5. On the webhook.site dashboard, you will see your incoming webhook notification messages:

      webhook.site incoming webhook notification

    6. Click export as and select curl.

    7. Open your Postman application and import the exported Curl script by selecting File > Import > Raw Text and paste the Curl script.

    Paste the curl script into Postman

    Voila! You have a duplicate of the Docusign notification message in Postman (including headers) of the webhook notification from Docusign.

    Now you can fire Postman HTTP or HTTPS requests against localhost and test your code, simply by setting the request type to “POST”, Request Url to localhost:8080 (or the address your web server is listening to) and click Send.

    Firing the webhook request in Postman

    Summary

    Replaying Connect notifications via Postman helps speed development and testing of webhook applications. This technique includes header values, so it can be used to test HMAC verification as well.

    Additional resources

    Author Ivan Dinkov
    Ivan DinkovSr. Developer Support Advisory Engineer
    More posts from this author

    Related posts

    • Docusign 2024 Release 3: Capture the Critical Business Value Hidden in Your Agreements
      Intelligent Agreement Management

      Docusign 2024 Release 3: Capture the Critical Business Value Hidden in Your Agreements

    • How to improve your app’s UX while users wait for API calls to complete

      How to improve your app’s UX while users wait for API calls to complete

      Author Larry Kluger
      Larry Kluger
    • Trending Topics: Latest from our forums (November 2024)
      Author Paige Rossi
      Paige Rossi
    How to improve your app’s UX while users wait for API calls to complete

    How to improve your app’s UX while users wait for API calls to complete

    Author Larry Kluger
    Larry Kluger
    Trending Topics: Latest from our forums (November 2024)
    Author Paige Rossi
    Paige Rossi

    Discover what's new with Docusign IAM or start with eSignature for free

    Explore Docusign IAMTry eSignature for Free
    Person smiling while presenting