通过标识符检索已有流程。根据 API 合约,结果已在流程创建时同步返回——请将此端点用于重新查询、审计和支持场景。
在获取流程之前,请查看我们的 webhook 配置和回退策略 — 点击此处。
端点
| 环境 | URL |
|---|---|
| 生产环境 | GET https://api.id.unico.app/processes/v1/{processId} |
| 沙箱环境 | GET https://api.id.uat.unico.app/processes/v1/{processId} |
请求
| 请求头 | 值 |
|---|---|
Authorization | Bearer <access_token> |
APIKEY | 已配置的 API 密钥。 |
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
processId | string (UUID) | 是 | 由创建流程返回的流程标识符。 |
示例
- cURL
- Node.js
curl -X GET https://api.id.unico.app/processes/v1/$PROCESS_ID \
-H "Authorization: Bearer $TOKEN" \
-H "APIKEY: $API_KEY"
import fetch from 'node-fetch';
const res = await fetch(
`https://api.id.unico.app/processes/v1/${processId}`,
{
headers: {
Authorization: `Bearer ${accessToken}`,
APIKEY: apiKey
}
}
);
const result = await res.json();
响应
该合约是统一的——idCloud.result 字段承载了所用功能的整合判定结果。
Unico 将已执行功能的结果整合为单一的 idCloud.result,可直接用于决定您流程的下一步——无需自行编排各项结果。
{
"id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
"status": 3,
"idCloud": {
"result": "approved"
}
}
| idCloud.result | Meaning | Recommended action |
|---|---|---|
| approved | Real person and validated identity. | Proceed with the flow. |
| denied | Identity not validated, liveness check failed, or extreme risk identified. | End the flow or redirect to an alternative flow. |
| critical-risk | Critical risk level identified. | End the flow or route to manual review. |
| high-risk | High risk level identified. | Route to manual review or an alternative flow. |
| retry | Insufficient capture or score to evaluate. | Ask the user for a new capture. |
| inconclusive | Not enough evidence for a verdict. | Route to manual review or an alternative flow. |
返回的值取决于您 APIKey 中配置的配方。各配方可返回的结果值请参见流程。
何时使用此端点
API 合约同步返回结果,因此大多数集成不需要使用此端点。请在以下情况下使用:
- 您仅持久化了
processId,需要稍后检索完整结果(审计、支持场景)。 - 您怀疑原始响应在传输过程中丢失(平台完成处理后发生网络错误)。
- 您正在构建用于审查历史流程的后台管理工具。
错误代码
- 400 Bad Request
- 404 Not Found
- 403 Forbidden
- 410 Gone
- 429 Too Many Requests
- 500 Internal Server Error
| 代码 | 消息 | 描述 |
|---|---|---|
20023 | O parâmetro processId não foi informado. | 缺少流程 ID 参数。 |
20002 | O parâmetro APIKey não foi informado. | 请求头中缺少 APIKEY 参数。 |
20001 | O parâmetro authtoken não foi informado. | 请求头中缺少集成令牌参数。 |
| 代码 | 消息 | 描述 |
|---|---|---|
50001 | O processo informado não foi encontrado. | 该流程在数据库中不存在。 |
| 代码 | 消息 | 描述 |
|---|---|---|
30017 | User does not have permission to perform this action. | JWT 格式错误或用户无权执行此操作。 |
10502 | O token informado está expirado. | 使用的访问令牌已过期。 |
10501 | O token informado é inválido. | 认证令牌无效。 |
10201 | O AppKey informado é inválido. | APIKEY 参数未输入或不存在。 |
流程存在,但结果为错误。仅返回 id 和 status: 5。
Rate limit reached. When your system receives an HTTP 429 error, you must implement mechanisms to prevent cascading failures and avoid worsening the restriction.
Best practices:
- Cool-down period (backoff): Immediately halt or throttle subsequent requests from your system. Do not continuously retry failed requests in a tight loop.
- Queueing & throttling: Buffer or queue outgoing requests on your end to control the traffic flow before re-sending them.
- Exponential backoff with jitter: When retrying, increase the waiting time exponentially between attempts (e.g., 1 s, 2 s, 4 s, 8 s) and add a small random delay ("jitter") to prevent a herd effect where all queued requests retry at the exact same millisecond.
Continuously hitting a rate-limited endpoint without backing off can prolong the restriction period and severely impact your system's operational throughput. Properly throttling requests on your side ensures a smoother, more resilient integration.
For default limits, increase requests and additional details, see Rate Limits.
| 代码 | 消息 | 描述 |
|---|---|---|
99999 | Internal failure! Try again later | 出现内部错误时。 |
流程
配方是项目 APIKey 中配置的功能组合(活体检测、身份验证、风险信号、文档等)。它定义了 Unico 在每个流程中执行的操作,以及如何将结果整合为单一的 result —— 您无需在自己一侧进行任何编排。
Unico 维护着一个预设配方目录,每个配方都有名称并进行版本管理(例如 byunico-idlive-idunico-oneresponse-std)。其中一些配方仅限巴西使用,例如包含评分、Serpro 或年龄验证的配方。
功能组合——即您项目的流程——由您的 APIKey 配置定义。请查看预设配方,或联系您的 Unico 项目负责人进行定制。