Skip to main content

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:

PRODUCTIONhttps://developers.gosocket.net/api/v1/File/DownloadDocumentPdf
SANDBOXhttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentPdf

How does the DownloadDocumentPdf method work?

To make the request, the method has the following parameters:

DownloadDocumentPdf (request)
ParameterTypeDescriptionAllowed values
globalDocumentId*StringDocument identification in Gosocket.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Type*StringType of PDF to download. The defined type will be shown in the responsedefault: downloads the document's PDF.

*Required


Request example

image-20240503-022656.png

Since this is a GET method, we use the Params tab in Postman to build the query.

  1. Select the method type. In this case, you must select GET.
  2. Enter the method's URL.
  3. Enter the parameters shown in the table above with their corresponding values.
  4. Press Send.

Response example

image-20240503-022844.png

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

image-20240503-022912.png


Method characteristics

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

image-20240503-023002.png

  • 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.