---
title: 获取自拍照
description: 获取验证旅程中采集的带水印自拍照。
canonical: https://developer.unico.io/zh-CN/developers/api-reference/get-selfie
locale: zh-CN
generated_by: markdown-export
---

- [/zh-CN/](/zh-CN/)
- API 参考
- 获取自拍照

**本页内容# 获取自拍照

返回用户在 Unico 托管的旅程中采集的生物识别自拍照。图像以带水印的 base64 编码字符串形式返回。
适用于任何执行了生物识别采集的已完成流程，包括智能重新验证旅程（`idsmart`）。如果流程在未进行生物识别采集的情况下完成（例如静默认证），则不可用，因为没有自拍照可返回。
### 端点​

环境URL**生产环境**`GET https://api.idcloud.unico.app/client/v1/process/{processId}/selfie`**沙箱环境**`GET https://api.idcloud.uat.unico.app/client/v1/process/{processId}/selfie`
### 请求​

请求头
请求头值`Authorization``Bearer <access_token>`（参见[身份验证](/zh-CN/developers/start/authentication)）
路径参数
参数类型是否必填描述`processId`string (UUID)是[创建流程](/zh-CN/developers/api-reference/post-processes)返回的流程标识符。
### 示例​

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

```
import fetch from 'node-fetch';const res = await fetch(  `https://api.idcloud.unico.app/client/v1/process/${processId}/selfie`,  { headers: { Authorization: `Bearer ${accessToken}` } });const { fileContents, contentType } = await res.json();// fileContents 是一个 base64 编码的图像字符串
```

### 响应​

200 OK
```
{  "fileContents": "/9j/4AAQSkZJR...",  "contentType": "image/jpeg"}
```

字段类型描述`fileContents`string (base64)采集到的自拍照，经过 base64 编码。包含水印。`contentType`string图像的 MIME 类型——`image/jpeg` 或 `image/png`。
### 错误代码​

备注该 API 不会为此端点暴露具体的 `code` 或 `message` 值。
400 Bad Request401 Unauthorized403 Forbidden404 Not Found`processId` 路径参数缺失或格式错误。Bearer 令牌缺失、已过期或无效。参见[身份验证](/zh-CN/developers/start/authentication)。没有足够的权限访问此流程的自拍照。未找到流程，或流程在未进行生物识别采集的情况下完成，因此没有自拍照可返回。
### 后续步骤​

如需查看完整的流程结果，请参见[获取流程](/zh-CN/developers/api-reference/get-process)。
如需查看证据审计包，请参见[获取证据集](/zh-CN/developers/api-reference/get-evidence-set)。
最后更新 于 2026年10月8日**