> ## 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

> KYC 또는 KYB 세션의 전자 서명 단계에서 문서 한 건의 서명된 PDF를 API 키로 다운로드합니다. Didit API를 사용하세요.

서명자가 서명을 완료하면, 문서 한 건의 서명된 PDF를 반환합니다. URL을 직접 만들 필요는 없습니다. 결정에 포함된 서명된 문서마다 `signatures[].documents[].signed_file`에 경로가 들어 있습니다.

```bash theme={null}
curl -L 'https://verification.didit.me/v3/session/{session_id}/signatures/{node_id}/documents/{document_id}/file/' \
  -H 'x-api-key: YOUR_API_KEY' \
  -o agreement-signed.pdf
```

PDF에는 서명자에게 보여준 문서에 입력 필드 값이 찍혀 있으며, 증거 페이지도 포함됩니다(단계의 `signature_evidence_page`가 꺼져 있는 경우는 제외). Advanced (AES) PDF에는 타임스탬프가 포함된 PAdES 서명도 들어 있습니다. Simple PDF에는 디지털 서명, 인장 또는 타임스탬프가 없습니다. 반환하기 전에 Didit은 저장된 파일을 `sha256_signed`와 대조하며, 두 값이 다르면 `409`와 `signature_document_changed`를 응답합니다.

아직 서명되지 않은 문서는 `signature_not_signed`와 함께 `404`를 반환합니다. [세션을 삭제](https://docs.didit.me/ko/sessions-api/delete-session.md)한 후에는 이 경로가 `404`를 반환합니다.

## 관련 문서

* [전자 서명 보고서](https://docs.didit.me/ko/core-technology/electronic-signature/report-electronic-signature.md#서명된-pdf): 서명된 PDF에 담긴 내용입니다.
* [서명 증거 다운로드](https://docs.didit.me/ko/sessions-api/electronic-signature/download-evidence.md)
* [서명 검증](https://docs.didit.me/ko/sessions-api/electronic-signature/validate-signatures.md)


## OpenAPI

````yaml ko/openapi-25.json GET /v3/session/{sessionId}/signatures/{nodeId}/documents/{documentId}/file/
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}/documents/{documentId}/file/:
    get:
      tags:
        - Sessions
      summary: 서명된 문서 다운로드
      description: >-
        전자 서명 단계 문서 하나의 서명된 PDF를 다운로드합니다. 결정 내 `signatures[].documents[]`의
        `signed_file` 경로를 사용하세요. PDF에는 서명자에게 표시된 문서에 필드 값이 각인된 내용과 증거 페이지가
        포함됩니다(`signature_evidence_page`가 꺼져 있지 않은 경우). 고급(AES) PDF에는 타임스탬프가 포함된
        PAdES 서명도 포함되지만, 단순 PDF에는 디지털 서명, 직인 또는 타임스탬프가 없습니다. Didit은 파일을 반환하기 전에
        `sha256_signed`와 대조하여 확인합니다.


        사용자 인증(KYC) 및 기업 확인(KYB) 세션에서 작동합니다. `read:sessions` 권한이 필요하며, 기존 API 키를
        사용할 수 있습니다. [전자 서명
        보고서](/ko/core-technology/electronic-signature/report-electronic-signature#서명된-문서-다운로드)를
        참조하세요.
      operationId: get_v3_session_signature_document_file
      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: documentId
          in: path
          required: true
          description: '`signatures[].documents[]` 내 문서의 `id`입니다.'
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: 서명된 PDF입니다.
          headers:
            Content-Disposition:
              description: 파일 이름이 포함된 첨부 파일입니다.
              schema:
                type: string
                example: attachment; filename="agreement-signed.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 document:
                  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_document(
                "11111111-2222-3333-4444-555555555555",
                "feature_signature",
                "11111111-2222-3333-4444-555555555555",
            )
            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.downloadDocument(
              "11111111-2222-3333-4444-555555555555",
              "feature_signature",
              "11111111-2222-3333-4444-555555555555",
            );

            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.DownloadDocument(ctx, \"11111111-2222-3333-4444-555555555555\", \"feature_signature\", \"11111111-2222-3333-4444-555555555555\")\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().downloadDocument("11111111-2222-3333-4444-555555555555",
            "feature_signature", "11111111-2222-3333-4444-555555555555")
                    .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->downloadDocument('11111111-2222-3333-4444-555555555555',
            'feature_signature', '11111111-2222-3333-4444-555555555555');

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

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

            content = didit.sessions.signatures.download_document(
              "11111111-2222-3333-4444-555555555555",
              "feature_signature",
              "11111111-2222-3333-4444-555555555555"
            )
            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.DownloadDocumentAsync("11111111-2222-3333-4444-555555555555",
            "feature_signature", "11111111-2222-3333-4444-555555555555");

            await content.SaveToAsync("download.pdf");
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Business Console의 Developers -> API keys에서 발급받은 귀하 애플리케이션의 API 키입니다. 기본
        키는 전체 접근 권한을 갖습니다. 이름이 지정된 키는 리소스별 none, read, write 범위로 권한을 제한할 수 있으며
        특정 워크플로나 승인된 세션, IP 주소 목록, 만료일 등으로 제한할 수도 있습니다. 401은 키가 잘못되었거나 폐기되었거나
        만료되었음을 의미합니다. 403은 키가 전송되지 않았거나, 키에 해당 리소스나 작업에 대한 접근 권한이 없거나, 요청이 허용된
        IP 목록 외부 주소에서 발생했음을 의미합니다. 세션 경로에서의 404는 해당 세션이 키의 허용 워크플로 또는 상태 범위를
        벗어났음을 의미합니다. 미디어 접근 권한이 없는 키는 이미지, 비디오, PDF URL을 null로 수신하며, 세션 write
        권한이 없는 키는 세션 링크와 token을 null로 수신합니다.
        https://docs.didit.me/console/api-keys 를 참고하십시오.

````

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