Endpoint /documentprocessing/pdf/embeddedfiles

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

POST

Returns all embedded files from a given PDF document.

Examples

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

# 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:

OAuth

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

  • Authorization Code
  • Client Credentials

In order to use the Client Credentials flow, this method must be explicitly enabled in the admin portal of DS Server.

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

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

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 Long Specifies the date of the creation (UNIX EPOCH time). 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 Long Specifies the last modification date (UNIX EPOCH time). 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) is returned, if the user is not authorized.
400 A 400 (Bad Request) is returned, if DS Server is not licensed or the license is invalid.
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.