> For the complete documentation index, see [llms.txt](https://2sign-co-il.gitbook.io/2sign.co.il-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://2sign-co-il.gitbook.io/2sign.co.il-docs/tasks-attachments/get-task-attachments.md).

# Get task attachments

Use these endpoints to retrieve files from a completed task.

{% hint style="info" %}
Blob URLs expire. Download the file immediately or store it on your side.
{% endhint %}

***

### Before you start

These endpoints use query parameters on a `GET` request.

**Header**

```http
Authorization: Bearer <token>
```

### Common query parameters

| Parameter          | Type   | Required | Description                                |
| ------------------ | ------ | -------- | ------------------------------------------ |
| `guid`             | string | ✅        | Task GUID                                  |
| `taskId`           | int    | ❌        | Optional. Relevant for single-task flows.  |
| `fileDownloadType` | int    | ❌        | `0` = link only, `1` = bytes, `2` = Base64 |

**Request example**

```http
GET /api/V2/BaseTasks/GetSignedTaskLocationBlob?guid=01823172-5211-477c-8b30-4d7a37ebcb48&fileDownloadType=0
Authorization: Bearer <token>
```

***

### Choose the right endpoint

| Goal                       | URL                                                       |
| -------------------------- | --------------------------------------------------------- |
| **Get All Attachments**    | `GET /api/V2/BaseTasks/GetAllAttachmentsLocationBlob`     |
| **Get Signed Document**    | `GET /api/V2/BaseTasks/GetSignedTaskLocationBlob`         |
| **Get Original Document**  | `GET /api/V2/BaseTasks/GetOriginalTaskLocationBlob`       |
| **Get General Attachment** | `GET /api/V2/BaseTasks/GetGeneralAttachmentsLocationBlob` |
| **Get Location of ID**     | `GET /api/V2/BaseTasks/GetIdAttachmentLocationBlob`       |
| **Get Attachments Excel**  | `GET /api/V2/BaseTasks/GetExcelAttachmentsLocationBlob`   |

***

### File download types

The `fileDownloadType` parameter controls what each endpoint returns. The response includes all three field variants, but only one is populated.

| `fileDownloadType` | Description        | Populated field |
| ------------------ | ------------------ | --------------- |
| `0`                | Blob URL (default) | `*LinkBlob`     |
| `1`                | Raw bytes          | `*BlobFile`     |
| `2`                | Base64 encoded     | `*Base64File`   |

**Example - signed document**

`fileDownloadType: 0` - link only

```json
{
  "SignedTaskLinkBlob": "https://2signdocuments.blob.core.windows.net/.../_signed.pdf?...",
  "SignedTaskFile": "",
  "SignedTaskBase64File": ""
}
```

`fileDownloadType: 1` - bytes

```json
{
  "SignedTaskLinkBlob": "",
  "SignedTaskFile": "<binary bytes>",
  "SignedTaskBase64File": ""
}
```

`fileDownloadType: 2` - Base64

```json
{
  "SignedTaskLinkBlob": "",
  "SignedTaskFile": "",
  "SignedTaskBase64File": "<base64 string>"
}
```

{% hint style="info" %}
Use `0` to redirect users to a file download. Use `1` to save the file server-side. Use `2` to pass the file in JSON or display it in a frontend app.
{% endhint %}

{% hint style="info" %}
Field names vary by attachment type. For example, the original document uses `OriginalBlobFile`, while the signed document uses `SignedTaskFile`.
{% endhint %}

***

### Get all attachments

Use this endpoint when you want every available task file in one response.

**Response - 200 OK**

```json
{
  "Status": "success",
  "Message": "",
  "ResponseObject": {
    "TaskGuid": "01823172-5211-477c-8b30-4d7a37ebcb48",
    "IsSigned": true,
    "OriginalTaskLinkBlob": "https://2signdocuments.blob.core.windows.net/...",
    "OriginalBlobFile": "",
    "OriginalBase64File": "",
    "SignedTaskLinkBlob": "https://2signdocuments.blob.core.windows.net/...",
    "SignedTaskFile": "",
    "SignedTaskBase64File": "",
    "IdCardAttachmentLinkBlob": "https://2signdocuments.blob.core.windows.net/...",
    "IdCardAttachmentBlobFile": "",
    "IdCardAttachmentBase64File": "",
    "GeneralAttachmentsLinkBlob": "https://2signdocuments.blob.core.windows.net/...",
    "GeneralAttachmentsBlobFile": "",
    "GeneralAttachmentsBase64File": "",
    "ExcelAttachmentsLinkBlob": "",
    "ExcelAttachmentsBlobFile": "",
    "ExcelAttachmentsBase64File": ""
  }
}
```

***

### Get signed document

Returns the signed document for the task.

{% hint style="info" %}
The Blob URL also appears in the `Message` field.
{% endhint %}

**Response - 200 OK**

```json
{
  "Status": "success",
  "Message": "https://2signdocuments.blob.core.windows.net/.../_signed.pdf?...",
  "ResponseObject": {
    "TaskGuid": "01823172-5211-477c-8b30-4d7a37ebcb48",
    "IsSigned": true,
    "SignedTaskLinkBlob": "https://2signdocuments.blob.core.windows.net/.../_signed.pdf?...",
    "SignedTaskFile": "",
    "SignedTaskBase64File": ""
  }
}
```

***

### Get original document

Returns the original document before signing.

{% hint style="info" %}
The Blob URL also appears in the `Message` field.
{% endhint %}

**Response - 200 OK**

```json
{
  "Status": "success",
  "Message": "https://2signdocuments.blob.core.windows.net/....pdf?...",
  "ResponseObject": {
    "TaskGuid": "6ff74390-ed35-45cc-97ce-f1d51b960ee8",
    "IsSigned": true,
    "OriginalTaskLinkBlob": "https://2signdocuments.blob.core.windows.net/....pdf?...",
    "OriginalBlobFile": "",
    "OriginalBase64File": ""
  }
}
```

***

### Get general attachments

Returns a ZIP file with general attachments uploaded by the signer.

{% hint style="info" %}
The Blob URL also appears in the `Message` field.
{% endhint %}

**Response - 200 OK**

```json
{
  "Status": "success",
  "Message": "https://2signdocuments.blob.core.windows.net/....zip?...",
  "ResponseObject": {
    "TaskGuid": "01823172-5211-477c-8b30-4d7a37ebcb48",
    "IsSigned": true,
    "GeneralAttachmentsLinkBlob": "https://2signdocuments.blob.core.windows.net/....zip?...",
    "GeneralAttachmentsBlobFile": "",
    "GeneralAttachmentsBase64File": ""
  }
}
```

***

### Get ID attachment

Returns the ID photo uploaded by the signer. This is relevant when `ForceIdUpload: true` was set on the task.

{% hint style="info" %}
The Blob URL also appears in the `Message` field.
{% endhint %}

**Response - 200 OK**

```json
{
  "Status": "success",
  "Message": "https://2signdocuments.blob.core.windows.net/..._IdCardUpload.png?...",
  "ResponseObject": {
    "TaskGuid": "01823172-5211-477c-8b30-4d7a37ebcb48",
    "IsSigned": true,
    "IdCardAttachmentLinkBlob": "https://2signdocuments.blob.core.windows.net/..._IdCardUpload.png?...",
    "IdCardAttachmentBlobFile": "",
    "IdCardAttachmentBase64File": ""
  }
}
```

***

### Get attachments Excel

Returns a download link for an Excel file summarizing all task attachments.

**Response - 200 OK**

```json
{
  "Status": "success",
  "Message": "",
  "ResponseObject": {
    "TaskGuid": "01823172-5211-477c-8b30-4d7a37ebcb48",
    "IsSigned": true,
    "ExcelAttachmentsLinkBlob": "",
    "ExcelAttachmentsBlobFile": "",
    "ExcelAttachmentsBase64File": ""
  }
}
```

{% hint style="info" %}
If a file is not available, the matching `LinkBlob`, `BlobFile`, and `Base64File` fields can be empty.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://2sign-co-il.gitbook.io/2sign.co.il-docs/tasks-attachments/get-task-attachments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
