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

- [/zh-CN/](/zh-CN/)
- [API 参考](/zh-CN/dual-api/developers/api-reference/)
- [Web 与原生](/zh-CN/dual-api/developers/api-reference/web-sdk/)
- 获取自拍照

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

返回用户在 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/dual-api/developers/api-reference/authentication)）
路径参数
参数类型必填描述`processId`string (UUID)是由[创建流程](/zh-CN/dual-api/developers/api-reference/web-sdk/post-process)返回的流程标识符。
### 示例​

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 is a base64-encoded image string
```

### 响应​

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

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

备注该端点不提供具体的 `code` 或 `message` 值。
400 Bad Request401 Unauthorized403 Forbidden404 Not Found`processId` 路径参数缺失或格式错误。Bearer token 缺失、已过期或无效。参见[身份验证](/zh-CN/dual-api/developers/api-reference/authentication)。权限不足，无法访问此流程的自拍照。未找到该流程，或该流程在未进行生物特征采集的情况下即已结束，因此没有可返回的自拍照。
### 下一步​

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