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

# ダウンロードURLを取得

> 完了した注文ファイルのダウンロードURLを発行します。
- `complete` ステータスの注文でのみ利用可能
- URLの有効期限は1時間
- 注文ファイルは注文作成から最大7日間ダウンロード可能
- 7日経過後、注文は `expired` ステータスに移行し、ファイルはダウンロードできなくなります



## OpenAPI

````yaml ja/api-reference/openapi.yaml GET /api/v2/orders/{orderId}/download
openapi: 3.0.0
info:
  title: BIZ MORI API
  version: 2.0.0
  description: >-
    BIZ MORI API は、デジタルコンテンツ保護のための4つのコアサービスを提供します:

    - **Anti-AI**: 画像をAI学習から保護

    - **Watermark Embed**: 画像に不可視のデジタル watermark を埋め込み

    - **Watermark Extract**: 画像から watermark を抽出・検証

    - **AI Detection**: 画像がAI生成かどうかを検知

    - **テストAPIキー**: `sk_test_`
    プレフィックスのキーは同じBearer認証を使用し、実際の処理サービスの実行やクレジットの消費なしに注文ライフサイクルを検証できます。テストアップロードの内容は破棄され、結果ファイルは作成されません
  contact:
    name: BIZ MORI サポート
    email: support@bizmori.com
servers:
  - url: https://api.bizmori.com
    description: 本番環境
security: []
tags:
  - name: Anti-AI
    description: Anti-AI画像保護の注文
  - name: Watermark Embed
    description: watermark 埋め込みの注文
  - name: Watermark Extract
    description: watermark 抽出の注文
  - name: AI Detection
    description: AI生成画像検知の注文
  - name: Orders
    description: 注文の照会と管理
  - name: Webhooks
    description: Webhookの設定とイベント
paths:
  /api/v2/orders/{orderId}/download:
    get:
      tags:
        - Orders
      summary: ダウンロードURLを取得
      description: |-
        完了した注文ファイルのダウンロードURLを発行します。
        - `complete` ステータスの注文でのみ利用可能
        - URLの有効期限は1時間
        - 注文ファイルは注文作成から最大7日間ダウンロード可能
        - 7日経過後、注文は `expired` ステータスに移行し、ファイルはダウンロードできなくなります
      parameters:
        - in: path
          name: orderId
          required: true
          schema:
            type: string
          description: 注文ID
      responses:
        '200':
          description: URLの発行に成功しました
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                        description: ダウンロードURL（プリサインド）
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET https://api.bizmori.com/api/v2/orders/ORDER_ID/download
            \
              -H "Authorization: Bearer YOUR_API_TOKEN"
        - lang: javascript
          label: JavaScript
          source: |-
            const orderId = 'ORDER_ID';
            const response = await fetch(
              `https://api.bizmori.com/api/v2/orders/${orderId}/download`,
              { headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' } }
            );
            const data = await response.json();
            // data.data.url contains the presigned download URL
        - lang: python
          label: Python
          source: |-
            import requests

            order_id = 'ORDER_ID'
            response = requests.get(
                f'https://api.bizmori.com/api/v2/orders/{order_id}/download',
                headers={'Authorization': 'YOUR_API_KEY'}
            )
            data = response.json()
            # data['data']['url'] contains the presigned download URL
components:
  responses:
    Unauthorized:
      description: 認証失敗
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: AUTH_NOT_AUTHENTICATED
    NotFound:
      description: リソースが見つかりません
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: RESOURCE_NOT_FOUND
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: エラーコード
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        外部クライアントアクセス用のBearer APIキー。本番キーは `sk_` プレフィックスを使用し、テストキーは `sk_test_`
        プレフィックスを使用して、処理やクレジット消費なしに注文ライフサイクルを検証します。

````