Print Dangerous Goods Declaration
Endpoint
https://tms.targetfmi.com/index.php?p=api&r=text&c=billoflading&m=printDGD&d=[bolID]/[date]
Request Parameters
Parameter | Required | Available Options/Data Type | Description |
---|---|---|---|
[bolID] | Yes | Integer | The ID of the BoL, returned by the Save, SaveAs, and Execute API endpoints. |
[date] | Yes | Integer | This is the date portion of the BoL #, also returned by the Save, SaveAs, and Execute API endpoints. |
pro | No | String | Pro Number to appear in the Shipper's Reference Number section of the DGD |
po | No | String | PO Number to appear in the Shipper's Reference Number section of the DGD |
so | No | String | SO Number to appear in the Shipper's Reference Number section of the DGD |
bol | No | String | BoL Number to appear in the Shipper's Reference Number section of the DGD |
ref | No | String | Reference Number to appear in the Shipper's Reference Number section of the DGD |
products | No | String | Comma separated list of IDs of products on the BoL to appear in the Nature and Quantity of Dangerous Goods section of the DGD. The product ID's can be aquired using the Searching Saved Bills of Lading endpoint. |
Response Parameters
Parameter Name | Description |
---|---|
/message | The message stack. Refer to the documentation for Making a Request. |
Note
On success, raw (binary) PDF data is dumped to the client. If an error occurred, the BOL was not executed, or does not belong to your organization, you will see a message stack response returned describing the problem.
Full Example
<?php require_once('../../restClient.class.php'); $resource = 'https://tms.targetfmi.com/index.php'; $user = '8837e844-182f-4a31-b3e8-49bd2bebf6cd'; $pass = ''; $sep = '?'; $rest = new restClient($resource, $user, $pass, $sep); $bolID = 4; $date = 20130709; $productIds = '1234,1235'; $endpoint = 'p=api&r=text&c=billoflading&m=printDGD&d=' . $bolID . '/' . $date . '&products=' . $productIds; $res = $rest->get($endpoint); header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="bol_' . $date . $bolID . '"'); header('Content-Transfer-Encoding: binary'); header('Accept-Ranges: bytes'); echo $res; ?>