Download Document

Upon complete signing document, user is allow to download the document. The download document will be in PDF format.

Sequence for calling API to download document

Source Code Sample

long result = (long) jsonObj.get("result");
data = jsonObj.get("data").toString();
mac = jsonObj.get("mac").toString();
macCheck = Utils.SHA256(new StringBuilder(data).append(apiSecret).toString().getBytes());
if (result == 0) {
	if(mac.equals(macCheck)) {
		byte[] jsonData = Utils.aesEcbPkcs5PaddingDecrypt(Utils.hexString2Bytes(data), apiSecret);
		plainData = new String(jsonData).toString();
		JSONParser parser = new JSONParser();
	        retJson = (JSONObject) parser.parse(plainData);
	        //download file
	        String hexdata= (String) retJson.get("pdfdata");
	        byte[] bytedate=Utils.hexString2Bytes(hexdata);
	        File file = new File(targetPath); 
	        try { 
                       OutputStream os = new FileOutputStream(file); 
                catch (Exception e) { 
                      System.out.println("Exception: " + e); 
Sample code to convert response data to file

Request Body Creation

	"contractnum": "D5CFEE6865AC4C15929A3E3AB11AE95A"

Example of Request


Expected Response


API reference guide : Download Document

How can we help?