Print Parcel Documents
Print Parcel Documents
Endpoint
https://tms.targetfmi.com/index.php?p=api&c=parcelShipService&m=viewDgDocuments&id=[shipmentId]&type=[documentType]
Request Parameters
Parameter | Required | Available Options/Data Type | Description |
---|---|---|---|
[shipmentId] | Yes | Integer | The ID of the parcel shipment as returned by the Create a Parcel Shipment API endpoint. |
[documentType] | Yes |
| The requested document. For Hazmat Ground shipments, a request for each an |
Response Parameters
Parameter Name | Description |
---|---|
/message | The message stack. Refer to the documentation for Making a Request. |
Note
On success if the label type is PDF, raw (binary) PDF data is dumped to the client. If an error occurred, you will see a message stack response returned describing the problem.
Example
Full Example for PDF Label
Example
<?php require_once "../../restClient.class.php"; $resource = "https://tms.targetfmi.com/index.php"; $user = "API_KEY"; $pass = ""; $seperator = "?"; $rest = new restClient($resource, $user, $pass, $seperator); $shipmentId = 4; $documentType= 'OP_900'; $endpoint = 'p=api&c=parcelShipService&m=viewDgDocuments&id=' . $shipmentId . '&type=' . $documentType; $res = $rest->get($endpoint); header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="shipment_' . $shipmentId . '_' . $documentType . '.pdf"'); header('Content-Transfer-Encoding: binary'); header('Accept-Ranges: bytes'); echo $res; ?>
, multiple selections available, Use left or right arrow keys to navigate selected items