The Spanish version is the authoritative reference. View in Spanish
Method to download the PDF file (DownloadDocumentPdf)
This method allows you to download a document's PDF file using the GET DownloadDocumentPdf service.
Through this method, you obtain the base64-encoded PDF file of the queried document.
To connect to this functionality, you will need to enter the URL according to the environment you want to use:
PRODUCTION
https://developers.gosocket.net/api/v1/File/DownloadDocumentPdfSANDBOX
https://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentPdfHow does the DownloadDocumentPdf method work?
To make the request, the method has the following parameters:
| DownloadDocumentPdf (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| globalDocumentId* | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Type* | String | Type of PDF to download. The defined type will be shown in the response | default: downloads the document's PDF. |
*Required
Request example

Since this is a GET method, we use the Params tab in Postman to build the query.
- Select the method type. In this case, you must select GET.
- Enter the method's URL.
- Enter the parameters shown in the table above with their corresponding values.
- Press Send.
Response example

Once the base64 response has been decoded, the document's graphic representation will be displayed.

Method characteristics
- When the document Id (globalDocumentId) does not exist, the system responds with an error message:

- The file can be downloaded as many times as needed.
- When decoding the downloaded file, keep in mind that the PDF file has simple encoding, so it only needs to be decoded once in order to view the PDF.