# Download as Excel (legacy)

{% hint style="warning" %}
This documentation is for the legacy implementation of Download as Excel file. The differences are described in [API Call History](/navigation/api-call-history.md#download-the-excel-file-with-inputs).
{% endhint %}

Get a copy of the original Excel file with inputs embedded from the [API Call History](/navigation/api-call-history.md) for a particular Execute API  `call_id` using the legacy implementation.

Returns: Link to download the Excel file.

{% code overflow="wrap" %}

```shellscript
GET /{tenant}/api/v3/folders/{folder}/services/{service}/download/{callId}/{index}
```

{% endcode %}

### Authorization

* `Bearer {token}` accessible from [Authorization - Bearer token](/spark-apis/authorization-bearer-token.md) or systematically via [Client Credentials](/identity-and-access-management/client-credentials.md).
  * The request headers should include a key for `Authorization` with the value `Bearer {token}`.
* API key created from [Authorization - API keys](/spark-apis/authorization-api-keys.md).\
  The [Authorization - API keys](/spark-apis/authorization-api-keys.md#api-key-groups) must contain [Manage users](/tenant-administration/manage-users.md#user-groups) that are also assigned to [Permissions - Features permissions](/spark-apis/authorization-api-keys/permissions-features-permissions.md) `Spark.DownloadServiceByCallId.json` or `Spark.AllEncompassingProxy.json`.
  * The request headers should include the keys `x-synthetic-key` and `x-tenant-name` with the values of the API key and tenant name respectively.

### Path parameters

| Key          | Value                                                                                                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tenant` \*  | Tenant is part of your [Login and logout](/navigation/login-and-logout.md#log-in-to-spark) URL and also available in the  [Navigation menu](/navigation/navigation-menu.md#user-menu). |
| `folder` \*  | Folder associated with the API call.                                                                                                                                                   |
| `service` \* | Service associated with the API call.                                                                                                                                                  |
| `callId` \*  | [Execute API](/spark-apis/execute-api.md) `call_id`.                                                                                                                                   |

### Query parameters

| Key     | Value                                                                                                                                                      |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `index` | Index number for the record to get. With [Execute API (v4)](/spark-apis/execute-api/execute-api-v4.md), multiple request records can be submitted at once. |

### Sample request with API key

See [How to: Setup a feature permission](/spark-apis/authorization-api-keys/how-to-setup-a-feature-permission.md) for guidance in assigning the enable the [Authorization - API keys](/spark-apis/authorization-api-keys.md) to access [Permissions - Features permissions](/spark-apis/authorization-api-keys/permissions-features-permissions.md)`Spark.DownloadServiceByCallId.json`.

```sh
curl --location 'https://excel.myenvironmentname.coherent.global/mytenantname/api/v3/folders/myfoldername/services/myservicename/download/a5c6a61f-06f8-499b-8a4d-818be4e74d29' \
--header 'x-tenant-name: mytenantname' \
--header 'x-synthetic-key: 5458626120e2'
```

### Sample response

`HTTP 200 OK` `Content-Type: application/json`

```json
{
    "status": null,
    "response_data": {
        "download_url": "https://myenvironmentname.coherent.global/SparkService_CallLogDetails_a5c6a61f-06f8-499b-8a4d-818ce4e74d29.xlsx"
    },
    "response_meta": {
        "service_id": "4e798d55-7504-41cd-80b6-2b1542cd380f",
        "version_id": "e9fb31ab-d9e2-42f9-b2b1-d9201cffb126",
        "version": "0.1.0",
        "process_time": 0,
        "call_id": "a5c6a61f-06f8-499b-8a4d-818be4e74d30",
        "compiler_type": "Neuron",
        "compiler_version": null,
        "source_hash": null,
        "engine_id": "0ADFAEF8E4246B31322E367A8E19A841",
        "correlation_id": null,
        "parameterset_version_id": null,
        "system": "SPARK",
        "request_timestamp": "2023-11-14T06:32:18.210Z"
    },
    "error": null
}
```


---

# Agent Instructions: 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:

```
GET https://docs.coherent.global/spark-apis/api-call-history-apis/download-as-excel-legacy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
