| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- # -*- coding: UTF-8 -*-
- import esigntool
- import requests
- from esigntool import esign_run_print_outer
- # 合同文件签署服务API - 签署流程 - 变更类
- config = esigntool.config() # 初始化配置类
- @esign_run_print_outer
- def signFlowStart():
- """
- 开启签署流程
- :return:
- """
- sign_flowId = "fr5845******834y656" # 声明变量入参
- api_path = "/v3/sign-flow/{}/start".format(sign_flowId) # 拼接请求路径
- method = esigntool.httpMethodEnum.POST # 声明请求方法
- 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 signFlowFinish():
- """
- 完结签署流程
- :return:
- """
- sign_flowId = "fr5845******834y656" # 声明变量入参
- api_path = "/v3/sign-flow/{}/finish".format(sign_flowId) # 拼接请求路径
- method = esigntool.httpMethodEnum.POST # 声明请求方法
- 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 signFlowRevoke():
- """
- 撤销签署流程
- :return:
- """
- sign_flowId = "fr5845******834y656" # 声明变量入参
- api_path = "/v3/sign-flow/{}/revoke".format(sign_flowId) # 拼接请求路径
- method = esigntool.httpMethodEnum.POST # 声明请求方法
- 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 signFlowDelay():
- """
- 延期签署截止时间
- :return:
- """
- sign_flowId = "fr5845******834y656" # 声明变量入参
- body = {
- "signFlowExpireTime": 1654849671000
- } # 构建请求body体
- api_path = "/v3/sign-flow/{}/delay".format(sign_flowId) # 拼接请求路径
- method = esigntool.httpMethodEnum.POST # 声明请求方法
- json_headers = esigntool.buildSignJsonHeader(config.appId, config.scert,
- method, api_path, body) # 签名并构造签名鉴权json请求头
- resp = requests.request(method, config.host + api_path, json=body, headers=json_headers) # 发送请求
- print(resp.text)
- return resp
- @esign_run_print_outer
- def signFlowUrge():
- """
- 催签流程中签署人
- :return:
- """
- sign_flowId = "fr5845******834y656" # 声明变量入参
- body = {
- "noticeTypes": "1",
- "urgedOperator": {
- "psnAccount": "183****0101"
- }
- } # 构建请求body体
- api_path = "/v3/sign-flow/{}/urge".format(sign_flowId) # 拼接请求路径
- method = esigntool.httpMethodEnum.POST # 声明请求方法
- json_headers = esigntool.buildSignJsonHeader(config.appId, config.scert,
- method, api_path, body) # 签名并构造签名鉴权json请求头
- resp = requests.request(method, config.host + api_path, json=body, headers=json_headers) # 发送请求
- print(resp.text)
- return resp
- if __name__ == '__main__':
- signFlowStart() # 开启签署流程
- signFlowFinish() # 完结签署流程
- signFlowRevoke() # 撤销签署流程
- signFlowDelay() # 延期签署截止时间
- signFlowUrge() # 催签流程中签署人
|