Api.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #coding=utf-8
  2. import HttpUtils
  3. # 添加用户 https://{host}/user/addPersonalUser
  4. def addPerson(inputData):
  5. # 从输入数据中获取调用接口
  6. account = inputData["account"]
  7. name = inputData["name"]
  8. mobile = inputData["mobile"]
  9. idCard = inputData["idCard"]
  10. idCardType = inputData["idCardType"]
  11. appId = inputData["appId"]
  12. appKey = inputData["appKey"]
  13. apiUrl = inputData["apiUrl"]
  14. # 组装参数
  15. reqBodyData = {
  16. "account": account,
  17. "idCard": idCard,
  18. "idCardType": idCardType,
  19. "identifyMobile": mobile,
  20. "identifyType": 1,
  21. "mobile": mobile,
  22. "name": name,
  23. "isNotice": 1
  24. }
  25. #请求地址
  26. # url = "https://prev.asign.cn/user/addPersonalUser"
  27. Result = HttpUtils.HttpUtils.doPOST(apiUrl, reqBodyData, appId, appKey)
  28. return Result
  29. # 上传待签署文件 https://{host}/contract/createContract
  30. def createContract(inputData):
  31. # 从输入数据中获取调用接口
  32. contractNo = inputData["contractNo"]
  33. contractName = inputData["contractName"]
  34. signOrder = inputData["signOrder"]
  35. templates = inputData["templates"]
  36. notifyUrl = inputData["notifyUrl"]
  37. appId = inputData["appId"]
  38. appKey = inputData["appKey"]
  39. apiUrl = inputData["apiUrl"]
  40. # 组装参数
  41. reqBodyData = {
  42. "contractNo": contractNo,
  43. "contractName": contractName,
  44. "signOrder": signOrder,
  45. "templates": templates,
  46. "notifyUrl": notifyUrl
  47. }
  48. #请求地址
  49. Result = HttpUtils.HttpUtils.doPOST(apiUrl, reqBodyData, appId, appKey)
  50. return Result