# File Name Get

File Name – Get

## Overview

Extracts and returns file name from source URL or 'alt' attribute of img or href tag:

* This API can be called for two types of tags which can have inline file:
  * `<a>` Anchor tag: For inline documents
    * `fileSourceUrl` will be the value of 'href' attribute of anchor tag
    * `imageAltAttribute` will be empty
  * `<img>` Image tag: For inline images
    * `fileSourceUrl` will be the value of 'src' attribute of img tag
    * `imageAltAttribute` will be the value of 'alt' attribute of img tag
* The file source URL can have the entire URL of the image or document. For example, it includes protocol, domain, path, path param, query param, etc. From this URL, get the image or document file name (either from the path or query param, depending on the system). Return the extracted file name.
* In case of an inline image, if the file name could not be found in the URL, then image alt attribute can be used.

## API URI

```bash
GET: /entities/{entityTypeId}/attachments/decoded-inline-file-name?fileSourceUrl=<fileSourceUrl>&imageAltAttribute=<imageAltAttribute>
```

## URI Parameters

| **Name**          | **In** | **Required** | **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------- | ------ | ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| entityTypeId      | path   | True         | String   | `id` of the entity type                                                                                                                                                                                                                                                                                                                                                                                                |
| fileSourceUrl     | query  | True         | String   | <p><strong>For <code>\<a></code> Anchor tag</strong> (inline documents):<br>- <code>fileSourceUrl</code> = value of <code>href</code> attribute<br>- <code>imageAltAttribute</code> = empty<br><strong>For <code>\<img></code> Image tag</strong> (inline images):<br>- <code>fileSourceUrl</code> = value of <code>src</code> attribute<br>- <code>imageAltAttribute</code> = value of <code>alt</code> attribute</p> |
| imageAltAttribute | query  | True         | String   | <p><strong>For <code>\<a></code> Anchor tag</strong> (inline documents):<br>- <code>fileSourceUrl</code> = value of <code>href</code> attribute<br>- <code>imageAltAttribute</code> = empty<br><strong>For <code>\<img></code> Image tag</strong> (inline images):<br>- <code>fileSourceUrl</code> = value of <code>src</code> attribute<br>- <code>imageAltAttribute</code> = value of <code>alt</code> attribute</p> |

## Request Payload

Only **String**: Extracted file name from `fileSourceUrl` or `imageAltAttribute`

**Example**:

"Example decoded file name.txt"
