# Utilities API

Call Endtest Utilities programmatically via the Utilities API. Generate fixtures, extract PDF data, convert files, and pipe results into your own tools.

Part of the Endtest documentation (Advanced). Canonical URL: https://endtest.io/docs/advanced/utilities-api

---
## Introduction

We provide an API endpoint called `Utilities` where you can send API requests during your tests to process data.

 It's easier to use the standard [Utilities](https://endtest.io/docs/advanced/utilities/), which is an option available in the `Miscellaneous` action, instead of the Utilities API. 

## Steps

1. Add a `Send API Request` step in your test.
2. Select the `GET` option from the list of request types.
3. Add the following URL in the `Enter request URL` input: `https://app.endtest.io/utilities`
4. In the `Params` section, add the `action` that you need together with the rest of Quary Params.
5. The `action` and the rest of the Query Params need to be added in the standard key-value format.
6. You can also add Endtest variables in the `Params` section, simply typing `$` in one of the inputs will show you a dropdown with all the available Endtest variables.
7. You can choose to save the response of that API request into a new Endtest variable.
8. Go to the `Response` section, in the `Body` subsection.
9. Choose the `Store in variable` option from the `Action` dropdown from the the `Body` subsection.
10. Add the name of the variable that will contain the body of the response.

## Actions

You can choose from different actions:

### 1. Extract Text After Pattern

The `extractTextAfterPattern` action can be used to extract a substring from a string, by providing another substring as a pattern.

**Query Params that you need to add in the `Send API Request` modal:**

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractTextAfterPattern                         |
| text    | the full text or the name of the variable       |
| pattern | the pattern of text or the name of the variable |

For example, let's say you have the following text:

```
Your validation code is 1234
```

You can extract the `1234` portion of that text by providing the following pattern:

```
Your validation code is
```

That will extract the following substring:

```
1234
```

![endtest utiliites](https://app.endtest.io/images/endtest_utilities_extract_text_after_pattern.png)

### 2. Extract Text Before Pattern

The `extractTextBeforePattern` action can be used to extract a substring from a string, by providing another substring as a pattern.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractTextBeforePattern                        |
| text    | the full text or the name of the variable       |
| pattern | the pattern of text or the name of the variable |

For example, let's say you have the following text:

```
1234 is your validation code
```

You can extract the `1234` portion of that text by providing the following pattern:

```
is your validation code
```

That will extract the following substring:

```
1234
```

![endtest utiliites](https://app.endtest.io/images/endtest_utilities_extract_text_before_pattern.png)

### 3. Extract Numbers From Text

The `extractNumbersFromText` action can used to extract all the numbers from a string.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractNumbersFromText                          |
| text    | the full text or the name of the variable       |

For example, let's say you have the following text:

```
Your validation code is 1234. Do not share it with anyone else.
```

You can extract the `1234` portion of that text because it's entirely made up of numbers.

### 4. Extract Value From JSON

The `extractValueFromJSON` action can used to get a value from a JSON object.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractValueFromJSON                            |
| json    | the JSON object                                 |
| name    | the name for which you will get the value       |

For example, if you have the following JSON object:

```javascript
{"firstName":"John", "lastName":"Doe"}
```

This is how the `Send API Request` modal would look like if you want to extract the `firstName` value:

![endtest utilities extract json](https://app.endtest.io/images/extractValueFromJSON.png)

 Don't forget, you can also use Endtest variables in the `Send API Request` modal. 

### 5. Extract Item From Array

The `extractItemFromArray` action can used to get an item from an array.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractItemFromArray                            |
| array   | the array from which you will extract the items |
| index   | the location of the item from the array (the first array index is 0) |

For example, if you have the following array:

```javascript
["apple", "orange", "tomato"]
```

This is how the `Send API Request` modal would look like if you want to extract the second item:

![endtest utilities extract item array](https://app.endtest.io/images/extractItemFromArray.png)

Since you can use Endtest variables in the  `Params`, `Authorization` and `Headers` sections and you can also store the responses in Endtest variables, you can chain together multiple `Send API Request` steps which can use the `extractItemFromArray` and `extractValueFromJSON` actions to extract values from complex JSON objects.

In each `Send API Request`step, go to the `Body` section from the `Response` tab and select the option to store the value inside an Endtest variable, which will be used in the next step.

For example, you might have a complex JSON object like this:

```javascript
{
"employees":[
    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}
]
}
```
If you want to extract the second `firstName` value from that JSON object, you have to chain together 3 `Send API Request` steps:  

Start by using the `extractValueFromJSON` action to get the value for the `employees` item:

```javascript
[
    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}
]
```

That value will be an array and you can use the `extractItemFromArray` to get the second item from that array.

```javascript
{"firstName":"Anna", "lastName":"Smith"}
```

That item will be a JSON object and you can once again use the `extractValueFromJSON` action to get the value for the `firstName`.

### 6. Extract Last Item From Array

The `extractLastItemFromArray` action can used to get the last item from an array.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractLastItemFromArray                        |
| array   | the array from which you will extract the item  |

For example, if you have the following array:

```javascript
["apple", "orange", "tomato"]
```

This is how the `Send API Request` modal would look like if you want to extract the last item:

![endtest utilities extract last item array](https://app.endtest.io/images/extractLastItemFromArray.png)

### 7. Get Text Length

The `getTextLength` action can used to get the character count of a text.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | getTextLength                                   |
| text    | the full text or the name of the variable       |

### 8. Store Item in Vault

In some scenarios, you might need to manage values across different test suites.

These use cases can usually be handled by using [Variables](https://endtest.io/docs/advanced/how-to-use-variables/) and [Import Test Case](https://endtest.io/docs/advanced/importing-test-cases/) actions.

But there are other scenarios where one test suite might update a value which is used by other test suites.

You can use the `Endtest Vault` to store and fetch global values, which can be accessed from all your test suites.

These global values are called `items`.

The `storeItemInVault` action can be used to store an item.

The `items` stored in the `Endtest Vault` can only be accessed by you and your Team.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | storeItemInVault                                |
| itemName | the name of the item                            |
| itemValue| the value of the item                           |
| appId    | the appId for your Endtest account                      |
| appCode  | the appCode for your Endtest account                    |

This is how the `Send API Request` modal would look like:

![endtest store item vault](https://app.endtest.io/images/endtest_store_item_in_vault_1.png)

You can also use [Variables](https://endtest.io/docs/advanced/how-to-use-variables/):

![endtest store item vault](https://app.endtest.io/images/endtest_store_item_in_vault_2.png)

After clicking on the `Send` button, you will see the 'done' message in the `Body` subsection of the `Response` section if the request was successful:

![endtest store item vault](https://app.endtest.io/images/endtest_store_item_in_vault_3.png)

### 9. Get Item from Vault

The `getItemFromVault` action can be used to fetch global values stored in the `Endtest Vault`.

These global values are called `items`.

The `items` stored in the `Endtest Vault` can only be accessed by you and your Team.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | getItemFromVault                                |
| itemName | the name of the item                            |
| appId    | the appId for your Endtest account                      |
| appCode  | the appCode for your Endtest account                    |

This is how the `Send API Request` modal would look like:

![endtest get item vault](https://app.endtest.io/images/endtest_get_item_from_vault_1.png)

After clicking on the `Send` button, you will see the value of the `item` in the `Body` subsection of the `Response` section if the request was successful:

![endtest get item vault](https://app.endtest.io/images/endtest_get_item_from_vault_2.png)

That value can be stored in an Endtest variable and used in your test suite:

![endtest get item vault](https://app.endtest.io/images/endtest_get_item_from_vault_3.png)

### 10. Generate Random Name

The `generateRandomName` action can be used to generate random names.

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | generateRandomName                              |
| type     | first, last or full                             |
| gender   | female or male                                  |

This is how the `Send API Request` modal would look like:

![endtest generate random name](https://app.endtest.io/images/generateRandomNameApiRequest1.png)

After clicking on the `Send` button, you will see the value of the name in the `Body` subsection of the `Response` section if the request was successful:

![endtest generate random name response](https://app.endtest.io/images/generateRandomNameApiRequest2.png)

That value can be stored in an Endtest variable and used in your test suite:

![endtest get item vault](https://app.endtest.io/images/generateRandomNameApiRequest3.png)

### 11. Extract Character from String

The `extractCharacterFromString` action can be used to extract a certain character from a string.

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | extractCharacterFromString                      |
| string   | the full text or the name of the variable       |
| index    | the location of the character from the string (the first index is 0)            |

This is how the `Send API Request` modal would look like:

![get character from text](https://app.endtest.io/images/extractCharacterFromString1.png)

After clicking on the `Send` button, you will see the character in the `Body` subsection of the `Response` section if the request was successful:

![endtest response of character](https://app.endtest.io/images/extractCharacterFromString2.png)

That value can be stored in an Endtest variable and used in your test suite:

![endtest extract character](https://app.endtest.io/images/extractCharacterFromString3.png)

### 12. Convert Text to LowerCase

The `toLowerCase` action can be used to convert a text to LowerCase.

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | toLowerCase                                     |
| text     | the full text or the name of the variable       |

This is how the `Send API Request` modal would look like:

![convert to lower case](https://app.endtest.io/images/toLowerCase1.png)

After clicking on the `Send` button, you will see the converted text in the `Body` subsection of the `Response` section if the request was successful:

![convert to lower case result](https://app.endtest.io/images/toLowerCase2.png)

That converted text can be stored in an Endtest variable and used in your test suite:

![convert to lower case variable](https://app.endtest.io/images/toLowerCase3.png)

### 13. Convert Text to UpperCase

The `toUpperCase` action can be used to convert a text to UpperCase.

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | toUpperCase                                     |
| text     | the full text or the name of the variable       |

This is how the `Send API Request` modal would look like:

![convert to upper case](https://app.endtest.io/images/toUpperCase1.png)

After clicking on the `Send` button, you will see the converted text in the `Body` subsection of the `Response` section if the request was successful:

![convert to upper case result](https://app.endtest.io/images/toUpperCase2.png)

That converted text can be stored in an Endtest variable and used in your test suite:

![convert to upper case variable](https://app.endtest.io/images/toUpperCase3.png)

### 14. Capitalize Text

The `capitalizeText` action can be used to capitalize a text, converting the first letter of each word to a capital letter (uppercase letter) and the remaining letters to lower case.

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | capitalizeText                                  |
| text     | the full text or the name of the variable       |

This is how the `Send API Request` modal would look like:

![capitalize text](https://app.endtest.io/images/capitalizeText.jpg)

After clicking on the `Send` button, you will see the converted text in the `Body` subsection of the `Response` section if the request was successful.

That converted text can be stored in an Endtest variable and used in your test suite.

### 15. Send Email

The `sendEmail` action can be used to send an email from any `endtest-mail.io` address.

This feature is not available during the free trial.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | sendEmail                                       |
| from     | Email address of sender                         |
| to       | Email address of recipient                      |
| subject  | The subject of the email                        |
| body     | The body of the email                           |
| attachment  | The File Download Link from the Endtest Drive (optional)     |
| appId    | the appId for your Endtest account                      |
| appCode  | the appCode for your Endtest account                    |

![send email](https://app.endtest.io/images/utilities_send_email.png)

### 16. Send Slack Message

The `sendSlackMessage` action can be used to send a message to a Slack Channel.

This feature is not available during the free trial.

And it works only if you connected that Slack Channel to Endtest (details about that [here](https://endtest.io/docs/integrations/slack/)).

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | sendSlackMessage                                |
| channel  | the name of the Slack channel                   |
| message  | the message you want to send                    |
| appId    | the appId for your Endtest account              |
| appCode  | the appCode for your Endtest account            |

![send slack message](https://app.endtest.io/images/endtest_utilities_send_slack_message_1.jpg)

### 17. Math Calculations

The `math` action can be used to perform mathematical operations.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | math                                            |
| operation | the arithmetical operation                     |
| items     | a list of numbers, separated by ;              |

![endtest math operations](https://app.endtest.io/images/endtest_utilities_math.png)

>Supported parameters for operation: addition, subtraction, multiplication, division, round, rounddown, roundup.
>
>You can perform math operations with variables by placing the variable name between double curly brackets:
>
>```{{$price}};{{$tax}}```

### 18. Remove Newline Characters

The `removeNewLines` action can be used to remove Newline characters.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | removeNewLines                                            |
| text | the text from which the Newline characters will be removed    |

![endtest remove newline](https://app.endtest.io/images/endtest_utilities_remove_new_lines.png)

### 19. Extract Random Item From List

The `extractRandomItemFromList` action can used to get a random item from a list.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractRandomItemFromList                        |
| list   | the list from which you will extract the item  |

For example, if you have the following array:

```javascript
orange; apple; tomato
```

This is how the `Send API Request` modal would look like if you want to extract the last item:

![endtest utilities extract random item from list](https://app.endtest.io/images/utilities_extractRandomItemFromList.jpg)

### 20. Extract Value From XML

The `extractValueFromXML` action can used to get a value from an XML object.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | extractValueFromXML                            |
| xml    | the XML object                                 |
| name    | the name for which you will get the value       |

For example, if you have the following XML object:

```xml
<Response>
<CountryCode>US</CountryCode>
<CountryName>United States</CountryName>
<RegionCode>CA</RegionCode>
<RegionName>California</RegionName>
<City>Mountain View</City>
<ZipCode>94043</ZipCode>
<Latitude>37.4192</Latitude>
<Longitude>-122.0574</Longitude>
<MetroCode>807</MetroCode>
<AreaCode>650</AreaCode>
</Response>
```

This is how the `Send API Request` modal would look like if you want to extract the `City` value:

![endtest utilities extract xml](https://app.endtest.io/images/utilities_api_extract_from_xml.jpg)

 Don't forget, you can also use Endtest variables in the `Send API Request` modal. 

### 21. Truncate Text

The `truncateText` action can be used to extract a substring from a string, by providing the number of characters you want to extract.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | truncateText                        |
| text    | the full text or the name of the variable       |
| count | the number of characters or the name of the variable |

For example, let's say you have the following text:

```
Hello world!
```

You can extract the `Hello` portion of that text by providing the following `count`:

```
5
```

That will extract the following substring:

```
Hello
```

![endtest utiliites truncate text](https://app.endtest.io/images/endtest_documentation_utilities_api_truncate.png)

### 22. Generate File

The `generateFile` action can be used to generate a file, by providing the content and the name.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | generateFile                        |
| fileName    | the name of the file (needs to include the extension)      |
| content | the content that will be placed inside the file |

For example, let's say you have the following `content`:

```
Hello
```

And you want to save it in a file called `sample.txt`:

That will generate a text file with the name `sample.txt` that contains the text `Hello`.

The file will be automatically stored on our side and the Response Body from that request will contain the online link to that file.

![endtest utiliites generate file](https://app.endtest.io/images/endtest_documentation_utilities_generate_file.png)

> **Note:** The generated file will not be listed in the Endtest Drive.

### 23. Rename File

The `renameFile` action can be used to rename a file, by providing the link to the original file and the new file name.

> **Note:** This feature is not available during the free trial.

Query Params that you need to add in the `Send API Request` modal:

| Key         | Value                                                               |
|-------------|---------------------------------------------------------------------|
| action      | renameFile                                                          |
| appId       | the appId for your Endtest account                                  |
| appCode     | the appCode for your Endtest account                                |
| fileLink    | the link to the original file (needs to be in the Endtest Drive)    |
| newFileName | the new name for the file, including the extension                  |

The response will contain the link to the new file.

The original file is not automatically deleted or replaced.

The new file is generated in a separate folder, but will not be listed in the Endtest Drive.

### 24. Extract Latest SMS

The `extractLatestSMS` action can be used to fetch the latest SMS from a Phone Number assigned to your team.

> **Note:** This functionality requires real phone numbers to be assigned to your team.     We provide real phone numbers for our users. You don't have to use any external service.     If there are no real phone numbers assigned to your team, you can request one by contacting our Support Team.     This functionality is not related in any way to the phone number that you have provide for the Two-Factor Authentication (2FA) for your Endtest account.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | extractLatestSMS                                |
| number  | the phone number                 |
| appId    | the appId for your Endtest account                      |
| appCode  | the appCode for your Endtest account                    |
| markAsRead  | true or false                   |
| delete  | true or false                    |

This is how the `Send API Request` modal would look like:

![endtest extract latest sms utilities](https://app.endtest.io/images/endtest_documentation_utilities_sms.png)

If everything is correct, the response will contain this JSON:

```javascript
{
    "from_number": "The phone number that sent the SMS message",
    "to_number": "The phone number that received the SMS message",
    "body": "The body of the SMS message",
    "timestamp": "The UTC timestamp, e.g., 2023-08-29 17:27:57"
}
```

>After the request is sent, the SMS message will be automatically marked as Read if the `markAsRead` parameter is set to `true`.
>That means you won't be able to access it with another request or `Extract Latest SMS` step.
>
>If the `delete` parameter is set to `true`, the SMS will also be deleted.
>You can also read and delete SMS messages manually in the Team section from the [Settings](https://app.endtest.io/settings) page.

An easier approach to extract the latest SMS is by using the `Extract Latest SMS` method from the Set Variable action, as described in the [Read SMS](https://endtest.io/docs/advanced/read-sms/) chapter.

### 25. Remove All Spaces

The `removeAllSpaces` action can be used to remove all the spaces from a text.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                           |
|----------|-------------------------------------------------|
| action   | removeAllSpaces                                            |
| text | the text from which the spaces will be removed    |

![endtest remove all spaces](https://app.endtest.io/images/endtest_utilities_remove_all_spaces.jpg)

### 26. Remove Pattern from Text

The `removePatternFromText` action can be used to remove a substring from a string.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | removePatternFromText                           |
| text    | the full text or the name of the variable       |
| pattern | the pattern of text that you want to remove     |

For example, let's say you have the following text:

```
57EUR
```

You can remove the `EUR` portion from that text by providing the following pattern:

```
EUR
```

The result will be the remaining text:

```
57
```

![endtest utiliites](https://app.endtest.io/images/endtest_utilities_remove_pattern_from_text.png)

### 27. Get Array Length

The `getArrayLength` action can used to get the number of items from an array.

Query Params that you need to add in the `Send API Request` modal:

| Key     | Value                                           |
|---------|-------------------------------------------------|
| action  | getArrayLength                                  |
| array   | the array where you want to count the items    |

### 28. Extract Invoice Data From PDF

The `extractInvoiceDataFromPDF` action allows you to extract structured information from an invoice contained in a PDF file.

Endtest automatically analyzes the first page of the PDF and returns a standardized JSON object containing the most important invoice fields, as well as all detected line items.

This feature uses AI with Deep Learning OCR and Document Understanding Models to extract invoice fields, which Endtest converts into a clean, predictable JSON format.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                |
|----------|--------------------------------------|
| action   | extractInvoiceDataFromPDF            |
| fileLink | the link to the PDF invoice          |
| appId    | the appId for your Endtest account   |
| appCode  | the appCode for your Endtest account |

Below is the exact JSON format returned by this method:

```json
{
  "invoice_number": "INV-12345",
  "invoice_date": "2025-03-01",
  "vendor_name": "Example Vendor Ltd",
  "total": "129.99",
  "currency": "USD",
  "summary_fields": {
    "INVOICE_RECEIPT_ID": "INV-12345",
    "INVOICE_RECEIPT_DATE": "2025-03-01",
    "VENDOR_NAME": "Example Vendor Ltd",
    "SUBTOTAL": "100.00",
    "TAX": "29.99",
    "TOTAL": "129.99"
  },
  "items": [
    {
      "description": "Product A",
      "quantity": "2",
      "unit_price": "50.00",
      "amount": "100.00",
      "raw_fields": {
        "ITEM": "Product A",
        "QUANTITY": "2",
        "UNIT_PRICE": "50.00",
        "AMOUNT": "100.00"
      }
    }
  ],
  "raw": { /* full payload */ }
}
```

> **Note:** This action is available only with the Pro and Enterprise Plans, since it's part of the [PDF Testing](https://endtest.io/docs/web-tests/how-to-test-pdf-files) feature.

If your test downloaded the PDF, you can get the link by using the variable generated by `Set Variable → Link to Most Recent Downloaded File`.

### 29. Convert PDF to HTML

The `convertPDFtoHTML` action converts a PDF into an HTML file, making it easy to interact with using standard Endtest actions such as:

- `Scroll`
- `Click`
- `Snipping Tool`
- `Miscellaneous → Generate Full Page Screenshot`
- and others

If the PDF contains links, you can also click them by locating elements with a `Text Inside` locator in a `Click` step.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                |
|----------|--------------------------------------|
| action   | convertPDFtoHTML                     |
| fileLink | the link to the PDF file             |
| appId    | the appId for your Endtest account   |
| appCode  | the appCode for your Endtest account |

The request returns a link to the generated HTML file.

> **Note:** This action is available only with the Pro and Enterprise Plans, since it's part of the [PDF Testing](https://endtest.io/docs/web-tests/how-to-test-pdf-files) feature.

If your test downloaded the PDF, you can get the link by using the variable generated by `Set Variable → Link to Most Recent Downloaded File`.

### 30. Extract Page From PDF

The `extractPageFromPDF` action allows you to extract a single page from a PDF file.

Query Params that you need to add in the `Send API Request` modal:

| Key        | Value                                      |
|------------|--------------------------------------------|
| action     | extractPageFromPDF                         |
| fileLink   | the link to the PDF file                   |
| pageNumber | the number of the page you want to extract |
| appId      | the appId for your Endtest account         |
| appCode    | the appCode for your Endtest account       |

The request returns a link with the generated PDF file.

> **Note:** This action is available only with the Enterprise Plan, since it's part of the [PDF Testing](https://endtest.io/docs/web-tests/how-to-test-pdf-files) feature.

If your test downloaded the PDF, you can get the link by using the variable generated by `Set Variable → Link to Most Recent Downloaded File`.

### 31. Convert CSV to HTML

The `convertCSVtoHTML` action converts a CSV into an HTML file, making it easy to view and validate the data.

Query Params that you need to add in the `Send API Request` modal:

| Key      | Value                                |
|----------|--------------------------------------|
| action   | convertCSVtoHTML                     |
| fileLink | the link to the CSV file             |
| appId    | the appId for your Endtest account   |
| appCode  | the appCode for your Endtest account |

The request returns a link to the generated HTML file.

You can then access that generated HTML file with a `Go to URL` step.

After your test downloads the CSV file, you can get the link by using the variable generated by `Set Variable → Link to Most Recent Downloaded File`. More details about this workflow can be found in the [How to Test File Downloads](https://endtest.io/docs/web-tests/how-to-test-file-downloads) chapter.
