# -*- coding: UTF-8 -*- import esigntool import requests from esigntool import esign_run_print_outer # 合同文件签署服务API - 签署流程 - 查询类 config = esigntool.Config() # 初始化配置类 @esign_run_print_outer def signFlowDetail(): """ 查询签署流程详情 :return: """ sign_flowId = "df********grgter" # 声明请求参数 api_path = "/v3/sign-flow/{}/detail".format(sign_flowId) # 拼接请求路径 method = esigntool.httpMethodEnum.GET # 声明请求方法 json_headers = esigntool.buildSignJsonHeader(config.appId, config.scert, method, api_path) # 签名并构造签名鉴权json请求头 resp = requests.request(method, config.host + api_path, json=None, headers=json_headers) # 发送请求 print(resp.text) return resp @esign_run_print_outer def signFlowList(): """ 查询签署流程列表 :return: """ api_path = "/v3/sign-flow/sign-flow-list" # 拼接请求路径 body = { "operator": { "psnAccount": "183****0101", "psnId": "" }, "pageNum": 1, "pageSize": 20, "signFlowStartTimeFrom": 1648801671000, "signFlowStartTimeTo": 1651393671000, "signFlowStatus": [1, 2] } # 构建请求body体 method = esigntool.httpMethodEnum.GET # 声明请求方法 json_headers = esigntool.buildSignJsonHeader(config.appId, config.scert, method, api_path) # 签名并构造签名鉴权json请求头 resp = requests.request(method, config.host + api_path, json=body, headers=json_headers) # 发送请求 print(resp.text) return resp if __name__ == '__main__': signFlowDetail() # 查询签署流程详情 signFlowList() # 查询签署流程列表