UiPath Documentation
orchestrator
2024.10
false
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

Orchestrator API 指南

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

在 Swagger 中授权 API 调用

访问 Swagger

要访问 Orchestrator API Swagger,请将 /swagger/index.html 附加到 Orchestrator URL。例如 https://{yourDomain}/swagger/index.html

您在 Swagger 中看到的 API 直接取决于您使用的 Orchestrator 实例。要轻松地直接在 Swagger 中发出请求,请在另一个选项卡中登录 Orchestrator。

获取访问令牌

要通过 Swagger 用户界面为 Orchestrator 服务授权 API 调用,请执行以下步骤:

  1. Look for the Authorize button at the top right corner of the Orchestrator API page. If the lock is open, you are unauthorized. 文档图像
  2. 单击“授权” 。系统将显示“可用授权”窗口。
    备注:

    我们目前支持一种名为 OAuth2 的授权方案。

  3. 系统会预先选择所有作用域,以便您可以在 Orchestrator API 中试验所有端点。 如果要限制对某些 API 的访问,请清除它们。
  4. 单击“授权” 。系统将显示一个新窗口,确认您已获得授权。
  5. 完成后,单击“关闭”或单击“X”以关闭“可用授权”窗口。“授权”按钮显示一个关闭的锁,表示您已获得授权。

正在发送请求

获得授权后,您可以对 Orchestrator API 资源发出请求,如下所示:

  1. 展开要用于执行操作的 Orchestrator API 资源。 已关闭的锁定表示您已获得授权。
  2. 在展开的方法窗口中,单击“试用”
  3. 根据需要指定参数值。
  4. Click Execute. The request is executed. A bearer authorization header is automatically used for your requests.

生成新的访问令牌

当访问令牌过期时,您会收到 401: You are not authenticated! 响应。 您的请求仍存在不记名授权标头,但访问令牌已过期。 发生这种情况时,您需要使过期的令牌失效并生成新的访问令牌:

  1. Look for the Authorize button at the top right corner of the Orchestrator API page. The lock should be closed. 文档图像
  2. Click Authorize and on the displayed Available authorizations page, click Logout to revoke the expired token.
  3. 单击“关闭”或 X 以关闭“可用的授权”窗口,然后按照“获取访问令牌” 部分中的说明获取访问令牌。

撤销访问权限

使用完 Swagger 用户界面后,您应该使已使用的访问令牌失效:

  1. 在 Orchestrator API 页面 的右上角找到“授权”按钮。锁应该已关闭,表示您已获得授权。
  2. 单击“授权”,然后在显示的“可用授权”页面上,单击“注销”。
  3. 单击“关闭”或 "X",关闭“可用授权”窗口。“授权”按钮显示打开的锁,表示您未获得授权。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新