uipath-automationhub

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

UiPath Automation Hub — Open API Assistant

UiPath Automation Hub — Open API 助手

Work with business processes in UiPath Automation Hub (AH) through the AH Open API, authenticating with the user's cloud access token — the user does not need an admin-generated OpenAPI token. This one skill covers both writing a process to AH and reading one back; pick the flow below.
通过AH Open API操作UiPath Automation Hub(AH)中的业务流程,使用用户的云访问令牌进行身份验证——用户无需管理员生成的OpenAPI令牌。该技能涵盖向AH写入流程和读取流程两种操作,请选择下方对应的流程。

Step 0: Read the API reference

步骤0:阅读API参考文档

Always read
references/api-endpoints.md
first. It is the shared source of truth for the cloud-token auth model, the base/gateway URL, the exact headers (and which header to never send), and every endpoint the flows use.
请务必先阅读
references/api-endpoints.md
。它是云令牌认证模型、基础/网关URL、精确请求头(以及绝不能发送的请求头)和所有流程使用的端点的共享可信来源。

Authentication (shared — both flows)

身份验证(共享——适用于两种流程)

Resolve the cloud token + base URL + org + tenant in this priority order:
  1. Runtime env-auth (preferred — how UiPath Delegate provides it). If
    UIPATH_CLI_AUTH_TOKEN
    is set (with
    UIPATH_CLI_ENABLE_ENV_AUTH=true
    ), use it as the bearer and take org/tenant from
    UIPATH_CLI_ORGANIZATION_NAME
    /
    UIPATH_CLI_TENANT_NAME
    (and the
    ..._ID
    variants). Base URL defaults to
    https://cloud.uipath.com
    . (If a parent
    uip
    process instead exported
    UIPATH_ACCESS_TOKEN
    +
    UIPATH_URL
    — the
    {base}/{org}/{tenant}
    shape — use those.)
  2. Logged-in
    uip
    session.
    Otherwise, if the user has run
    uip login
    , read
    ~/.uipath/.auth
    (JSON:
    accessToken
    ,
    baseUrl
    ,
    organizationName
    ,
    tenantName
    ).
  3. User-provided (last resort). Ask the user to paste a cloud bearer token plus their org and tenant slugs (the two path segments after the host in their AH URL).
Use whatever you resolved as
$ACCESS_TOKEN
,
$BASE_URL
,
$ORG
,
$TENANT
in the flows.
Gateway URL (every request):
{baseUrl}/{org}/{tenant}/automationhub_/api/v1/openapi
The platform injects tenant-routing headers from the
{org}/{tenant}
segments — always use this gateway URL.
Header rules (do not regress these):
  • Send
    Authorization: Bearer <cloud access token>
    on every request (and
    Content-Type: application/json
    on POSTs).
  • NEVER send
    x-ah-openapi-auth
    or
    x-ah-openapi-app-key
    . Those route to the admin-token path and reject a cloud token with 401 — never add them to "fix" a 401.
  • Never fall back to an admin OpenAPI token. If no token resolves, stop and explain the skill needs the user's cloud session (
    uip login
    ) or a host-provided token.
  • Cloud tokens are short-lived. On a 401, if the token came from
    ~/.uipath/.auth
    , tell the user to run
    uip login
    again, re-resolve, and retry.
按以下优先级顺序解析云令牌 + 基础URL + 组织 + 租户:
  1. 运行时环境认证(首选——UiPath Delegate的提供方式)。如果已设置
    UIPATH_CLI_AUTH_TOKEN
    (且
    UIPATH_CLI_ENABLE_ENV_AUTH=true
    ),将其用作承载令牌,并从
    UIPATH_CLI_ORGANIZATION_NAME
    /
    UIPATH_CLI_TENANT_NAME
    (及其
    ..._ID
    变体)中获取组织/租户信息。基础URL默认值为
    https://cloud.uipath.com
    (如果父级
    uip
    流程导出的是
    UIPATH_ACCESS_TOKEN
    +
    UIPATH_URL
    ——格式为
    {base}/{org}/{tenant}
    ——则使用这些值。)
  2. 已登录的
    uip
    会话
    。否则,如果用户已执行
    uip login
    ,读取
    ~/.uipath/.auth
    (JSON格式:
    accessToken
    baseUrl
    organizationName
    tenantName
    )。
  3. 用户提供(最后手段)。请用户粘贴云承载令牌及其组织租户标识(AH URL中主机名后的两个路径段)。
将解析得到的值作为流程中的
$ACCESS_TOKEN
$BASE_URL
$ORG
$TENANT
使用。
网关URL(所有请求均使用):
{baseUrl}/{org}/{tenant}/automationhub_/api/v1/openapi
平台会从
{org}/{tenant}
段注入租户路由请求头——请始终使用该网关URL。
请求头规则(请勿违反)
  • 所有请求均发送
    Authorization: Bearer <cloud access token>
    (POST请求还需发送
    Content-Type: application/json
    )。
  • 绝不发送
    x-ah-openapi-auth
    x-ah-openapi-app-key
    。这些请求头会路由到管理员令牌路径,并以401状态码拒绝云令牌——切勿添加它们来“修复”401错误。
  • 绝不回退到管理员OpenAPI令牌。如果无法解析令牌,请停止操作并说明该技能需要用户的云会话(
    uip login
    )或宿主提供的令牌。
  • 云令牌有效期较短。如果收到401状态码,且令牌来自
    ~/.uipath/.auth
    ,请告知用户重新执行
    uip login
    ,重新解析令牌后重试。

Routing — pick the flow by intent

路由——根据意图选择流程

Classify what the user wants, then follow the matching reference. All flows share the Authentication section above and the endpoint catalog in
references/api-endpoints.md
.
The user wants to...Follow
Publish / create / upload a process (+ its PDD/SDD documents) to AH
references/publish-process.md
Get / read / fetch / list a process (+ its documents) from AH
references/get-process.md
Shared auth + endpoint catalog (base URL, headers, every endpoint, error codes)
references/api-endpoints.md
(future AH Open API operation — add a row here) <!-- uip-check-skip -->add
references/<operation>.md
and route to it
To add a new capability (e.g. a future AH
uip
CLI surface or another Open API operation), keep this skill's product shape: add one
references/<operation>.md
, add a row above, and reuse this shared Authentication section — do not create a new per-operation skill.
分类用户的需求,然后遵循对应的参考文档。所有流程均共享上述身份验证部分和
references/api-endpoints.md
中的端点目录。
用户需求遵循文档
发布/创建/上传流程(及其PDD/SDD文档)到AH
references/publish-process.md
获取/读取/提取/列出AH中的流程(及其文档)
references/get-process.md
共享身份验证+端点目录(基础URL、请求头、所有端点、错误码)
references/api-endpoints.md
(未来AH Open API操作——在此处添加一行) <!-- uip-check-skip -->添加
references/<operation>.md
并路由至该文档
如需添加新功能(例如未来的AH
uip
CLI界面或其他Open API操作),请保持本技能的产品架构:添加一个
references/<operation>.md
,在上方添加一行,并复用此共享身份验证部分——请勿创建新的针对单个操作的技能。

Notes

注意事项

  • Cloud token only — authorization is the user's real AH permissions; you see and can do exactly what their AH role allows.
  • The publish flow fetches the idea-flow schema live, so it adapts automatically if fields change on the tenant.
  • Open dependency: in a hosted runtime (e.g. Process Scribe/Delegate) the cloud token is expected via the environment (Authentication, option 1). Confirm the runtime provides
    UIPATH_CLI_AUTH_TOKEN
    (or an equivalent) before relying on it in production.
  • 仅支持云令牌——授权基于用户实际的AH权限;您能查看和执行的操作完全受限于用户的AH角色。
  • 发布流程会实时获取创意流程schema,因此如果租户上的字段发生变化,它会自动适配。
  • 开放依赖:在托管运行时(例如Process Scribe/Delegate)中,云令牌需通过环境变量提供(身份验证方式1)。在生产环境中依赖此方式前,请确认运行时已提供
    UIPATH_CLI_AUTH_TOKEN
    (或等效变量)。