The Spanish version is the authoritative reference. View in Spanish
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
The identifiers, tax IDs, and contents in these examples are fictitious; they are included only to illustrate the format of requests and responses.
GET https://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentAttachment?globalDocumentId=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa&AttachmentId=bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb
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
{
"Name": "ARR-900000000-SETP-993000679-bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"Description": "ACK",
"Base64Content": "PD94bWwgdmVyc2lvbj0iMS4wIi...",
"Timestamp": "2023-09-28T17:01:39.5853638Z",
"Type": "xml"
}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 a
404 Not Founderror message:{"Message": "Document with GlobalDocumentId (00000000-0000-0000-0000-000000000000) does not exist"} -
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.