Looking at the DocuSign api eventNotification object, I see I can specify which events trigger a notification using the sim event model (envelope-sent, envelope-delivered, etc.) I also see the includeData section, which let's me specify what to include (documents, tabs, recipients, etc.)
What is unclear to me is how to send different data depending on the event. Can I make it so that documents and tabs are included when the envelope gets completed and exclude that info for the rest of the events?
Regarding:
What is unclear to me is how to send different data depending on the event. Can I make it so that documents and tabs are included when the envelope gets completed and exclude that info for the rest of the events?
DocuSign does not support sending different data depending on the event.
Instead, either request the most data that you'll need, and ignore unneeded data.
Or (especially if you want the envelope's documents with one or more events): After you receive a notification message, make additional API calls to retrieve the needed information from DocuSign.
To best build a reliable webhook service, I urge you to not include the document data in the notification messages. Sending POST requests to your server that include many megabytes of document data is not the best plan. Instead, call the DocuSign API when you need the envelope's documents.