# Obtain a Document

# Alias

`SignerProcessDocumentContentReading`

# Description

Obtains a document to be (or that has been) signed (e.g., a signature process is executed on the document). When successfully executed, the document contains the signature generated as a result of the operation.

# Request

`GET /trustedx-resources/esignsp/v2/documents/{doc_and_sigdefs_id}/content`

## Parameters

Name | Type | Usage | Description
`doc_and_sigdefs_id` | path | Required | Identifier of the document and signature definitions resource that contains the document to be obtained. For a document on which a signature process is being executed (or was executed), the `documents/{document_id}` string can be extracted from the JSON representation of this signature process. This representation is found in the body of the response received when the operation for creating the signature process is executed. Specifically, this chain is extracted from the `url` field of the only element currently contained in the `documents` array of a recently created signature process.

## Authorization

The request must contain a bearer access token generated by an authorization server of the platform. This token must have a scope that includes the `urn:safelayer:eidas:sign:process:document` value and must be used as explained in RFC 6750. Basically, the access token must be included in an `Authorization` header as follows:

`Authorization: Bearer <token>`

The access token can be obtained via an authorization code grant or client credentials grant OAuth 2.0 flow.

# Response

## Status-Line

Value | Description
`HTTP/1.1 200 OK` | The document is provided in the body of the response (`Content-Type: application/pdf`).
`HTTP/1.1 404 Not Found` | The requested document does not exist (`Content-Type: application/json`).
Others | See HTTP Response Status for all the possible cases.

## Body

Requested document or JSON object that describes the error.