# POST /documentprocessing/pdf/embeddedfiles

> Extract the files embedded in a PDF: post the Base64 PDF and get EmbeddedFile objects with data, file name, MIME type, description, relationship and dates.

- **Product:** DS Server
- **Section:** Documentation
- **Kind:** Endpoint
- **Path:** DS Server > API Reference > Web API > DocumentProcessing > /pdf/embeddedfiles > POST /documentprocessing/pdf/embeddedfiles
- **1390 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/web-api/documentprocessing/pdf-embeddedfiles/post/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/web-api/documentprocessing/pdf-embeddedfiles/post/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/web-api/documentprocessing/pdf-embeddedfiles/post/llms-full.txt

---

`POST` `https://example.com/documentprocessing/pdf/embeddedfiles`

### Description

Returns all embedded files from a given PDF document.

### Examples

The following example returns all embedded files in a given PDF document.

```bash
# Request:
curl --location --request POST 'https://trial.dsserver.io/documentprocessing/pdf/embeddedfiles' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer fePFHv8OtIyRSCAdOnn7USc9kKdYB2rg' \
    --data-raw '"JVBERi0xLjcNJeLjz[..]"'

# Result:
[
    {
        "creationDate": "2021-02-03T12:55:44Z",
        "data": "JVBERi0xLjQNJ[..]=",
        "dataType": "BASE64BINARY",
        "description": "checkboxes.pdf",
        "fileName": "checkboxes.pdf",
        "lastModificationDate": "2021-02-03T12:55:44Z",
        "mimeType": "application/pdf",
        "relationship": "",
        "metadata": null
    }
]
```

### Authorization

This endpoint supports the OAuth authorization method. DS Server checks the access token only when OAuth is enabled in the admin portal (see [Enable OAuth](https://docs.textcontrol.com/ds-server/administration/oauth/llms-full.txt)). With OAuth disabled, the default of a new installation, the endpoint accepts requests without a token.

DS Server implements OAuth as the authorization method. Two flows are supported:

- Authorization Code
- Client Credentials

To use the *Client Credentials* flow, switch on **Allow “Client Credentials” grant type** in the security profile (see [OAuth Grant Types](https://docs.textcontrol.com/ds-server/administration/oauth-grant-types/llms-full.txt)).

In both cases, a valid access token returned from the OAuth endpoints must be passed in a *Bearer* **Authorization Header**, as a **Query Parameter** or in a **Cookie**.

#### Authorization Header

| Header field | Description |
|---|---|
| Authorization | A Bearer authorization header (also called token authentication) contains the OAuth access token. The authorization method and a space i.e. "Bearer " is then put before your valid access token. For example: `Authorization: Bearer 4796E23054E64BC773CACBCAF24AD179DE9A3` |

#### Query Parameter

| Query parameter | Description |
|---|---|
| access\_token | The access token is passed directly in the endpoint URL as a query string. For example: `?access_token=4796E23054E64BC773CACBCAF24AD179DE9A3` |

#### Cookie

| Cookie | Description |
|---|---|
| access\_token | The access token is passed in a cookie named `access_token`. For example: `Cookie: access_token=4796E23054E64BC773CACBCAF24AD179DE9A3` |

### Request Payload

| Type | Value |
|---|---|
| String | The PDF document encoded as a Base64 string. |

### Success Response

| Status | Type | Description |
|---|---|---|
| 200 | EmbeddedFile | On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of EmbeddedFile objects. |

#### EmbeddedFile

| Name | Type | Value | Optional |
|---|---|---|---|
| creationDate | DateTime (String) | Specifies the date of the creation. | yes |
| data | String | Specifies the data of the embedded file. | yes |
| dataType | String | Specifies the type of the data. | yes |
| description | String | Specifies the description of the embedded file. | yes |
| fileName | String | Specifies the file name of the embedded file. | yes |
| lastModificationDate | DateTime (String) | Specifies the last modification date. | yes |
| mimeType | String | Specifies the MIME type of the embedded file (for example: "application/pdf"). | yes |
| relationship | String | Specifies the relationship string of the embedded file. | yes |
| metadata | String | Specifies meta data for the embedded file. | yes |

### Error Response

| Status | Description |
|---|---|
| 401 | A 401 (Unauthorized) with an empty body is returned, if OAuth is enabled and the request has no valid access token. |
| 400 | A 400 (Bad Request) is returned, if the body can't be read as a JSON string ("The JSON value could not be converted to System.String."). The body is a problem details object (`application/problem+json`) with the title "One or more validation errors occurred." and the message per field in `errors`. This check comes before the license check. |
| 415 | A 415 (Unsupported Media Type) is returned, if the `Content-Type` header of a request with a body is not `application/json`. |
| 405 | A 405 (Method Not Allowed) with an empty body and the header `Allow: POST` is returned for any other HTTP method, for example `GET`. |
| 400 | A 400 (Bad Request) is returned, if DS Server is not licensed or the license is invalid. On a server that is not registered, the body is the plain text `DS Server is not registered.` (`text/plain`). DS Server checks the license before the parameter values, but after it has read the body and the typed query parameters. |
| 400 | A 400 (Bad Request) is returned, if no document is found in the body. |
| 400 | A 400 (Bad Request) is returned, if the uploaded document is not valid. |

---

## Nearby

- **Previous:** [/documentprocessing/pdf/embeddedfiles](https://docs.textcontrol.com/ds-server/reference/web-api/documentprocessing/pdf-embeddedfiles/llms-full.txt)
- **Next:** [/documentprocessing/pdf/metadata](https://docs.textcontrol.com/ds-server/reference/web-api/documentprocessing/pdf-metadata/llms-full.txt)
