轻易云集成平台中的每个集成方案都支持灵活的开放外网接口。 支持被授权的对象进行查询操作。

访问方式

HTTP POST : https://host/api/open/operation/方案ID/query

令牌与加密

通过轻易云集成平台配置,more info 页签 里面可以获取访问令牌。
image.png

查询参数

参数 名称 是否必要 说明
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 [ ] 查询条件

代码示例

image.png

Python - http.client

  1. import http.client
  2. conn = http.client.HTTPSConnection("pro-service.qliang.cloud")
  3. 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'
  4. headers = {
  5. 'Content-Type': 'application/x-www-form-urlencoded'
  6. }
  7. conn.request("POST", "/api/open/operation/0c869589-c142-395c-b9a7-ed1d12ae1160/query", payload, headers)
  8. res = conn.getresponse()
  9. data = res.read()
  10. print(data.decode("utf-8"))

Python - Requests

  1. import requests
  2. url = "https://pro-service.qliang.cloud/api/open/operation/0c869589-c142-395c-b9a7-ed1d12ae1160/query"
  3. 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'
  4. headers = {
  5. 'Content-Type': 'application/x-www-form-urlencoded'
  6. }
  7. response = requests.request("POST", url, headers=headers, data=payload)
  8. print(response.text)

Java - OkHttp

  1. OkHttpClient client = new OkHttpClient().newBuilder()
  2. .build();
  3. MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
  4. 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");
  5. Request request = new Request.Builder()
  6. .url("https://pro-service.qliang.cloud/api/open/operation/0c869589-c142-395c-b9a7-ed1d12ae1160/query")
  7. .method("POST", body)
  8. .addHeader("Content-Type", "application/x-www-form-urlencoded")
  9. .build();
  10. Response response = client.newCall(request).execute();