GoSweetSpot: Labels

Included in this document:

 

Labels in Queue

Description

Queue a provided image file for printing via the print application.

Requests

Method: POST
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/labels/post.html

Headers

access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.

Parameters

The body of the message should be sent as a JSON object.

Parameter Type Description
copies integer

Number of copies to print.

image string

Base64 string of byte array of image file. Supported format is png. The file size should be 1350px by 1175px.

printtoprinter string Optional, if not supplied, the access_key profile printer is used.

Return format

A string text of response message.

Errors

Error messages will range in the below:

  • Supplied document stream does not represent an image.
  • Print job sent.
  • Print job queued.
  • API Key not associated with a valid printer.

Request example


curl --location 'https://api.gosweetspot.com/api/labels/enqueue' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json' \
--data '{
    "Copies": 1,
    "Image": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN1akNDQWlPZ0F3SUJBZ0lKQU02VEt0b09KSWpGTUEwR0NT",
    "PrintToPrinter": "SMITH-PC >> ZDESIGNER LP 2844 (3227)"
}'

Response example


Print job sent
 

 

 

Download Labels

Description

Get shipment labels in the requested format.

Requests

Method: GET
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/labels/download.html

Headers

access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.

Parameters

Parameter: format, Type: string

optional - available formats are as below. If not supplied, the default is LABEL_PNG_100X175. The 100x150 sizing is presently experimental and not available across all carriers

LABEL_PDF

label is presented on an A4 page

LABEL_PNG_100X175 label is presented as a PNG image with dimension 100mm x 175mm
LABEL_PNG_100X150 label is presented as a PNG image with dimension 100mm x 150mm
LABEL_PDF_100X175 label is presented as a PDF with dimension 100mm x 175mm
LABEL_PDF_100X150

label is presented as a PDF with dimension 100mm x 150mm

LABEL_PDF_LABELOPE

label is presented as a PDF Labelope. Rotation is not supported

USER_CONFIGURED label is presented as a PDF when User's Printing Setting is PDF file, or a PRN file is presented if User's Printing Setting is GoPrint - PRN Download
GOPRINT_PRN

PRN file is presented

 

Parameter Type Description
rotate boolean

optional - if the label orientation requires 180 degree rotation

connote string

shipment consignment number to download

 

Return format

An array of base64 encoded binary:

  • In the case of multi-part shipments, the PNG format will return a binary block per part.
  • In the case of PDF, all parts are returned on a single multi-page pdf.

Request example

curl --location 'https://api.gosweetspot.com/labels/download?format=label_png&connote=ABA0010054' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json'

Response example


[
    "iVBORw0KGgoAAAANSUhEUgAABUYAAAMHCAYAAAD1lY2SAAAAAXNS...",
    "iVBORw0KGgoAAAANSUhEUgAABUYAAAMHCAYAAAD1lY2SMAAA7DAc...",
    "iVBORw0KGgoAAAANSUhEUgAABUYAAAMHCAlSURBVHhe7P0J9GXXl..."
]
 

 

Get Labels

Description

Get the shipment labels in the requested format, png or pdf.

Requests

Method: GET
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/labels/get.html

Headers

access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.

Parameters

Parameter: format, Type: string

optional - available formats are as below. If not supplied, the default is LABEL_PNG_100X175. The 100x150 sizing is presently experimental and not available across all carriers

LABEL_PDF

label is presented on an A4 page

LABEL_PNG_100X175 label is presented as a PNG image with dimension 100mm x 175mm
LABEL_PNG_100X150 label is presented as a PNG image with dimension 100mm x 150mm
LABEL_PDF_100X175 label is presented as a PDF with dimension 100mm x 175mm
LABEL_PDF_100X150

label is presented as a PDF with dimension 100mm x 150mm

LABEL_PDF_LABELOPE

label is presented as a PDF Labelope. Rotation is not supported

USER_CONFIGURED label is presented as a PDF when User's Printing Setting is PDF file, or a PRN file is presented if User's Printing Setting is GoPrint - PRN Download
GOPRINT_PRN

PRN file is presented

Parameter Type Description
rotate boolean

optional - if the label orientation requires 180 degree rotation

connote string

shipment consignment number to download

Return format

An array of base64 encoded binary:

  • In the case of multi-part shipments, the PNG format will return a binary block per part.
  • In the case of PDF, all parts are returned on a single multi-page pdf.

Request example

curl --location 'https://api.gosweetspot.com/api/labels?format=label_png&connote=ABA0010054' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json'

Response example

[
    "iVBORw0KGgoAAAANSUhEUgAABUYAAAMHCAYAAAD1lY2SAAAAAXNS...",
    "iVBORw0KGgoAAAANSUhEUgAABUYAAAMHCAYAAAD1lY2SMAAA7DAc...",
    "iVBORw0KGgoAAAANSUhEUgAABUYAAAMHCAlSURBVHhe7P0J9GXXl..."
]

 

 

Requeue a Label

Description

Requeue a shipment for printing.

Requests

Method: POST
Content Type: application/json
URL: https://api-docs.gosweetspot.com/docs/labels/post.html

Headers

access_key : your unique API key provided by GSS.
site_id : which site you are requesting action for.

Parameters

Parameter Type Description
connote string

Consignment number is to be printed.

printtoprinter
 
string

Optional, if supplied, the access_key profile printer is used.

Return format

A string text of response message.

Errors

Error messages will range in the below:

  • Not a valid consignment number.
  • Print job sent.
  • Print job queued.
  • API Key not associated with a valid printer.

Request example

curl --location --request POST 'https://api.gosweetspot.com/api/labels?connote=ABC123' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json'

Response example


Print job sent

 

Did this article answer your question?

Can't find the answer to your question?

Suggest an article