Skip to main content

Method for downloading attachments (DownloadDocumentAttachments)

This method allows you to download the attachments of a document using the GET DownloadDocumentAttachments service.

Using this method, you obtain the base64-encoded attachments of the queried document. The method retrieves all attachments.

To connect to this functionality, you must enter the URL according to the environment you want to use:

PRODUCCIÓNhttps://developers.gosocket.net/api/v1/File/DownloadDocumentAttachments
SANDBOXhttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentAttachments

How does the DownloadDocumentAttachments method work?

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

DownloadDocumentAttachments (request)
ParameterTypeDescriptionAllowed values
globalDocumentId*StringDocument identification in Gosocket.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

*Required


Request example

image-20240503-034046.png

Note: Remember that before using the method, you must authenticate in the Authorization tab.

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 URL.
  3. Enter the parameters shown in the previous table with their corresponding values.
  4. Press Send.

Response example

image-20240503-034226.png

To correctly interpret the API response, take into account the following criteria:

UploadDocumentAttachment (response)
ParameterTypeDescriptionAllowed values
SuccessBooleanIndicates whether the request executed successfully.true: The request executed without errors. false: The request executed with some error.
GlobalDocumentIdStringDocument identification in Gosocket.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CountryDocumentIdStringFiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, IDSee table Country Document ID Structure
OtherData { AttachmentId }StringUnique identification for the attachment36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
MessagesArrayMessages in case there are errors.
ResponseValueStringIdentifier of the process response.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CodeStringProcess response code.200: The request executed successfully 500: the request executed with errors 307: document not found
DescriptionStringDescription of the event performed.Upload Success Error uploading File Document Not Found, System Automatic Retry in 1 minute
ErrorExceptionStringDescription of the exception-type error.

You can verify the downloaded attachments against those shown in the attachments section of the document preview.

image-20240503-034354.png


Characteristics of the DownloadDocumentAttachments method

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

image-20240503-034449.png

  • Files can be downloaded as many times as needed.
  • All attachments the document has will be downloaded.