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

> 以前にアップロードされた添付ファイルをダウンロードします。安全なファイルアクセスのために、署名付きURLへのリダイレクトを返します。

# 添付ファイルをダウンロード

このエンドポイントを使用すると、Devin セッションからファイルをダウンロードできます。リソースをアップロードする場合は、[アップロード用エンドポイント](/ja/api-reference/v1/attachments/upload-files-for-devin-to-work-with)を使用してください。

このエンドポイントは、ファイルへの一時的なアクセスを提供する署名付きURLへの 307 リダイレクトを返します。署名付きURLの有効期限は 60 秒です。

<div id="example-usage">
  ## 使用例
</div>

```python theme={null}
import requests

# 添付ファイルをダウンロード
response = requests.get(
    f"https://api.devin.ai/v1/attachments/{uuid}/{filename}",
    headers={"Authorization": f"Bearer {DEVIN_API_KEY}"},
    allow_redirects=True
)

# ファイルコンテンツを保存
with open(filename, "wb") as f:
    f.write(response.content)
```


## OpenAPI

````yaml ja/v1-openapi.yaml GET /v1/attachments/{uuid}/{name}
openapi: 3.1.0
info:
  description: Personal APIキーおよびService APIキーに対応するDevin v1 API
  title: Devin API v1
  version: 1.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v1/attachments/{uuid}/{name}:
    get:
      summary: 添付ファイルをダウンロード
      description: APIキー認証を使用して添付ファイルをダウンロードします。署名付きURLへのリダイレクトレスポンスを返します。
      operationId: download_attachment_customer_endpoint_v1_attachments__uuid___name__get
      parameters:
        - in: path
          name: uuid
          required: true
          schema:
            title: Uuid
            type: string
        - in: path
          name: name
          required: true
          schema:
            title: Name
            type: string
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: 成功時のレスポンス
        '307':
          description: 署名付きダウンロードURLにリダイレクト
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: バリデーションエラー
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 個人用APIキー (apk_user_\*) またはサービス用APIキー (apk_\*)
      scheme: bearer
      type: http

````