#coding=utf-8 import HttpUtils # 添加用户 https://{host}/user/addPersonalUser def addPerson(inputData): # 从输入数据中获取调用接口 account = inputData["account"] name = inputData["name"] mobile = inputData["mobile"] idCard = inputData["idCard"] idCardType = inputData["idCardType"] appId = inputData["appId"] appKey = inputData["appKey"] apiUrl = inputData["apiUrl"] # 组装参数 reqBodyData = { "account": account, "idCard": idCard, "idCardType": idCardType, "identifyMobile": mobile, "identifyType": 1, "mobile": mobile, "name": name, "isNotice": 1 } #请求地址 # url = "https://prev.asign.cn/user/addPersonalUser" Result = HttpUtils.HttpUtils.doPOST(apiUrl, reqBodyData, appId, appKey) return Result # 上传待签署文件 https://{host}/contract/createContract def createContract(inputData): # 从输入数据中获取调用接口 contractNo = inputData["contractNo"] contractName = inputData["contractName"] signOrder = inputData["signOrder"] templates = inputData["templates"] notifyUrl = inputData["notifyUrl"] appId = inputData["appId"] appKey = inputData["appKey"] apiUrl = inputData["apiUrl"] # 组装参数 reqBodyData = { "contractNo": contractNo, "contractName": contractName, "signOrder": signOrder, "templates": templates, "notifyUrl": notifyUrl } #请求地址 Result = HttpUtils.HttpUtils.doPOST(apiUrl, reqBodyData, appId, appKey) return Result # 添加签署方 https://{host}/contract/addSigner def addSigner(inputData): # 从输入数据中获取调用接口 contractNo = inputData["contractNo"] account = inputData["account"] signStrategyList = inputData["signStrategyList"] appId = inputData["appId"] appKey = inputData["appKey"] apiUrl = inputData["apiUrl"] # 组装参数 reqBodyData = [{ "contractNo": contractNo, "account": account, "signStrategyList": signStrategyList }] #请求地址 Result = HttpUtils.HttpUtils.doPOST(apiUrl, reqBodyData, appId, appKey) return Result # 下载合同 https://{host}/contract/downloadContract def downloadContract(inputData): # 从输入数据中获取调用接口 contractNo = inputData["contractNo"] downloadFileType = inputData["downloadFileType"] appId = inputData["appId"] appKey = inputData["appKey"] apiUrl = inputData["apiUrl"] # 组装参数 reqBodyData = { "contractNo": contractNo, "downloadFileType": downloadFileType } #请求地址 Result = HttpUtils.HttpUtils.doPOST(apiUrl, reqBodyData, appId, appKey) return Result