Although technically speaking, the DocuSign REST API supports both XML format and JSON format, a majority of the DocuSign REST API documentation, code samples, and developer resources are in JSON. Unfortunately that means trying to use XML format with the DocuSign REST API (to do anything beyond the very basic tasks) can be extremely frustrating -- because when your XML request doesn't work as expected, you have virtually no resources to figure out what the correct format is.
For that reason, I'd recommend that you consider using JSON instead of XML with the DocuSign REST API. Here's a JSON request that successfully creates the notification for the envelope.
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"roleName": "Signer1",
"name": "John Doe",
"email": "johnsemail@outlook.com"
}
],
"eventNotification": {
"url": "http://www.google.com",
"loggingEnabled": "true",
"requireAcknowledgement": "true",
"includeDocuments" : "false",
"envelopeEvents" : [{
"envelopeEventStatusCode" : "completed"
}]
},
"status": "sent"
}
UPDATE: Using information provided by Ergin below, I was able to get this to work using XML -- the key is to use uppercase for both 'Envelope' and 'Events' in the EnvelopeEvents element. Here's an example of a request that successfully triggers the Connect notification:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>ACCOUNT_ID</accountId>
<status>sent</status>
<templateId>TEMPLATE_ID</templateId>
<templateRoles>
<templateRole>
<email>johnsemail@outlook.com</email>
<name>John Doe</name>
<roleName>Signer1</roleName>
</templateRole>
</templateRoles>
<eventNotification>
<EnvelopeEvents>
<envelopeEvent>
<envelopeEventStatusCode>completed</envelopeEventStatusCode>
</envelopeEvent>
</EnvelopeEvents>
<includeDocuments>false</includeDocuments>
<loggingEnabled>true</loggingEnabled>
<requireAcknowledgement>true</requireAcknowledgement>
<url>http://www.google.com</url>
</eventNotification>
</envelopeDefinition>