跳转到主要内容

获取流程

警告

在获取流程之前,请查看我们的 webhook 配置和回退策略——点击此处

端点

环境URL
生产环境GET https://api.idcloud.unico.app/client/v1/process/{processId}
沙盒环境GET https://api.idcloud.uat.unico.app/client/v1/process/{processId}

请求

请求头
请求头
AuthorizationBearer <access_token>
路径参数
参数类型必填描述
processIdstring (UUID)创建流程返回的流程标识符。

示例

curl -X GET https://api.idcloud.unico.app/client/v1/process/$PROCESS_ID \
-H "Authorization: Bearer $TOKEN"

响应

200 OK
{
"process": {
"id": "53060f52-f146-4c12-a234-5bb5031f6f5b",
"flow": "idunicosign",
"callbackUri": "https://example.com/callback",
"userRedirectUrl": "https://example.com/redirect",
"state": "PROCESS_STATE_FINISHED",
"result": "PROCESS_RESULT_OK",
"createdAt": "2024-01-01T10:00:00Z",
"finishedAt": "2024-01-01T10:15:00Z",
"expiresAt": "2024-01-08T10:00:00Z",
"purpose": "VERIFICATION",
"clientReference": "client-ref-abc",
"useCase": "smart_revalidation",
"capacities": ["liveness", "face_match"],
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"person": {
"duiType": "DUI_TYPE_BR_CPF",
"duiValue": "12345678909",
"friendlyName": "Luke Skywalker",
"notifications": [
{
"notificationChannel": "email"
}
]
},
"authenticationInfo": {
"authenticationId": "auth-123",
"livenessResult": "LIVENESS_RESULT_LIVE",
"authenticationResult": "AUTHENTICATION_RESULT_INCONCLUSIVE",
"identityFraudstersResult": "TRUST_RESULT_INCONCLUSIVE",
"bioTokenEngineResult": "BIO_TOKEN_ENGINE_RESULT_UNSPECIFIED",
"smartRevalidationResult": "SMART_REVALIDATION_RESULT_UNSPECIFIED",
"idAgeResult": "ID_AGE_RESULT_UNSPECIFIED",
"scoreEngineResult": {
"scoreEnabled": "SCORE_ENABLED_TRUE",
"score": 85.5
},
"serproResult": {
"score": 92
}
},
"companyData": {
"branchId": "branch-123",
"countryCode": "BR"
},
"bioTokenData": {
"referenceProcessId": "ref-proc-123",
"authenticationId": "auth-ref-123"
},
"services": [
{
"envelopeId": "4d4f3d90-04a3-4259-b63b-930ab10d2e47",
"documentIds": ["doc-abc-123"],
"consent_granted": true,
"documents": [
{
"doc_id": "doc-abc-123",
"typified": true,
"cpf_match": true,
"face_match": true,
"validate_doc": true,
"reused_doc": false,
"signed_url": "https://example.com/doc?token=xyz",
"doc": {
"version": 1,
"code": "CNH",
"data": {
"numero": "044589731564",
"cpfNumero": "12345678909",
"nomeCivil": "Luke Skywalker",
"dataNascimento": "1990-05-12T00:00:00Z",
"dataExpiracao": "2027-12-07T00:00:00Z",
"categoria": "B"
}
}
}
]
}
]
}
}
顶层字段
字段类型描述
process.idstring (UUID)流程标识符。
process.flowstring创建时发送的流程标识符。
process.callbackUristring为流程事件配置的回调 URL。
process.userRedirectUrlstring用户完成流程后的跳转 URL。
process.stateenum当前流程状态。见下方值说明。
process.resultenum验证结果。仅在 state = PROCESS_STATE_FINISHED 时存在。
process.createdAtstring (datetime)流程创建时的 ISO 8601 时间戳。
process.finishedAtstring (datetime)流程完成时的 ISO 8601 时间戳。仅在 state = PROCESS_STATE_FINISHED 时存在。
process.expiresAtstring (datetime)流程过期时的 ISO 8601 时间戳。
process.purposestring流程中配置的目的。
process.clientReferencestring可选的客户端侧引用,用于在门户中建立索引。
process.useCasestring与流程关联的用例标识符。
process.capacitiesarray of strings本流程中激活的能力列表。
process.tokenstring用于 SDK 集成的签名 JWT。
process.personobject创建时提供的身份信息。
process.person.notificationsarray为流程配置的通知渠道(例如 email)。
process.authenticationInfoobject各功能的结果。见下方说明。
process.companyDataobject公司和分支机构上下文。
process.companyData.branchIdstring分支机构标识符。
process.companyData.countryCodestringISO 3166-1 alpha-2 国家代码。
process.bioTokenDataobject参考流程信息——仅在 1:1 验证和智能重新验证流程中存在。
process.servicesarray已签名信封、采集文件及其他服务输出。见下方说明。
process.state 值
含义
PROCESS_STATE_CREATED流程已创建;用户尚未完成流程。
AWAITING_FOR_DOCUMENT流程已在无身份证件的情况下创建;等待通过设置流程文件进行设置。仅在自定义流程允许可选文件时出现。
PROCESS_STATE_FINISHED流程已完成。检查 resultauthenticationInfo
PROCESS_STATE_FAILED处理错误。
状态命名不一致

AWAITING_FOR_DOCUMENT 不遵循其他状态使用的 PROCESS_STATE_* 前缀规则。这是当前 API 中已知的命名不一致问题。

process.result 值
含义
PROCESS_RESULT_OK所有功能均返回正面结果。
PROCESS_RESULT_INVALID_IDENTITY至少一个功能返回明确的负面结果(例如活体检测失败、身份不匹配)。
PROCESS_RESULT_ERROR结果处理过程中发生错误。
PROCESS_RESULT_EXPIRED流程在完成前已过期。
PROCESS_RESULT_UNSPECIFIED流程尚未完成。
authenticationInfo 中的功能结果

无论流程如何,所有字段始终返回。未在流程中使用的功能字段返回 *_UNSPECIFIED

响应场景中的缩写形式

响应场景页面使用枚举值的缩写形式(例如 livenessResult = LIVEauthenticationResult = INCONCLUSIVE)以提升可读性。这些缩写直接对应此处记录的完整枚举值(LIVENESS_RESULT_LIVEAUTHENTICATION_RESULT_INCONCLUSIVE 等)——为简洁起见省略了前缀。

字段功能可能的值
authenticationId本次认证尝试的唯一标识符。
livenessResult活体检测LIVENESS_RESULT_LIVE, LIVENESS_RESULT_NOT_LIVE, LIVENESS_RESULT_UNSPECIFIED
authenticationResult身份验证AUTHENTICATION_RESULT_POSITIVE, AUTHENTICATION_RESULT_NEGATIVE, AUTHENTICATION_RESULT_INCONCLUSIVE, AUTHENTICATION_RESULT_UNSPECIFIED
identityFraudstersResult欺诈风险分类TRUST_RESULT_YES, TRUST_RESULT_INCONCLUSIVE, TRUST_RESULT_UNSPECIFIED
bioTokenEngineResult1:1 验证BIO_TOKEN_ENGINE_RESULT_POSITIVE, BIO_TOKEN_ENGINE_RESULT_NEGATIVE, BIO_TOKEN_ENGINE_RESULT_UNSPECIFIED
smartRevalidationResult智能重新验证SMART_REVALIDATION_RESULT_POSITIVE, SMART_REVALIDATION_RESULT_NEGATIVE, SMART_REVALIDATION_RESULT_UNSPECIFIED
idAgeResult年龄验证ID_AGE_RESULT_POSITIVE, ID_AGE_RESULT_NEGATIVE, ID_AGE_RESULT_INCONCLUSIVE, ID_AGE_RESULT_UNSPECIFIED
scoreEngineResult.scoreEnabled风险评分SCORE_ENABLED_TRUE, SCORE_ENABLED_FALSE, SCORE_ENABLED_UNSPECIFIED
scoreEngineResult.score风险评分-100 到 +100 之间的数值。当 authenticationResult = AUTHENTICATION_RESULT_INCONCLUSIVE 且启用欺诈风险分类时存在。
serproResult.scoreSerpro 相似度0100(相似度);-1(该 CPF 无人脸档案);-2(集成错误)。
process.services 字段
字段类型描述
envelopeIdstring (UUID)已签名信封标识符。
documentIdsarray of strings本服务中采集的文件 ID。
consent_grantedboolean用户是否授予数据共享同意。
documentsarray包含 OCR 数据和验证结果的采集文件。
documents[].doc_idstring文件标识符。
documents[].typifiedboolean文件类型是否已成功识别。
documents[].cpf_matchboolean文件上的 CPF 是否与提供的 CPF 匹配。
documents[].face_matchboolean自拍是否与文件上的照片匹配。
documents[].validate_docboolean文件是否通过真实性验证。
documents[].reused_docboolean此文件是否来自之前流程的复用。
documents[].signed_urlstring用于下载文件 PDF 的预签名 URL(有效期 5 分钟——需重新获取以续期)。
documents[].doc.versionintegerOCR 模式版本。
documents[].doc.codestring文件类型代码(例如 CNHRG)。
documents[].doc.dataobject提取的 OCR 字段。内容因文件类型和可用数据而异。
400 Bad Request

processId 路径参数缺失或格式不正确。

401 Unauthorized

Bearer 令牌缺失、已过期或无效。

404 Not Found

processId 不存在或不属于已认证的租户。

429 Too Many Requests

已达到速率限制。

错误代码

代码消息描述
3process id is invalid当流程 ID 无效时。

轮询与 webhook

您可以轮询此端点检查进度,但推荐的方式是订阅 webhook,仅在备用情况下调用此端点。参见 Webhooks 与事件

下一步