# Get Installation File

Learn how to use the `/api/v4/installation_file` endpoint to retrieve installation file information for a specific license.

{% hint style="info" %}
Product versions are returned up to the existing **maintenance\_period** OR **validity\_period** on the license. If those fields are not defined on a license, all versions will be returned by default.
{% endhint %}

### Endpoint

* Method: `GET`
* Path: `/api/v4/installation_file`
* Description: Returns metadata on the installation file for a product.

### Authentication

See [License API Authorization](/license-api/license-api-authorization.md).

#### Required headers

* `Date` (string) — RFC7231 GMT date string
* `Authorization` (string)

#### Recommended headers

* `Accept: application/json`

### Request

### Query parameters

* product (string) — required — Product short code
* hardware\_id (string) — required — Unique hardware ID generated for the client device
* license\_key (string) — optional — Required if product is key-based
* username (string) — optional — Required if product is user-based
* license\_id (string) — optional — Ensures the action affects only the license with the specified ID
* version (string) — optional — Version string, e.g. "1.0.0"
* env (string) — optional — Environment identifier, e.g. "win", "win32", "win64", "mac", "linux", "linux32", "linux64"
* channel (string) — optional — Channel identifier, e.g. "staging", "prod"

### Examples

{% tabs %}
{% tab title="curl" %}

```bash
curl --location --request GET '/api/v4/installation_file?product=string&hardware_id=string&license_key=string' \
--header 'Accept: application/json' \
--header 'Date: string' \
--header 'Authorization: string'
```

{% endtab %}

{% tab title="nodejs" %}

```javascript
var request = require('request');
var options = {
  method: 'GET',
  url: '/api/v4/installation_file?product=string&hardware_id=string&license_key=string',
  headers: {
    'Accept': 'application/json',
    'Date': 'string',
    'Authorization': 'string'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endtab %}

{% tab title="javascript (fetch)" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Date", "string");
myHeaders.append("Authorization", "string");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("/api/v4/installation_file?product=string&hardware_id=string&license_key=string", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="python" %}

```python
import requests

url = "/api/v4/installation_file?product=string&hardware_id=string&license_key=string"

headers = {
  "Accept": "application/json",
  "Date": "string",
  "Authorization": "string"
}

response = requests.get(url, headers=headers)
print(response.text)
```

{% endtab %}

{% tab title="ruby" %}

```ruby
require "uri"
require "net/http"

url = URI("/api/v4/installation_file?product=string&hardware_id=string&license_key=string")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Date"] = "string"
request["Authorization"] = "string"

response = http.request(request)
puts response.read_body
```

{% endtab %}
{% endtabs %}

### Sample Response (200)

```json
{
    "installation_file": "https://www.test.io/file/file.bin",
    "version": "1.0.2",
    "requires_version": null,
    "hash_md5": "",
    "release_date": "2021-04-30T00:00:00.000Z",
    "eula_link": null,
    "release_notes_link": null,
    "size": null,
    "channel": null
}
```

### Schema

<details>

<summary><strong>Response schema (TypeScript)</strong></summary>

```typescript
type InstallationFileResponseBody = {
    version: string | null,
    environment: string,
    hash_md5: string | null,
    eula_link: string | null,
    release_notes_link: string | null,
    size: string | null,
    requires_version: string | null,
    channel: string | null,
    installation_file: string | null,
    release_date: string | null, // Date string in full ISO 8601 format
}
```

</details>

### License Authorization Method

There are two types of product licenses based on how the client application authorizes itself to interact with a license:

* Key-based product licenses: client interactions with the license have to be authorized using a `license_key`
* User-based product licenses: the license has a corresponding "license user" instead of a license key. Client interactions with the license have to be authorized using a `username`

### Errors

If an error occurs, the response will have an HTTP status code of 400 or higher, and the response body will contain an error description in the following format:

```json
{
  "status": number,
  "code": "string",
  "message": "string"
}
```

JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": { "type": "number" },
    "code": { "type": "string" },
    "message": { "type": "string" }
  },
  "required": [
    "status",
    "code",
    "message"
  ],
  "additionalProperties": false
}
```

### List of exceptions

> **license\_key\_or\_license\_user\_required** (400): The license\_key or license user is missing

> **active\_license\_required** (400): An active license is required

> **missing\_headers** (400): Some headers are missing

> **missing\_parameters** (400): Some parameters are missing in the request: { params }

> **unknown\_product** (400): Provided product was not found

> **license\_not\_found** (400): License with the provided license user not found

> **device\_not\_found** (400): An active device matching the hardware\_id not found


---

# 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.licensespring.com/license-api/get-installation-file.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.
