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:
https://developers.gosocket.net/api/v1/File/DownloadDocumentAttachmentshttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentAttachmentsHow does the DownloadDocumentAttachments method work?
To make the request, the method has the following parameters:
| DownloadDocumentAttachments (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| globalDocumentId* | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
*Required
Request example

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.
- Select the method type. In this case, you must select GET.
- Enter the method URL.
- Enter the parameters shown in the previous table with their corresponding values.
- Press Send.
Response example

To correctly interpret the API response, take into account the following criteria:
| UploadDocumentAttachment (response) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| Success | Boolean | Indicates whether the request executed successfully. | true: The request executed without errors. false: The request executed with some error. |
| GlobalDocumentId | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| CountryDocumentId | String | Fiscal identifier of the document at the country level, also known as CUFE, CLAVE, UUID, ID | See table Country Document ID Structure |
| OtherData { AttachmentId } | String | Unique identification for the attachment | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Messages | Array | Messages in case there are errors. | |
| ResponseValue | String | Identifier of the process response. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Code | String | Process response code. | 200: The request executed successfully 500: the request executed with errors 307: document not found |
| Description | String | Description of the event performed. | Upload Success Error uploading File Document Not Found, System Automatic Retry in 1 minute |
| ErrorException | String | Description of the exception-type error. |
You can verify the downloaded attachments against those shown in the attachments section of the document preview.

Characteristics of the DownloadDocumentAttachments method
- When the document Id (globalDocumentId) does not exist, the system responds with an error message:

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