Can you tell me whether my code below is fine?
--MYBOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="sample.pdf";documentid=1
{
[B@17f7be7b
}
--MYBOUNDARY--
The [B@17f7be7b is the byteArray returned by java for my pdf (pdf file with just "Just a sample" as content). I just converted that byteArray to String and I have pasted it here. I get
"errorCode": "UNABLE_TO_LOAD_DOCUMENT",
"message": "Unable to load the document. Unable to load Document(1). Error: the document is corrupt, rebuilding failed"
Pls help me with the right way of doing this.
You haven't posted the relevant code which makes it harder to debug, but on the surface there are at least two problems with the text you've posted. One is that the document bytes should not be enclosed with brackets
{
}
.Next it does not look like you are encoding the document bytes correctly. The PDF raw bytes will not start with
[B@1
.......... Without seeing your code I can only say you need to review how you are writing the PDF bytes to the request.The reason why so many posts show "Document Bytes Go Here" is that it's pretty useless having a bunch of random, non-human readable characters in the sample request. If you are programmer and you understand what it means to write document bytes to a stream then you should understand no problem. Here is a sample request with once again the document bytes omitted:
The above request will send a signature request with one recipient of type signer and will place one signature tab on the document for them at location
100
pixels to the right and100
pixels down from the top left of the document. Check out the DocuSign API Walkthroughs for code samples on how to accomplish this, in particular the 4th walkthrough Request Signature on a Document shows you exactly how to do this in 6 different languages (PHP
,Javascript
,Java
,C#
,Python
,Objective-C
) with instructions:http://iodocs.docusign.com/APIWalkthroughs
A few comments regarding format/contents of what you posted in your Question: