For the complete documentation index, see llms.txt. This page is also available as Markdown.

Labels

Endpoint to retrieve the label of a specific parcel

Returns the label of a single parcel of a shipment, without downloading the file with the labels of all the parcels.

Retrieve the label of a parcel

GET https://api.gsped.it/[INSTANCE]/labels/[id_spedizione]

The parcel is specified by number or by code: the two parameters are alternatives, and specifying both is an error.

Path Parameters

Name
Type
Description

id_spedizione*

String

Unique Gsped shipment ID

Query Parameters

Name
Type
Description

n_collo

String

Parcel number, from 1 to the number of parcels in the shipment

codice_collo

String

Parcel code; must be unique within the shipment

Headers

Name
Type
Description

x-api-key*

String

APIKEY provided by Gsped

{
  "status": 200,
  "response": {
    "id_sped": 1234,
    "id_collo": 2,
    "labels": {
      "zpl": "^XA...^XZ",
      "pdf": "JVBERi0xLjQK..."
    }
  }
}
{
  "status": 400,
  "errors": [
    "Collo non indicato: serve n_collo oppure codice_collo"
  ],
  "response": []
}
{
  "status": 400,
  "errors": [
    "Indicare n_collo oppure codice_collo, non entrambi"
  ],
  "response": []
}

The PDF is base64-encoded, the ZPL is returned as text. If only the ZPL is available for that parcel, the PDF is produced by converting it; if that is missing too, the field is left empty.

Example code snippets