Print Dangerous Goods Declaration

Print Dangerous Goods Declaration

Status
Request Type
GET


This feature will dump the raw contents of a PDF file containing one or more labels to the client which can then be saved on your local file system as a PDF; it can then be opened or piped to a printing application depending on your internal workflow.

Endpoint

 https://tms.targetfmi.com/index.php?p=api&r=text&c=billoflading&m=printDGD&d=[bolID]/[date]

Request Parameters

ParameterRequired

Available Options/Data Type

Description
[bolID]YesIntegerThe ID of the BoL, returned by the Save, SaveAs, and Execute API endpoints.
[date]YesIntegerThis is the date portion of the BoL #, also returned by the Save, SaveAs, and Execute API endpoints.
proNoString

Pro Number to appear in the Shipper's Reference Number section of the DGD

poNoString

PO  Number to appear in the Shipper's Reference Number section of the DGD

soNoString

SO Number to appear in the Shipper's Reference Number section of the DGD

bolNoString

BoL Number to appear in the Shipper's Reference Number section of the DGD

refNoString

Reference Number to appear in the Shipper's Reference Number section of the DGD

productsNoString

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

/messageThe 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

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;
?>