发起签署准备
接口说明
本接口为发起签署准备接口
签署流程

发起签署准备
| 接口名 | channel/prepare4PdfFileSign |
|---|---|
| 接口描述 | 发起签署准备 |
data输入参数
| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| signTitle | String | 是 | 签署标题 |
| phoneNo | String | 是 | 用户手机号 |
| signatureAppearance | String | 是 | 签名外观base64编码值 |
| signaturePosition | String | 否 | 签名外观位置信息 |
| notifyUrl | String | 是 | 文件签署后的签署结果通知地址 |
attachment输入参数
| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pdfFiles | jsonArrayStr | 是 | 具体请参考实例 |
请求示例:
{
"app_id": "",
"bussNo": "d16fe33f84814a4a9b0f29191d3aeee5",
"data": "XXX",
"signInfo": "XXX",
"timestamp": "1530002630897",
"attachment": "{\"pdfFiles\":\"[{\\\"name\\\":\\\"XXX\\\",\\\"pdfBase64Str\\\":\\\"XXX\\\"}]\"}"
}
返回参数
| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| signSerial | String | 是 | 签署单号 |
JAVA调用实例
实例所需依赖请查看javaSdk
String url="xxx";//接口请求地址
String methodUrl = "channel/prepare4PdfFileSign";
String fileBase64 = "";//pdf文件base64
String fileName = "";//pdf文件名称
String signatureAppearance = "";//签名外观图片base64数据
String notifyUrl = "";//回调地址
String signTitle = "";//签署标题
String phoneNo = "";//用户手机号
String appId="";//应用id,由云签平台分配
String appSecret="";//云签分配的密钥,只作数据签名使用
Map<String, Object> fileParam = new HashMap<>();//签署文件参数
List<Map<String, Object>> fileList = new ArrayList<>();
Map<String, Object> fileMap = new HashMap<>();
fileMap.put("name", fileName);
fileMap.put("pdfBase64Str", fileBase64);
fileList.add(fileMap);
fileParam.put("pdfFiles", JSONObject.toJSONString(fileList));
Map<String, Object> params = new HashMap<String, Object>();
params.put("signTitle", signTitle);
params.put("phoneNo", phoneNo);
params.put("signatureAppearance", signatureAppearance);
params.put("notifyUrl", notifyUrl);
String data = JSONObject.toJSONString(params);
Map channelContext = MessageUtil.getChannelContext(appId, appSecret,
"app_secret", data, JSONObject.toJSONString(fileParam));
String rpcResult = HttpsClientUtil.getInstance().httpsPost(
url+"/api/v1/" + methodUrl,
JSONObject.toJSONString(channelContext)
);
System.out.println("返回结果:" + rpcResult);