Skip to content

Commit

Permalink
Merge pull request #6 from hellosign/develop
Browse files Browse the repository at this point in the history
Add support for metadata
  • Loading branch information
nathanbuchar authored Jul 30, 2019
2 parents 61322aa + f36907a commit 139d253
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/endpoints/workflow-instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ const endpoint = (client) => ({
form.append('document_delivery', 'true');
}

if (opts.metadata) {
Object.entries(opts.metadata).forEach((key, value) => {
form.append(`metadata[${key}]`, value);
});
}

return client.sendAPIRequestWithToken(basePath, {
method: 'POST',
body: form,
Expand Down
3 changes: 3 additions & 0 deletions lib/helloworks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ describe('Endpoints', () => {
mergeFields: {
signerName_28XkWu: 'Lauren Ipsum',
},
metadata: {
foo: 'bar',
},
callbackUrl: 'https://example.com/callback',
redirectUrl: 'https://example.com/success',
documentDelivery: true,
Expand Down

0 comments on commit 139d253

Please sign in to comment.