# Download as Excel

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

Returns: Link to download the Excel file.

{% code overflow="wrap" %}

```shellscript
POST /{tenant}/api/v3/folders/{folder}/services/{service}/download/xml/{callId}
```

{% 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.DownloadAPILog.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 processed together. |

### Request body

&#x20;`Content-Type: application/json`

The request body should be empty or `{}`.

This is a `POST` API because there are additional parameters that we plan to include in the future.

### 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 --request POST 'https://excel.myenvironmentname.coherent.global/mytenantname/api/v3/folders/myfoldername/services/myservicename/download/xml/a5c6a61f-06f8-499b-8a4d-818be4e74d29' \
--header 'x-tenant-name: mytenantname' \
--header 'x-synthetic-key: 5458626120e2'
--data ''
```

### Sample response

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

```json
{
    "status": null,
    "response_data": {
        "download_url": "https://excel.myenvironmentname.coherent.global/SparkService_CallLogDetails_a5c6a61f-06f8-499b-8a4d-818ce4e74d29.xlsx"
    },
    "response_meta": {
        "service_id": "d160a776-01ba-433d-8cb4-60fa2710b085",
        "version_id": "e778bbb1-288c-42f5-a4c3-d0a47f7d0463",
        "version": "0.2.0",
        "process_time": 0,
        "call_id": "18f53170-93d1-4b3c-88b6-04ae302b7e8d",
        "compiler_type": "Neuron",
        "compiler_version": null,
        "source_hash": null,
        "engine_id": "53ACA991910FF82E1DF0B133D66A5A97",
        "correlation_id": null,
        "parameterset_version_id": null,
        "system": "SPARK",
        "request_timestamp": "2025-02-13T05:48:19.654Z"
    },
    "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.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.
