The Spanish version is the authoritative reference. View in Spanish
Method to download the JSON file (DownloadDocumentJson)
This method allows you to download a document's XML file using the GET DownloadDocumentJson service.
Through this method, you obtain the base64-encoded JSON file of the queried document.
To connect to this functionality, you will need to enter the URL according to the environment you want to use:
https://developers.gosocket.net/api/v1/File/DownloadDocumentJsonhttps://developers-sbx.gosocket.net/api/v1/File/DownloadDocumentJsonHow does the DownloadDocumentJson method work?
To make the request, the method has the following parameters:
| DownloadDocumentJson (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| globalDocumentId* | String | Document identification in Gosocket. | 36-character alphanumeric UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Type* | String | Type of JSON to download. The defined type will be shown in the response. | default: downloads the document's JSON. |
*Required
Request example
The identifiers, tax IDs, email addresses, 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/DownloadDocumentJson?globalDocumentId=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa&type=default
Note: Remember that before using the method, you must authenticate within 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's URL.
- Enter the parameters shown in the table above with their corresponding values.
- Press Send.
Response example
{
"Name": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa.json",
"Description": "Json Content for GlobalDocumentId aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"Base64Content": "ew0KICAiaWRlbnRpZmljYWNpb24iOi...",
"Timestamp": "2023-09-27T20:44:18.9549699Z",
"Type": "json"
}To correctly interpret the API's response, take into account the following criteria:
| DownloadDocumentJson (response) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| Name | String | Name of the downloaded JSON file | globalDocumentId.json |
| Description | String | Description of the event performed. | JsonContent for paramétro_type GlobalDocumentId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Base64Content | String | Base64-encoded JSON file | |
| TimeStamp | String | Date and time the document was created | yyyy-mm-ddThh:mm:ss |
| Type | String | File type | "json" |
Once the response has been decoded, the document's content will be displayed in the language of the decoding. For example, for an El Salvador DTE (fragment):
{
"identificacion": {
"version": 3,
"ambiente": "00",
"tipoDte": "03",
"numeroControl": "DTE-03-00000000-000000000000452",
"codigoGeneracion": "00000000-0000-0000-0000-000000000000",
"tipoModelo": 2,
"tipoOperacion": 2,
"tipoContingencia": 1,
"motivoContin": null,
"fecEmi": "2023-09-27",
"horEmi": "14:50:47",
"tipoMoneda": "USD"
},
"documentoRelacionado": null,
"emisor": {
"nit": "06140000000000",
"nrc": "0000000",
"nombre": "EMPRESA EJEMPLO, SOCIEDAD ANÓNIMA DE CAPITAL VARIABLE",
"codActividad": "62020",
"descActividad": "Consultorías y gestión de servicios informáticos",
"nombreComercial": "EMPRESA EJEMPLO",
"tipoEstablecimiento": "02",
"direccion": {
"departamento": "06",
"municipio": "14",
"complemento": "Avenida Ejemplo, Edificio Ejemplo, Tercer Nivel"
},
"telefono": "12345678",
"codEstableMH": "0000",
"codEstable": "1029",
"codPuntoVentaMH": "0000",
"codPuntoVenta": null,
"correo": "contacto@empresa-ejemplo.com"
},
"receptor": {
"nit": "06140000000001",
"nrc": "0000000",
"nombre": "CLIENTE EJEMPLO, SA DE CV",
"codActividad": "69100",
"descActividad": "Actividades jurídicas",
"nombreComercial": "CLIENTE EJEMPLO",
"direccion": {
"departamento": "06",
"municipio": "12",
"complemento": "CARRETERA KM 24"
},
"telefono": "23456789",
"correo": "cliente@empresa-ejemplo.com"
},
"otrosDocumentos": [
{
"codDocAsociado": 1,
"descDocumento": "Contrato",
"detalleDocumento": "C00100",
"medico": null
},
{
"codDocAsociado": 2,
"descDocumento": "Guia Aerea",
"detalleDocumento": "GA200"
}
]
}