Uploading Steps
1. Get the document uploading URL
Retrieve the fileUploadUrl with the specified API .
Upload the file using an HTTP PUT request with the URL obtained in Step 1.
Note:
- contentMD5 is optional.
- If contentType,contentMD5 is specified in Step 1, it must be included in the request headers in Step 2, and their values must exactly the same between the two steps.
- The Content-Type values in both steps must be exactly the same, otherwise, a 403 error will occur.
Get Document Uploading URL
POST /esignglobal/v1/files/getUploadUrl
Interface Description
Get the file upload url through this interface.
Request Parameters
Request Example
{
"fileName": "测试.pdf",
"contentType": "application/pdf"
}
Responses
Response example
{
"code": "0",
"data": {
"fileKey": "xxxxxxxxx",
"fileName": "签署.pdf",
"fileUploadUrl": "文件上传地址"
},
"message": "成功"
}
Upload Document
The fileUpload Url obtained with Get Document Uploading URL interface.
Interface Description
Upload the file(binary byte stream) using an HTTP PUT request with the URL obtained in Step 1.
Request Parameters
2.HTTP BODY: binary byte stream of the file to be uploaded
3.Encode:
Request Example
fileName = URLEncoder.encode(fileName, "UTF-8");
// replace special characters
fileName = fileName
.Replace All("\ \ +", "% 20")
. Replace All("% 28", "(")
. Replace All("% 29", ")")
. Replace All("% 27", "'")
.replaceAll("%21", "!")
.replaceAll("%7E", "~");
Response Example
http_status: 200