Document Understanding
最新
False
  • 入门指南
    • 概述
      • 使用 HTTP 请求的凭据
      • 在 Swagger 中使用凭据
    • 限制和配额
  • 使用 Document Understanding API 的示例
  • 许可
横幅背景图像
Document Understanding API 指南
上次更新日期 2024年5月16日

使用 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/tokencurl --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获取新的访问令牌。
  • 获取访问令牌
  • 使用访问令牌

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.