Method for downloading a specific attachment (DownloadDocumentAttachment)
This method allows you to download a specific attachment of a document using the GET DownloadDocumentAttachment service.
Using this method, you obtain the attachment specified in the parameters, base64-encoded, from the queried document. The method retrieves the specified attachment.
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/DownloadDocumentAttachmenthttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentAttachmentHow does the DownloadDocumentAttachment method work?
To make the request, the method has the following parameters:
| DownloadDocumentAttachment (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| globalDocumentId* | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| AttachmentId* | String | Unique identification of the attachment (obtained with the GetDocumentattachments method) | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
*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 URL.
- Enter the parameters shown in the previous table with their corresponding values.
- Press Send.
Response example

To properly interpret the API response, take into account the following parameters:
| DownloadDocumentAttachment (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| globalDocumentId* | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| AttachmentId* | String | Unique identification of the attachment (obtained with the GetDocumentAttachments method) | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
Characteristics of the DownloadDocumentAttachment 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 can be downloaded one by one.
-
When decoding the downloaded file, keep in mind that each file comes with single encoding, so it only needs to be decoded once to view the file.