轻易云集成平台中的每个集成方案都支持灵活的开放外网接口。 支持被授权的对象进行查询操作。
访问方式
HTTP POST : https://host/api/open/operation/方案ID/query
令牌与加密
通过轻易云集成平台配置,more info 页签 里面可以获取访问令牌。
查询参数
参数 | 名称 | 是否必要 | 说明 |
---|---|---|---|
token | 访问令牌 | 是 | |
page | 页码 | 是 | 从1开始,每页10行数据 |
begin_at | 开始时间戳 | 是 | 注意!该时间戳是指轻易云获取到数据的时间 |
end_at | 结束时间戳 | 是 | |
condition | [ ] | 否 | 自定义的过滤条件 |
condition[content.PurchaseOrgId_Number][$eq] | 否 | 示例数据(采购组织编码等于??) | |
condition[content.CreateDate][$gte] | 否 | 示例数据(采购单创建日期大于等于) | |
condition[content.CreateDate][$lte] | 否 | 示例数据(采购单创建日期小于等于) |
响应参数
字段 | 说明 | |
---|---|---|
success | bool | 响应是否成功 true/false |
code | int | 成功代码:0 |
message | string | 提示信息 |
content | { object } | 返回的响应内容 |
content.rows | [ array ] | 查询到的具体行信息 |
content.total | int | 数据总行数 |
content.condition | [ ] | 查询条件 |
代码示例
Python - http.client
import http.client
conn = http.client.HTTPSConnection("pro-service.qliang.cloud")
payload = 'token=ZE9mQGrC2kBlooEV7MLuGv8Zyhq90qG&page=1&begin_at=1548562617&end_at=1648562617&condition%5Bcontent.PurchaseOrgId_Number%5D%5B%24eq%5D=100&condition%5Bcontent.CreateDate%5D%5B%24gte%5D=2022-02-26%2016%3A00%3A01&condition%5Bcontent.CreateDate%5D%5B%24lte%5D=2022-03-26%2017%3A43%3A01'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/api/open/operation/0c869589-c142-395c-b9a7-ed1d12ae1160/query", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python - Requests
import requests
url = "https://pro-service.qliang.cloud/api/open/operation/0c869589-c142-395c-b9a7-ed1d12ae1160/query"
payload='token=ZE9mQGrC2kBlooEV7MLuGv8Zyhq90qG&page=1&begin_at=1548562617&end_at=1648562617&condition%5Bcontent.PurchaseOrgId_Number%5D%5B%24eq%5D=100&condition%5Bcontent.CreateDate%5D%5B%24gte%5D=2022-02-26%2016%3A00%3A01&condition%5Bcontent.CreateDate%5D%5B%24lte%5D=2022-03-26%2017%3A43%3A01'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Java - OkHttp
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "token=ZE9mQGrC2kBlooEV7MLuGv8Zyhq90qG&page=1&begin_at=1548562617&end_at=1648562617&condition[content.PurchaseOrgId_Number][$eq]=100&condition[content.CreateDate][$gte]=2022-02-26 16:00:01&condition[content.CreateDate][$lte]=2022-03-26 17:43:01");
Request request = new Request.Builder()
.url("https://pro-service.qliang.cloud/api/open/operation/0c869589-c142-395c-b9a7-ed1d12ae1160/query")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();