-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-webhook.js
33 lines (30 loc) · 916 Bytes
/
test-webhook.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import fetch from 'node-fetch';
const testWebhook = async () => {
try {
const response = await fetch('https://microgrants-streamer.vercel.app/api/docusign/connect', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
event: 'envelope-completed',
apiVersion: 'v2.1',
uri: '/restapi/v2.1/accounts/test-account/envelopes/test-envelope',
retryCount: 0,
configurationId: 12345,
generatedDateTime: new Date().toISOString(),
data: {
accountId: 'test-account',
userId: 'test-user',
envelopeId: 'b823ec9f-fe53-4107-a3a3-1832bf2d88af'
}
})
});
const data = await response.text();
console.log('Status:', response.status);
console.log('Response:', data);
} catch (error) {
console.error('Error:', error);
}
};
testWebhook();