| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- # -*- coding: UTF-8 -*-
- import esigntool
- import requests
- from esigntool import esign_run_print_outer
- # 合同文件签署服务API - 合同解约服务
- config = esigntool.config() # 初始化配置类
- @esign_run_print_outer
- def rescissionUrl():
- """
- 获取合同解约链接
- :return:
- """
- # 构建请求body体
- sign_flowId = "df********grgter" # 声明请求参数
- body = {
- "rescissionInitiator": {
- "orgInitiator": {
- "orgId": "0c5bd49248***5648bfbf",
- "transactor": {
- "psnId": "c7e002947***310541e7"
- }
- }
- },
- "signFlowConfig": {
- "chargeConfig": {
- "chargeMode": 0
- },
- "noticeConfig": {
- "noticeTypes": "1,2"
- },
- "notifyUrl": "https://xx.xx.xx/callback"
- }
- } # 构建请求body体
- api_path = "/v3/sign-flow/{}/rescission-url".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=body, headers=json_headers) # 发送请求
- print(resp.text)
- return resp
- if __name__ == '__main__':
- rescissionUrl() # 获取合同解约链接
|