Skip to main content

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:

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

How does the DownloadDocumentAttachment method work?

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

DownloadDocumentAttachment (request)
ParameterTypeDescriptionAllowed values
globalDocumentId*StringDocument identification in Gosocket.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AttachmentId*StringUnique identification of the attachment (obtained with the GetDocumentattachments method)36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

*Required


Request example

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

Response example

image-20240503-040412.png

To properly interpret the API response, take into account the following parameters:

DownloadDocumentAttachment (request)
ParameterTypeDescriptionAllowed values
globalDocumentId*StringDocument identification in Gosocket.36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
AttachmentId*StringUnique 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:

    image-20240503-040610.png

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