메인 콘텐츠로 건너뛰기

재사용 가능한 문서 조회

MarkdownChatGPTClaude

이 엔드포인트를 사용하여 새로운 Document 캡처 플로우를 시작하기 전에 사용자가 이미 재사용 가능한 문서를 가지고 있는지 확인하세요. 문서가 발견되면 해당 documentId를 POST /processes/v1(Document 유형)에 직접 전달하여 캡처 단계를 건너뛸 수 있습니다.

Endpoint​

환경URL
프로덕션GET https://api.idcloud.unico.app/documents/v1
샌드박스GET https://api.idcloud.uat.unico.app/documents/v1

요청​

헤더
헤더값
AuthorizationBearer <access_token> (인증 참조)
APIKEYDocument Capture and Reuse가 활성화된 프로비저닝된 API 키.
쿼리 매개변수
매개변수유형필수설명
codestring예사용자 식별자(CPF 또는 CURP, 형식 없이).
typestring예조회할 문서 유형입니다. 허용되는 값: BR_RG, BR_CNH, BR_CIN, BR_PASSPORT.
참고

위의 type 값은 이 엔드포인트에만 해당됩니다. 다음과 혼동하지 마세요:

  • POST 요청의 subject.duiType — DUI_TYPE_* 접두사를 사용하며 문서 유형이 아니라 사람을 식별합니다(예: DUI_TYPE_BR_CPF).
  • 응답의 documentType — 전체 레지스트리 경로를 사용합니다(예: unico.moja.dictionary.br.cnh.v2.Cnh).

예제​

curl -X GET "https://api.idcloud.unico.app/documents/v1?code=12345678909&type=BR_CNH" \
-H "Authorization: Bearer $TOKEN" \
-H "APIKEY: $API_KEY"

응답​

200 OK
{
"items": [
{
"documentType": "unico.moja.dictionary.br.cnh.v2.Cnh",
"documentId": "doc-abc-123"
}
]
}
필드유형설명
itemsarray사용자에 대해 발견된 재사용 가능한 문서 목록입니다. 지정된 code와 type에 대해 재사용 가능한 문서가 없으면 빈 배열입니다.
items[].​documentTypestring문서 유형 식별자입니다. 가능한 값: unico.​moja.​dictionary.​br.​rg.​v2.​Rg, unico.​moja.​dictionary.​br.​cnh.​v2.​Cnh, unico.​moja.​dictionary.​br.​cin.​v1.​Cin, unico.​moja.​dictionary.​br.​passaporte.​v1.​Passaporte.
items[].documentIdstring문서 식별자입니다. 문서를 재사용하려면 POST /processes/v1의 document.documentId에 이 값을 전달하세요.

documentId를 재사용에 사용하기​

documentId를 확보하면, 캡처를 건너뛰기 위해 이를 Document 프로세스 요청에 전달하세요:

{
"subject": {
"code": "12345678909",
"name": "Luke Skywalker"
},
"document": {
"purpose": "onboarding",
"authProcessId": "<biometric-process-id>",
"documentId": "doc-abc-123"
}
}
필드설명
document.purpose이 문서 프로세스의 비즈니스 목적입니다. 허용되는 값: creditprocess, carpurchase, paybypaycheck, onboarding, fgts. 이 값들은 Document API에 특화된 것으로, 생체 인식 SDK의 purpose 열거형과 다릅니다.
document.​authProcessId이 사용자에 대해 이전에 생성된 생체 인식 프로세스의 ID입니다(POST /processes/v1에서 발급됨).
document.documentId이 엔드포인트의 응답에서 얻은 문서 ID입니다. 이 값이 제공되면 document.files는 생략할 수 있습니다 — 플랫폼이 이전에 캡처된 문서를 자동으로 조회합니다.

오류 코드​

코드메시지설명
20507O parâmetro subject.code é inválido.식별자 값(CPF 또는 CURP)의 형식이 잘못되었거나 존재하지 않습니다.
20002O parâmetro APIKey não foi informado.APIKEY 헤더가 누락되었습니다.
20001O parâmetro authtoken não foi informado.인증 토큰 헤더가 누락되었습니다.