UiPath Documentation
data-service
2.2510
true
  • 开放式 API

Data Service API 指南

上次更新日期 2026年5月5日

查询实体记录

查询实体记录。

API 端点

文档图像BaseURL/EntityService/<Entity>/query

  • 基本 URL: https://{yourDomain}/{organizationName}/{tenantName}/dataservice_

请求标头

页眉
授权承载 <access_token>
Content-Typeapplication/json
备注:

将尖括号 <...> 之间的所有值替换为其相应的用例值。

<access_token> 是您在授权外部应用程序时收到的。 它可用 1 小时,然后您需要生成新令牌,或请求刷新令牌。

查询参数

查询参数数据类型描述默认值
ExpansionLevel (可选)int32指定要检索的相关记录的深度。 此参数的值可以是 1、2 或 3。2

请求正文 (必填)

{
  "selectedFields": [
    "string"
  ],
  "filterGroup": {
    "logicalOperator": 0,
    "queryFilters": [
      {
        "fieldName": "string",
        "operator": "string",
        "value": "string"
      }
    ],
    "filterGroups": [
      null
    ]
  },
  "start": 0,
  "limit": 0,
  "sortOptions": [
    {
      "fieldName": "string",
      "isDescending": true
    }
  ]
}
{
  "selectedFields": [
    "string"
  ],
  "filterGroup": {
    "logicalOperator": 0,
    "queryFilters": [
      {
        "fieldName": "string",
        "operator": "string",
        "value": "string"
      }
    ],
    "filterGroups": [
      null
    ]
  },
  "start": 0,
  "limit": 0,
  "sortOptions": [
    {
      "fieldName": "string",
      "isDescending": true
    }
  ]
}

请求正文架构

query 端点请求正文包含以下组件:

selectedFields

这是一个可选组件,类型为 string。 它指定要为查询的每条记录返回的字段列表。 如果留空,或查询列表为空,则返回所有记录字段。 默认值为 null

筛选器组

这是一个必需组件,可帮助您设置查询的筛选属性。 它结合了以下属性:

  • logicalOperator - This is an optional filterGroup property, of type int32. It specifies if all the filters and filter groups apply to the query. Use 0 to apply all the filters and filter groups. Use 1 to apply any of the filters and filter groups. Default value is 0.

  • queryFilter - This is a required filterGroup property, that helps you define the filtering expression. It has the following properties:

    查询筛选器属性数据类型描述
    fieldNamestring指定要筛选的字段的名称。
    operatorstringSpecifies the filter operator. Supports the following: contains, not contains, startswith, endswith, =, !=, >, <,>=, <=, in, not in. Use the adequate operator for the corresponding field type.
    string指定筛选值。
  • filterGroups - This is an optional filterGroup property, in case you need to set another filtering option to the query. It contains all the filterGroup properties listed above.

启动

This is an optional component, of type int32. Specifies the number of records to skip before retrieving the records from the query. Can be used together with the limit property to implement pagination. The records are ordered ascendingly by their IDs. To modify the sort order, use the sortOptions property. Default value is 0.

limit

This is an optional component, of type int32. It specifies the maximum number of records to be read from the entity. Can be used together with the start property to implement pagination. The default value is 100, and the maximum value is 1000.

sortOptions

这是一个可选组件,可帮助您按字段列表对查询的记录进行排序。 如果留空,则记录按 ID 升序排序。 它结合了以下属性:

  • fieldName - This is a required sortOptions property, of type string. It specifies the name of the field used to sort the records. The name must correspond to a valid field, and it is case-sensitive.
  • isDescending - This is an optional sortOptions property, of type boolean. Set it to true if you want to sort the records descendingly. The default value is false.

响应

200 OK

{
  "TotalRecordCount": 0,
  "Value": [
    {
      "ClosingDate": "2021-03-04",
      "CreatedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "CreateTime": "2021-03-04T10:21:22.771Z",
      "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "Logo": {
        "Name": "string",
        "Path": "string",
        "Size": 0,
        "Type": "string"
      },
      "Name": "string",
      "Nations": 0,
      "OlymipcsVersion": 0,
      "OpeningDate": "2021-03-04",
      "UpdatedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "UpdateTime": "2021-03-04T10:21:22.771Z"
    }
  ]
}
{
  "TotalRecordCount": 0,
  "Value": [
    {
      "ClosingDate": "2021-03-04",
      "CreatedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "CreateTime": "2021-03-04T10:21:22.771Z",
      "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "Logo": {
        "Name": "string",
        "Path": "string",
        "Size": 0,
        "Type": "string"
      },
      "Name": "string",
      "Nations": 0,
      "OlymipcsVersion": 0,
      "OpeningDate": "2021-03-04",
      "UpdatedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "UpdateTime": "2021-03-04T10:21:22.771Z"
    }
  ]
}

响应正文架构

query 端点响应正文包含以下组件:

  • totalRecordCount - The total number of records matching the specified query filters.
  • value - An array of entity records matching the specified query filters, limited by limit property.

401 未经授权

您未通过身份验证,无法访问 Data Service。确保您的 Assistant 或 Robot 已连接到您帐户中的新式文件夹。

403 Forbidden

您无权访问实体、字段或记录,或者您使用的机器人类型不受支持。请联系管理员以获取必要权限。

  • API 端点
  • 请求标头
  • 查询参数
  • 请求正文 (必填)
  • 请求正文架构
  • 响应
  • 200 OK
  • 响应正文架构
  • 401 未经授权
  • 403 Forbidden

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新