-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathviewDocumentGroup.js
42 lines (36 loc) · 1020 Bytes
/
viewDocumentGroup.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
34
35
36
37
38
39
40
41
42
'use strict';
const signnow = require('@signnow/api-client')({
credentials: 'BASE64_ENCODED_CLIENT_CREDENTIALS',
production: true, // if false then uses eval server
});
const viewDocumentGroup = signnow.documentGroup.view;
const id = 'DOCUMENT_GROUP_ID_GOES_HERE';
const token = 'YOUR_ACCESS_TOKEN';
/**
* Document Group view response data
* @typedef {Object} DocumentGroupViewResponse
* @property {string} id - an ID of Document Group
* @property {string} group_name - a name of Document Group
* @property {Object[]} documents - each single document details
* @property {?string} invite_id - an ID of active invite
* @property {Object[]} originator_organization_settings - originator organization settings
*/
/**
* @param {DocumentGroupViewResponse} res
*/
const handleResponse = res => {
console.log(res);
};
const handleError = err => {
console.error(err);
};
viewDocumentGroup({
id,
token,
}, (err, res) => {
if (err) {
handleError(err);
} else {
handleResponse(res);
}
});