Docusign Document blank after API call
up vote
0
down vote
favorite
Im making a call via Request to docusign like so:
var options = {
method: 'GET',
url: `${baseUrl}/envelopes/${envelopeId}/documents/${documentId}`,
headers: headers,
qs: {
encoding: 'base64'
}
};
request(options, function (error, response, body) {
...
})
Im getting back the document string but when I write it to a .pdf I get 4 blank pages. Here is the code im using to write it to a file:
fs.writeFile('cert.pdf', body, (err) => {
if(err) throw new Error(err)
})
Nodejs -v 8.11.1
node.js docusignapi
add a comment |
up vote
0
down vote
favorite
Im making a call via Request to docusign like so:
var options = {
method: 'GET',
url: `${baseUrl}/envelopes/${envelopeId}/documents/${documentId}`,
headers: headers,
qs: {
encoding: 'base64'
}
};
request(options, function (error, response, body) {
...
})
Im getting back the document string but when I write it to a .pdf I get 4 blank pages. Here is the code im using to write it to a file:
fs.writeFile('cert.pdf', body, (err) => {
if(err) throw new Error(err)
})
Nodejs -v 8.11.1
node.js docusignapi
stackoverflow.com/questions/31040014/…
– JM-AGMS
Nov 19 at 20:41
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Im making a call via Request to docusign like so:
var options = {
method: 'GET',
url: `${baseUrl}/envelopes/${envelopeId}/documents/${documentId}`,
headers: headers,
qs: {
encoding: 'base64'
}
};
request(options, function (error, response, body) {
...
})
Im getting back the document string but when I write it to a .pdf I get 4 blank pages. Here is the code im using to write it to a file:
fs.writeFile('cert.pdf', body, (err) => {
if(err) throw new Error(err)
})
Nodejs -v 8.11.1
node.js docusignapi
Im making a call via Request to docusign like so:
var options = {
method: 'GET',
url: `${baseUrl}/envelopes/${envelopeId}/documents/${documentId}`,
headers: headers,
qs: {
encoding: 'base64'
}
};
request(options, function (error, response, body) {
...
})
Im getting back the document string but when I write it to a .pdf I get 4 blank pages. Here is the code im using to write it to a file:
fs.writeFile('cert.pdf', body, (err) => {
if(err) throw new Error(err)
})
Nodejs -v 8.11.1
node.js docusignapi
node.js docusignapi
asked Nov 19 at 19:58
Meisterunner
34
34
stackoverflow.com/questions/31040014/…
– JM-AGMS
Nov 19 at 20:41
add a comment |
stackoverflow.com/questions/31040014/…
– JM-AGMS
Nov 19 at 20:41
stackoverflow.com/questions/31040014/…
– JM-AGMS
Nov 19 at 20:41
stackoverflow.com/questions/31040014/…
– JM-AGMS
Nov 19 at 20:41
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Two issues:
I'd leave out the
qs: {encoding: 'base64'}
option. The document will be returned as a binary file. (Which is what you want.)When you write the file, specify binary format. On a Linux system, there is no difference. But on Windows there is.
For a code example of retrieving a document, see this file.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Two issues:
I'd leave out the
qs: {encoding: 'base64'}
option. The document will be returned as a binary file. (Which is what you want.)When you write the file, specify binary format. On a Linux system, there is no difference. But on Windows there is.
For a code example of retrieving a document, see this file.
add a comment |
up vote
0
down vote
Two issues:
I'd leave out the
qs: {encoding: 'base64'}
option. The document will be returned as a binary file. (Which is what you want.)When you write the file, specify binary format. On a Linux system, there is no difference. But on Windows there is.
For a code example of retrieving a document, see this file.
add a comment |
up vote
0
down vote
up vote
0
down vote
Two issues:
I'd leave out the
qs: {encoding: 'base64'}
option. The document will be returned as a binary file. (Which is what you want.)When you write the file, specify binary format. On a Linux system, there is no difference. But on Windows there is.
For a code example of retrieving a document, see this file.
Two issues:
I'd leave out the
qs: {encoding: 'base64'}
option. The document will be returned as a binary file. (Which is what you want.)When you write the file, specify binary format. On a Linux system, there is no difference. But on Windows there is.
For a code example of retrieving a document, see this file.
answered Nov 25 at 20:32
Larry K
32.7k1073103
32.7k1073103
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53381779%2fdocusign-document-blank-after-api-call%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
stackoverflow.com/questions/31040014/…
– JM-AGMS
Nov 19 at 20:41