Large Label
Generates the complete letter-size label with all shipment details.
GET /api/guias/etiqueta/{guia}
Required permission: guias.read
Parameters
| Parameter | Type | Description |
|---|---|---|
guia | string | Guide number (e.g.: URU030856) |
Label Contents
- Logo + origin branch data
- Barcode + tracking QR code
- Sender and recipient information
- Declared content table
- Cost breakdown: freight, insurance, pickup, handling, delivery
- Subtotal, VAT, Total
- Signature spaces
- Legal disclaimer
Example
curl -X GET "https://ws-api.masaprisaoperativo.com/api/guias/etiqueta/URU030856" \
-H "Authorization: Bearer {token}"
Response
{
"response": "OK",
"message": "Etiqueta grande generada exitosamente",
"data": {
"guia": "URU030856",
"pdf_base64": "JVBERi0xLjQK...",
"filename": "URU030856.pdf"
}
}
Decoding the PDF
The PDF is returned in Base64. Here's how to decode it:
JavaScript
const response = await fetch('/api/guias/etiqueta/URU030856', {
headers: { 'Authorization': 'Bearer ' + token }
});
const json = await response.json();
// Decode Base64 to Blob
const pdfData = atob(json.data.pdf_base64);
const bytes = new Uint8Array(pdfData.length);
for (let i = 0; i < pdfData.length; i++) {
bytes[i] = pdfData.charCodeAt(i);
}
const blob = new Blob([bytes], { type: 'application/pdf' });
// Open in new window
window.open(URL.createObjectURL(blob));
// Or download
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = json.data.filename;
a.click();
C#
byte[] pdfBytes = Convert.FromBase64String(response.Data.PdfBase64);
File.WriteAllBytes(response.Data.Filename, pdfBytes);
// Or return as FileResult in a controller
return File(pdfBytes, "application/pdf", filename);
PHP
$pdfContent = base64_decode($response['data']['pdf_base64']);
file_put_contents($response['data']['filename'], $pdfContent);
// Or display in browser
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
echo $pdfContent;
tip
This label is ideal for internal documentation and filing. To stick on packages, use the Small Label.