- 概述
- 入门指南
- UiPath 市场供应商
- UiPath Marketplace 客户
- 发布准则
- 即用型自动化发布准则
- 解决方案加速器发布准则
- Integration Service 连接器的发布准则
- Process Mining 应用程序模板发布准则
- 解决方案加速器的优势
- 安全性与 IP 保护
- 安装指南
- 其他 UiPath 列表
- 连接器
- 如何创建活动
- 构建集成
Authenticating with UiPath Orchestrator API is dependent on the type of Orchestrator instance that you're connecting to. There are two types of Orchestrator instances, both of which use a bearer token for authentication: Cloud Orchestrator and On-premise Orchestrator.
端点和输入
从身份验证的角度来看,实例类型之间有两个主要区别。 第一个是您向其发送请求的端点,第二个是身份验证请求所需的输入。
下表显示了每种实例类型的不同端点和输入,以及指向适用的 API 文档的链接。
文件夹
两种实例类型都包含可选的文件夹输入。文件夹用于对自动化及其内部实体,以及整个组织内的人员进行持续的细化控制。Orchestrator 中有两种文件夹类型:传统和新式。默认情况下启用传统文件夹,而新式文件夹功能必须由主机或租户管理员启用。
If a user enters a Folder value, you need to retrieve the OrganizationUnitId of the folder. This identifier must be included in the Header of all subsequent API requests after authentication is completed.
如何获取文件夹 OrganizationUnitId 值?
To retrieve the OrganizationUnitId you must have the Folder Name and follow the API requests listed below.
-
使用“文件夹名称”作为输入参数,向“获取文件夹”端点发送 GET 请求(例如
{{base url}}/odata/Folders?$filter=FullyQualifiedName eq '{{FolderName}}')。当用户的用户名已知时,您还可以在单个请求中检索文件夹的组织单位ID 并验证其权限。有关详细信息,请参阅下文。
如何验证文件夹权限?
有多种方法可以验证用户是否有权访问特定文件夹。 如何验证权限取决于您是否拥有用户的用户名(而非电子邮件地址)。
选项 1 - 用户名未知
此选项适用于 Cloud Orchestrator 实例,以及仅知道用户电子邮件地址的 On-Premises Orchestrator 实例。
- 使用输入的凭据,通过向“获取当前用户” 端点发送 GET 请求(例如
{{base url}}/Users/Users_GetCurrentUser),来检索用户的 用户 ID 。 - 检索到包含 UserId 的 GET 响应后,使用 文件夹名称 和 用户 ID 作为输入参数(例如
{{base url}}/Folders/UiPath.Server.Configuration.OData.GetUsersForFolder(key={{*FolderOrganizationUnitId*}},includeInherited=true)?$filter=Id eq {{userId}}),向 GetUsersForFolder 端点发送 GET 请求。
选项 2 - 用户名已知
此选项适用于用户名已知的实例(通常,这仅适用于 On-Premises Orchestrator 实例)。
- 使用输入的用户名,向“通过用户名AndSkipAndTake 端点获取用户的所有角色” 发送 GET 请求(例如
{{base url}}/Folders/UiPath.Server.Configuration.OData.GetAllRolesForUser(username='{{username}}',skip=0,take=0))。- The response includes all of the folders the user has permission to access. By parsing the response, you can verify that it includes the Folder Name the user entered and/or the OrganizationUnitId that was retrieved in a previous request.
- The benefit of using this option is that you can get the OrganizationUnitId of the folder and verify permissions in a single request.
多个用户
一个连接器可以与同一个或不同的 Orchestrator 租户建立多个经过身份验证的连接。 多个连接的目的是使多个用户能够访问和使用已实现的连接器功能(例如,启动作业、添加队列项目),而无需共享其 Orchestrator 凭据。
示例
本节提供指向示例连接器用户界面的链接,以及每个输入字段的相应 Orchestrator API 请求。