UiPath Documentation
document-understanding
2024.10
false
  • 入门指南
    • 概述
      • 使用 HTTP 请求的凭据
      • 在 Swagger 中使用凭据
    • 限制和配额
  • 使用 Document Understanding™ API 的示例
  • 许可
  • 故障排除

Document Understanding API 指南

上次更新日期 2026年4月6日

使用 HTTP 请求的凭据

创建外部应用程序后,您可以在实现中使用它。 首先,使用访问令牌完成身份验证程序。 以下是您需要遵循的步骤:

  • 获取配置外部应用程序时收到的 AppIdAppSecret 的访问令牌。
  • 使用访问令牌作为请求标头。

获取访问令牌

要访问应用程序作用域,机密应用程序在调用POST https://cloud.uipath.com/identity_/connect/token端点时使用clientIDclientSecret。这会返回访问令牌。

请求示例:

curl --data-urlencode "scope=Du.Digitization"
--data-urlencode "client_id={app_id}"
--data-urlencode "client_secret={app_secret}"
--data-urlencode "grant_type=client_credentials" https://cloud.uipath.com/identity_/connect/token
curl --data-urlencode "scope=Du.Digitization"
--data-urlencode "client_id={app_id}"
--data-urlencode "client_secret={app_secret}"
--data-urlencode "grant_type=client_credentials" https://cloud.uipath.com/identity_/connect/token

响应示例:

{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjgwM",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "Du.Digitization.Api"
}
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjgwM",
"expires_in": 3600,
"token_type": "Bearer",
"scope": "Du.Digitization.Api"
}

使用访问令牌

通过将访问令牌设置为对 REST API 发出的每个请求的 Authorization 标头来使用访问令牌。 访问令牌允许您调用需要所选作用域的 API,直到令牌过期(一小时)。 之后,您需要使用 app_idapp_secret获取新的访问令牌。

  • 获取访问令牌
  • 使用访问令牌

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新