Embed Shipment Tracking

This guide explains how to generate a public share link for a shipment and embed it as an interactive tracking map in your application.

Overview

The Share Link API lets you create a time-limited, public URL for a shipment's tracking page. This URL can be:

  • Shared directly with external parties (e.g., customers, partners)
  • Embedded in your application using an iframe

Step 1: Generate a Share Link

Call the Create Share Link endpoint:

POST /v1/accounts/{accountId}/shipments/{shipmentId}/shareLink

Request Body

Set the TTL (time to live) and choose what information to include on the tracking page:

{
  "ttl": 31536000,
  "includeAlerts": true,
  "includeReports": true,
  "includeMilestones": true,
  "includeCarrierEvents": true,
  "includeRoute": true,
  "includeDocuments": false
}
ParameterTypeDescription
ttlintegerLink validity in seconds. Max is 32000000 (~1 year). Example: 31536000 (1 year).
includeAlertsbooleanShow alerts on the tracking page.
includeReportsbooleanShow reports on the tracking page.
includeMilestonesbooleanShow milestones on the tracking page.
includeCarrierEventsbooleanShow carrier events on the tracking page.
includeRoutebooleanShow the shipment route on the tracking page.
includeDocumentsbooleanShow documents on the tracking page.

Response

{
  "url": "https://sync.sensos.io/shipment-tracking?key={generatedKey}"
}

Important: Cache this URL throughout its validity period. Avoid generating a new link on every request.

For full API details, see the Create Share Link API Reference.

Step 2: Embed the Tracking Page in an iframe

Use the returned URL directly in an iframe:

<iframe
  src="https://sync.sensos.io/shipment-tracking?key={generatedKey}"
  width="100%"
  height="600"
  frameborder="0"
  allowfullscreen>
</iframe>

Step 3: Show Map Only (Optional)

If you want to display only the map without the full tracking page UI, append the view=mapOnly query parameter:

https://sync.sensos.io/shipment-tracking?key={generatedKey}&view=mapOnly

iframe example:

<iframe
  src="https://sync.sensos.io/shipment-tracking?key={generatedKey}&view=mapOnly"
  width="100%"
  height="600"
  frameborder="0"
  allowfullscreen>
</iframe>

Notes

  • The maximum TTL is 32000000 seconds (approximately 1 year).
  • The share link is publicly accessible — anyone with the URL can view the tracking page.
  • Cache the generated URL and reuse it until it expires, rather than creating a new link on each page load.