orchestrator
2025.10
false
UiPath logo, featuring letters U and I in white

Orchestrator API 指南

上次更新日期 2025年10月27日

在 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. 在 Orchestrator API 页面的右上角找到“授权”按钮。如果锁是打开的,则表示您未经授权。

    Figure 1. Authorize button

  2. Select Authorize. The Available authorizations window is displayed.

    注意: 我们目前支持一种称为 OAuth2 的授权方案。
    Figure 2. Available authorizations

  3. 系统会预先选择所有作用域,以便您可以在 Orchestrator API 中试验所有端点。 如果要限制对某些 API 的访问,请清除它们。
  4. Select Authorize. A new window is displayed confirming you have been authorized.
  5. Once done, select Close or X to close the Available authorizations window. The Authorize button shows an closed lock meaning you are authorized.

正在发送请求

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

  1. 展开要用于执行操作的 Orchestrator API 资源。 已关闭的锁定表示您已获得授权。
    Figure 3. Unauthorized API resource

  2. In the expanded method window, select Try it out.
  3. 根据需要指定参数值。
  4. Select Execute. The request is executed. A bearer authorization header is automatically used for your requests.
    Figure 4. Bearer authorization header

生成新的访问令牌

当访问令牌过期时,您会收到 401: You are not authenticated! 响应。 您的请求仍存在不记名授权标头,但访问令牌已过期。 发生这种情况时,您需要使过期的令牌失效并生成新的访问令牌:
  1. 在 Orchestrator API 页面的右上角找到“授权”按钮。锁应该已关闭。
    Figure 5. Authorize button

  2. Select Authorize and on the displayed Available authorizations page, select Logout to revoke the expired token.
    Figure 6. Available authorizations

  3. Close the Available authorizations window by selecting Close or X and then obtain an access token as described on the Obtaining an access token section.

撤销访问权限

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

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

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。