How long is the downloadUrl
from /esignglobal/v1/templates/fileFiling
valid?
The generated file download link is valid for 60 minutes (only returned upon successful synthesis).
Please check whether the fileUpload url obtained by using the interface for obtaining the file address has been used to upload the file stream in the HTTP PUT manner. If it has not been uploaded, please call the URL to upload the file.
downloadUrl
from /esignglobal/v1/templates/fileFiling
valid?The generated file download link is valid for 60 minutes (only returned upon successful synthesis).
When docking and uploading files in the sandbox environment, it should be noted that its server is located in Singapore. When accessing it directly in China, the network is often unstable, and problems such as lagging, slow loading or being unable to access occur from time to time. In view of this, it is recommended to access it through a proxy in Singapore. This will help improve the unstable network situation and make it more convenient to use this file service.
Step 1: Obtain the file upload address During the operation, you need to provide the relevant information in the following format to obtain the file upload address: { "fileName": "fengniantest.pdf", "contentType": "application/pdf" } Please note that although the file name here is "fengniantest.pdf", the content type (contentType) is specified as "application/pdf". Ensure that the relevant parameters are accurate.
Step 2: Add request header information when directly uploading the file When performing a direct file upload operation, you need to add the information 'Content-Type: application/pdf' to the request headers (headers) to clarify the type of the uploaded file and ensure the smooth progress of the direct file upload operation.
The following file formats are supported: PDF (.pdf), Word (.docx,.doc), RTF (.rtf), Excel (.xlsx,.xls), PowerPoint (.pptx,.ppt), WPS Writer (.wps), WPS Spreadsheets (.et), WPS Presentation (.dps), JPEG (.jpeg,.jpg), PNG (.png), BMP (.bmp), TIFF (.tiff), GIF (.gif), HTML (.html,.htm) and CSV (.csv).
When document conversion times out, it often leads to file composition failure. In this case, you can re-invoke the template to generate the file and then call the file composition task query interface to check if the file composition was successful. If the file composition still fails after performing the above steps, you can directly contact the technical support team for assistance from professional technicians.
If the contentType
passed in step one matches the Content-Type
transmitted in the Header in step two, and the file is successfully uploaded directly via Postman using the fileUploadUrl
, but the customer's code still encounters errors during the call, and breakpoint checks confirm that the parameters are being passed correctly, there may be a compatibility issue with the customer's framework. It is suggested that the customer refer to the following code example for direct file upload:
Reference code:
java
// method of calling(set Java as example)
Response response = HttpUtil.sendRequest(
"uploadUrl", // upload API URL
new File("文件路径/xxx.pdf"), // file to be uploaded
"application/pdf", // content type
new HashMap<>() // optional request header parameters (pass empty if none)
);
Key Points:
Content-Type
parameter in the code (e.g., "application/pdf"
) is exactly consistent with the interface requirements, including case and format (e.g., application/json
must be strictly distinguished fromapplication/JSON
).URLConnection
or Python's requests
) for verification, to identify whether there are compatibility issues with how the framework handles request headers and file streams.