ixp
latest
false

Communications Mining 用户指南
上次更新日期 2025年10月20日
注意:我们努力使 API 可预测,并且易于使用和集成。如果您有任何可以帮助我们改进的反馈,或者遇到任何问题或意外行为,请联系支持团队。我们会尽快回复您。
所有 API 请求都将作为 JSON 对象通过 HTTPS 发送到租户端点的 Communications Mining™。
注意:您可以在中查看所有可用端点。此外,您可以查看API 教程。
通过 UiPath™ 加入的租户:
https://cloud.uipath.com/<my_uipath_organisation>/<my_uipath_tenant>/reinfer_/api/...
https://cloud.uipath.com/<my_uipath_organisation>/<my_uipath_tenant>/reinfer_/api/...
通过 Communications Mining 载入的租户:
https://<mydomain>.reinfer.io/api/...
https://<mydomain>.reinfer.io/api/...
重要提示:在 Communications Mining™ 中,可以通过设置单独的租户或将开发和生产数据以及工作流放置在同一租户的单独项目中,从而将开发和生产数据以及工作流区分开。在每种情况下,数据访问权限都是单独授予的,以便开发者可以拥有开发数据的管理员访问权限,同时对生产进行更严格的控制。如果使用单独的租户,则开发和生产数据的 API 端点不同;如果在同一租户中使用单独的项目,则单个租户的端点将用于两者。
所有 API 请求都需要身份验证,以识别发出请求的用户。通过访问令牌提供身份验证。
要获取开发者访问令牌,请按照以下步骤操作:
- 从 Automation Cloud 访问 IXP。
- 转到“管理”页面。
- 选择“我的帐户” 。
- 在“API 令牌”下,选择“重新生成”按钮,这将生成访问令牌。
注意:您一次只能让一个 API 令牌处于活动状态。生成新令牌将使上一个令牌失效。
You need to include the
following HTTP header for every API call you make, where $REINFER_TOKEN
is
your Communications Mining™ API
token.Authorization: Bearer $REINFER_TOKEN
Authorization: Bearer $REINFER_TOKEN
示例中的 bash 示例假定您已将令牌保存在环境变量中。示例中的 Python 和节点示例假定令牌已通过您选择的配置解决方案存储在局部变量
REINFER_TOKEN
中。
重击
curl -X GET 'https://<my_api_endpoint>/api/...' \
-H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/...' \
-H "Authorization: Bearer $REINFER_TOKEN"
节点
const request = require("request");
request.get(
{
url: "https://<my_api_endpoint>/api/...",
headers: {
Authorization: "Bearer " + process.env.REINFER_TOKEN,
},
},
function (error, response, json) {
// digest response
console.log(JSON.stringify(json, null, 2));
}
);
const request = require("request");
request.get(
{
url: "https://<my_api_endpoint>/api/...",
headers: {
Authorization: "Bearer " + process.env.REINFER_TOKEN,
},
},
function (error, response, json) {
// digest response
console.log(JSON.stringify(json, null, 2));
}
);
Python
import json
import os
import requests
response = requests.get(
"https://<my_api_endpoint>/api/...",
headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
)
print(json.dumps(response.json(), indent=2, sort_keys=True))
import json
import os
import requests
response = requests.get(
"https://<my_api_endpoint>/api/...",
headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
)
print(json.dumps(response.json(), indent=2, sort_keys=True))
响应
{
"status": "ok"
}
{
"status": "ok"
}
我们使用传统 HTTP 响应代码来指示 API 请求成功或失败。通常,
2xx
范围中的代码表示成功, 4xx
范围中的代码表示由于提供的请求而导致的错误,而5xx
范围中的代码表示 Communications Mining 存在问题。
该错误的请求还将返回
status
值为error
(而不是ok
的正文,以及描述错误的错误消息。
重击
curl -X GET 'https://<my_api_endpoint>/api/v1/nonexistent_page' \
-H "Authorization: Bearer $REINFER_TOKEN"
curl -X GET 'https://<my_api_endpoint>/api/v1/nonexistent_page' \
-H "Authorization: Bearer $REINFER_TOKEN"
节点
const request = require("request");
request.get(
{
url: "https://<my_api_endpoint>/api/v1/nonexistent_page",
headers: {
Authorization: "Bearer " + process.env.REINFER_TOKEN,
},
},
function (error, response, json) {
// digest response
console.log(JSON.stringify(json, null, 2));
}
);
const request = require("request");
request.get(
{
url: "https://<my_api_endpoint>/api/v1/nonexistent_page",
headers: {
Authorization: "Bearer " + process.env.REINFER_TOKEN,
},
},
function (error, response, json) {
// digest response
console.log(JSON.stringify(json, null, 2));
}
);
Python
import json
import os
import requests
response = requests.get(
"https://<my_api_endpoint>/api/v1/nonexistent_page",
headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
)
print(json.dumps(response.json(), indent=2, sort_keys=True))
import json
import os
import requests
response = requests.get(
"https://<my_api_endpoint>/api/v1/nonexistent_page",
headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]},
)
print(json.dumps(response.json(), indent=2, sort_keys=True))
响应
{
"message": "404 Not Found",
"status": "error"
}
{
"message": "404 Not Found",
"status": "error"
}
注意:请求在到达 Communications Mining 之前可能会由于网络问题而失败。在这种情况下,您收到的响应将与前述的 Communications Mining 错误响应不同。
我们使用Server-Tiim HTTP 标头将请求发送到 API 所需的时间传达给我们的 API 进行处理。 我们提供了一个指标
total
,您可以使用该指标来衡量我们的平台在没有网络请求延迟的情况下处理您的请求所花费的时间。
响应中显示的标头示例:
Server-Timing: total;dur=37.7
Server-Timing: total;dur=37.7
Server-Timing
值始终以毫秒为单位,因此在本例中,具有此标头值的 API 请求在我们的平台上需要 37.7 毫秒才能得到处理。