> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 电子签名证据 API：审计追踪 PDF

> 通过 Didit 下载签署人的证据 PDF，包含文档哈希值和字段值，以及高级（AES）电子签名的身份、验证码、证书和时间戳。

返回某位签署人完成签署后的证据 PDF。路径位于 `signatures[].evidence_file` 中，其中 `signature_id` 已设置。

```bash theme={null}
curl -L 'https://verification.didit.me/v3/session/{session_id}/signatures/{node_id}/evidence/?signature_id={signature_id}' \
  -H 'x-api-key: YOUR_API_KEY' \
  -o signature-evidence.pdf
```

> [!WARNING]
>
> 务必传入 `signature_id`。企业验证（KYB）步骤可能有多名签署人，如果不传入，路由会自行选择其中一人。

证据 PDF 记录签名级别和格式、签署人、地址、每份文件及其原始 SHA-256、采用的签名、每个字段的值及其来源和时间、最终同意，以及每份已签署文件的 SHA-256。对于高级（AES）签名，它还会记录已验证身份的会话、验证码确认、证书和时间戳；简单签名则不包含这些内容。请参阅[证据 PDF](https://docs.didit.me/zh/core-technology/electronic-signature/report-electronic-signature.md#证据-pdf)。

对于尚未签署的签署人，请求将返回 `404`，并附带 `signature_not_signed`。在您[删除会话](https://docs.didit.me/zh/sessions-api/delete-session.md)后，该路由将返回 `404`。

## 相关内容

* [下载已签署的文件](https://docs.didit.me/zh/sessions-api/electronic-signature/download-signed-document.md)
* [电子签名报告](https://docs.didit.me/zh/core-technology/electronic-signature/report-electronic-signature.md)


## OpenAPI

````yaml zh/openapi-25.json GET /v3/session/{sessionId}/signatures/{nodeId}/evidence/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/signatures/{nodeId}/evidence/:
    get:
      tags:
        - Sessions
      summary: 下载签名证据
      description: >-
        下载签署人的证据 PDF：级别和格式、签署人、IP 地址、包含原始 SHA-256 及字段值的每份文件，以及每个已签署文件的
        SHA-256，对于高级（AES）签名，还包括已验证的身份会话、验证码确认、证书和时间戳。请使用 `signatures[]` 中签署人条目的
        `evidence_file` 路径。


        当企业验证（KYB）步骤包含多位签署人时，务必传递 `signature_id`：若未传递，该路由会选择该步骤中的一名签署人。需要
        `read:sessions` 权限；您的 API 密钥有效。
      operationId: get_v3_session_signature_evidence
      parameters:
        - name: sessionId
          in: path
          required: true
          description: 用户验证（KYC）或企业验证（KYB）会话。
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: nodeId
          in: path
          required: true
          description: 电子签名步骤：`signatures[]` 中项目的 `node_id`。
          schema:
            type: string
            example: feature_signature
        - name: signature_id
          in: query
          required: false
          description: '`signatures[]` 中签署人条目的 `id`。'
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: 佐证材料 PDF。
          headers:
            Content-Disposition:
              description: 包含文件名的附件。
              schema:
                type: string
                example: attachment; filename="signature-evidence.pdf"
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '403':
          description: 缺少凭据，或凭据无法读取此会话。缺少密钥返回 `403`；错误、已撤销或已过期的密钥返回 `401`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              example:
                detail: You do not have permission to perform this action.
        '404':
          description: 无匹配证据：会话、步骤或签署人不存在、已被删除，或尚未签署。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
              examples:
                Not signed yet:
                  summary: 签署人尚未签署
                  value:
                    code: signature_not_signed
                    detail: signature_not_signed
                Unknown signer:
                  summary: 该步骤中不存在此签名
                  value:
                    code: signature_not_found
                    detail: signature_not_found
        '409':
          description: 存储的文件与其记录的 SHA-256 不再匹配。未返回任何内容。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
              examples:
                Changed file:
                  summary: 存储的文件与其哈希值不匹配
                  value:
                    code: signature_document_changed
                    detail: signature_document_changed
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            content = client.sessions.signatures.download_evidence(
                "11111111-2222-3333-4444-555555555555",
                "feature_signature",
            )
            with open("download.pdf", "wb") as file:
                file.write(content)
        - lang: javascript
          label: Node.js
          source: >-
            import { writeFile } from "node:fs/promises";

            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const content = await didit.sessions.signatures.downloadEvidence(
              "11111111-2222-3333-4444-555555555555",
              "feature_signature",
            );

            await writeFile("download.pdf", Buffer.from(await
            content.arrayBuffer()));
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresp, err := client.Sessions.Signatures.DownloadEvidence(ctx, \"11111111-2222-3333-4444-555555555555\", \"feature_signature\", didit.SessionsSignaturesDownloadEvidenceParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer resp.Body.Close()\nfile, err := os.Create(\"download.pdf\")\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer file.Close()\nif _, err := io.Copy(file, resp.Body); err != nil {\n\tlog.Fatal(err)\n}"
        - lang: java
          label: Java
          source: >-
            import java.nio.file.Path;

            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            client.sessions().signatures().downloadEvidence("11111111-2222-3333-4444-555555555555",
            "feature_signature")
                    .writeTo(Path.of("download.pdf"));
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $content =
            $didit->sessions->signatures->downloadEvidence('11111111-2222-3333-4444-555555555555',
            'feature_signature');

            $content->saveTo('download.pdf');
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            content = didit.sessions.signatures.download_evidence(
              "11111111-2222-3333-4444-555555555555",
              "feature_signature"
            )
            File.binwrite("download.pdf", content)
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var content = await
            client.Sessions.Signatures.DownloadEvidenceAsync("11111111-2222-3333-4444-555555555555",
            "feature_signature");

            await content.SaveToAsync("download.pdf");
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.