test-cloud
latest
false
Test Cloud API 指南
- 入门指南
- 身份验证
- 作用域和权限
- 平台管理 API
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
按文件夹检索特定租户的消耗细目分类,也可以按文件夹所有权进行聚合。
使用此端点按文件夹检索特定租户的消耗细分。
API 端点
POST {accessURL}/lease_/api/usage/{organizationId}/tenants/consumption-by-folder
将所有端点路径中的{accessURL}替换为您的云平台的基本 URL:
| Cloud Platform | 访问 URL |
|---|---|
| Test Cloud | https://cloud.uipath.com/ |
| Test Cloud 公共部门版 | https://govcloud.uipath.us/ |
| Test Cloud 专用版 | https://{customURL}.dedicated.uipath.com/ |
备注:
当您登录到产品时,您的组织名称将显示在访问 URL 后面的 URL 中,例如 {accessURL}/{organizationName}/...。
请求标头
--header 'Authorization: Bearer {access_token}'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {access_token}'
--header 'Content-Type: application/json'
备注:
要获取{access_token} ,请确保通过此处描述的 ROPC 方法进行身份验证。
路径参数
| 路径参数 | 数据类型 | 描述 |
|---|---|---|
organizationId (必填) | 字符串 (GUID) | 租户所在组织的 ID。 |
请求正文
请求正文指定租户、日期范围、消耗性代码和可选的聚合模式。有关消耗品代码的详细列表,请参阅消耗品。
{
"tenantId": "string",
"startDate": 0,
"endDate": 0,
"consumableCode": "string",
"aggregateByOwnership": false,
"processPersonalWorkspaces": false,
"alwaysIncludeFolderKeys": ["string"]
}
{
"tenantId": "string",
"startDate": 0,
"endDate": 0,
"consumableCode": "string",
"aggregateByOwnership": false,
"processPersonalWorkspaces": false,
"alwaysIncludeFolderKeys": ["string"]
}
备注:
- 必须填写“
tenantId”。要检索其消耗量的租户 ID。 startDate和endDate是以秒为单位的 Unix 时间戳。两个边界都包含在内。系统会拒绝所提供的以毫秒为单位的值,并显示400 Bad Request错误,表明应为秒数。aggregateByOwnership是可选的(默认值:false)。当设置为true时,消耗量按触发流程执行的文件夹而非运行位置汇总。processPersonalWorkspaces是可选的(默认值:false)。当设置为true时,个人工作区作为单独项目包含在文件夹细分中,并在综合PersonalWorkspacesRoot父项下分组。仅返回消耗量在查询窗口内的工作区。不存在的文件夹中的消耗量将作为用isDeletedFolder标记的综合项目返回。alwaysIncludeFolderKeys是可选项。提供要包含在响应中的文件夹 GUID 列表,即使它们在查询窗口中的消耗量为零也是如此。未知密钥将被忽略。
响应
200 OK
返回指定租户按文件夹分组的消耗记录列表。
请求示例
调用应类似于以下示例 (cURL):
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/consumption-by-folder' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--data-raw '{
"tenantId": "string",
"startDate": 1704067200,
"endDate": 1706745600,
"consumableCode": "consumption_unit_code"
}'
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/consumption-by-folder' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--data-raw '{
"tenantId": "string",
"startDate": 1704067200,
"endDate": 1706745600,
"consumableCode": "consumption_unit_code"
}'
以下是文件夹检索成功使用的响应正文:
备注:
- 当项目是个人工作区时,
isPersonalWorkspace为true。 - 当项目表示已删除文件夹的消耗量时,
isDeletedFolder为true。
{
"items": [
{
"folderKey": "string",
"folderName": "string",
"parentFolderKey": "string",
"consumedBySelf": 0,
"processCountSelf": 0,
"isPersonalWorkspace": false,
"isDeletedFolder": false
}
]
}
{
"items": [
{
"folderKey": "string",
"folderName": "string",
"parentFolderKey": "string",
"consumedBySelf": 0,
"processCountSelf": 0,
"isPersonalWorkspace": false,
"isDeletedFolder": false
}
]
}