请求地址:/v5/Contracts/signed.json
请求方式:POST
接口版本: 5.2.3
接口描述:
'https接口的范例代码,windows下测试方法:命令行下执行 CScript.exe APIStore.vbs
'源码基于VBS语言,用户可在windows主机环境或asp环境调用,asp环境调用时请注意输出方式
'sdk接口都是以https方式调用,因此,要求你的系统(windows)已经拥有证书,我公司采用的证书是国际可信任服务商提供的安全证书,绝大部分系统已经内置如果您的系统出现了证书不可信问题,那可能是您的系统太老导致的,比如winxp之前的系统,此时可能需要您手动导入证书文件cacert.pem,即可使用
'cacert.pem为可信任根证书文件,用户请保持更新
'参考
'WinHttp TLS1.2 possible
'https://social.msdn.microsoft.com/Forums/en-US/8f2f2599-e913-4557-a897-c11796914eb7/winhttp-tls12-possible?forum=isvvba
'How do you set the SecurityProtocolType to TLS 1.2 for a web service
'https://forum.powerbasic.com/forum/user-to-user-discussions/programming/746809-how-do-you-set-the-securityprotocoltype-to-tls-1-2-for-a-web-service/page2
'WinHttpRequestOption enumeration
'https://msdn.microsoft.com/en-us/library/windows/desktop/aa384108(v=vs.85).aspx
'post请求方式
'url 地址
'param 参数
Function requestPost(url,param)
on error resume next
Dim httpRequest
'Set xmlHttp = CreateObject("Microsoft.XMLHTTP") '这个的核心是WinHttp.WinHttpRequest.5.1,而且它没有option可以设置
Set httpRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
httpRequest.Option(9) = 128 '设置使用协议,128,TSL 1.0;512,TSL 1.1; 2048,TSL 1.2。出自winhttp.h文件
httpRequest.Open "POST", url, False, "", ""
httpRequest.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
httpRequest.Send param
If err.number <> 0 then
WScript.Echo "error,No:" & err.number & ";Description:" & Err.Description
else
Dim result
result = httpRequest.ResponseText
WScript.Echo "POST返回结果:" & result 'win脚本应用下输出
'Response.Write "POST返回结果:" & result 'asp应用下输出
End If
Set httpRequest = Nothing
End function
'获取内容
Function getContent()
url="https://api-v2.1dq.com/v5/Contracts/signed.json"
param="easy_id=175592531139104768&signed_data=[ {
"seal_id": "必填-印章id",
"page": "第几页如2",
"x": "必填-需要盖章的x坐标位置",
"y": "必填-需要盖章的y坐标位置"
}
,{ "seal_id": "abf447a8-ad71-11ea-b95e-0242ac320a0c", "page": "1", "x": "200", "y": "200" }, { "seal_id": "abf447a8-ad71-11ea-b95e-0242ac320a0c", "page": "6", "x": "200", "y": "200" }]&words_id=2c6084c0-ad71-11ea-9664-0242ac320a0c&certification_code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9&certification_type=mobile&cross_page_data=[ { "seal_id": "abf447a8-ad71-11ea-b95e-0242ac320a0c", "y": "100" },{
"seal_id": "必填-印章id",
"y": "必填-需要盖章的y坐标位置"
} ]&page_width=800"
requestPost url,param
End function