Bill Of Lading
The R+L Carrier's Bill of Lading API allows you to instantly create, print, or edit Bill of Ladings. Using this API will help you save time and costly errors.
Create Bill Of Lading
POST /BillOfLading
Request Parameters
Name | Type | Cardinality | Required | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BillOfLading | object | One | Required | Bill of lading object | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PickupRequest | object | Zero or One | Optional | Fill this out if you would like to schedule a Pickup at the same time as creating the BOL. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GenerateUniversalPro | boolean | Zero or One | Optional | Pass in true to get a universal pro that will not be re-stickered by the driver on pickup (this requires you to sticker the freight). Pass in false to receive a web pro that the driver will sticker with a pro. Note: Web Pros will still work for shipment tracking and document retrieval. |
Response Parameters
Name | Type | Cardinality | Description |
---|---|---|---|
ProNumber | string | One | Either the web pro or a pre-assigned pro for the BOL. Web Pros start with 'W'. |
PickupRequestNumber | string | Zero or One | Will be present if pickup request is scheduled with the creation of the BOL. |
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/BillOfLading');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key',
'Content-Type' => 'application/json'
));
$request->setBody('{
\n "BillOfLading": {
\n "BOLDate": "08/17/2020",
\n "Shipper": {
\n "CompanyName": "Shipper Test",
\n "AddressLine1": "123 ship test",
\n "PhoneNumber": "6145558888",
\n "City": "Ocala",
\n "StateOrProvince": "FL",
\n "ZipOrPostalCode": "34471",
\n "CountryCode": "USA"
\n },
\n "Consignee": {
\n "CompanyName": "Consignee Test",
\n "AddressLine1": "123 consignee test",
\n "City": "Wilmington",
\n "StateOrProvince": "OH",
\n "ZipOrPostalCode": "45177",
\n "CountryCode": "USA"
\n },
\n "Items": [
\n {
\n "Class": "70",
\n "Pieces": 1,
\n "Weight": 110,
\n "PackageType": "BAG",
\n "Description": "Test description"
\n }
\n ],
\n "SpecialInstructions": "Test special instructions",
\n "FreightChargePaymentMethod": "Prepaid",
\n "ServiceLevel": "Standard"
\n },
\n "GenerateUniversalPro": true
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.BillOfLading;
using CallAPI.DataContracts.BillOfLading.Request;
using CallAPI.DataContracts.BillOfLading.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class BillOfLadingSample
{
string apiKey = "Your API Key";
public BolResponse CreateBOL()
{
var request = PopulateBOLData();
var response = new BolResponse();
var url = "{baseurl}/BillOfLading";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.PostAsJsonAsync(url, request).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
private CreateBolRequest PopulateBOLData()
{
var shipper = new DataContracts.Party()
{
CompanyName = "Shipper Test",
AddressLine1 = "123 ship test",
ZipOrPostalCode = "34471",
City = "Ocala",
StateOrProvince = "FL",
CountryCode = "USA",
PhoneNumber = "6145558888"
};
var consignee = new Consignee()
{
CompanyName = "Consignee Test",
AddressLine1 = "123 consignee test",
ZipOrPostalCode = "45177",
City = "Wilmington",
StateOrProvince = "OH",
CountryCode = "USA"
};
var item = new Item()
{
Class = "70",
Pieces = 1,
Weight = 110,
PackageType = "BAG",
Description = "Test Description"
};
var bolInfo = new BillOfLading()
{
BOLDate = DateTime.Now.ToShortDateString(),
Shipper = shipper,
Consignee = consignee,
Items = new List- () { item },
SpecialInstructions = "Test Special Instructions",
FreightChargePaymentMethod = "Prepaid",
ServiceLevel = "Standard"
};
var bolData = new CreateBolRequest()
{
BillOfLading = bolInfo,
PickupRequest = null,
GenerateUniversalPro = true
};
return bolData;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Party;
import DataContracts.BillOfLading.BillOfLading;
import DataContracts.BillOfLading.Consignee;
import DataContracts.BillOfLading.Item;
import DataContracts.BillOfLading.Request.CreateBolRequest;
import DataContracts.BillOfLading.Response.BolResponse;
public class BillOfLadingSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public BolResponse CreateBOL() throws Exception{
BolResponse response = new BolResponse();
CreateBolRequest request = PopulateBOLData();
String requestJSON = mapper.writeValueAsString(request);
String url = "{baseurl}/BillOfLading";
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpRequest = new HttpPost(url);
StringEntity params =new StringEntity(requestJSON);
httpRequest.addHeader("content-type", "application/json");
httpRequest.addHeader("apiKey", apiKey);
httpRequest.setEntity(params);
HttpResponse httpResponse = httpClient.execute(httpRequest);
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
response = mapper.readValue(result.toString(), BolResponse.class);
return response;
}
private CreateBolRequest PopulateBOLData()
{
Party shipper = new Party();
shipper.CompanyName = "Shipper Test";
shipper.AddressLine1 = "123 ship test";
shipper.ZipOrPostalCode = "34471";
shipper.City = "Ocala";
shipper.StateOrProvince = "FL";
shipper.CountryCode = "USA";
shipper.PhoneNumber = "6145558888";
Consignee consignee = new Consignee();
consignee.CompanyName = "Consignee Test";
consignee.AddressLine1 = "123 consignee test";
consignee.ZipOrPostalCode = "45177";
consignee.City = "Wilmington";
consignee.StateOrProvince = "OH";
consignee.CountryCode = "USA";
Item item = new Item();
item.Class = "70";
item.Pieces = 1;
item.Weight = 110;
item.PackageType = "BAG";
item.Description = "Test Description";
List- items = new ArrayList
- ();
items.add(item);
BillOfLading bolInfo = new BillOfLading();
bolInfo.BOLDate = LocalDate.now().format(DateTimeFormatter.ofPattern("MM/dd/yyyy"));
bolInfo.Shipper = shipper;
bolInfo.Consignee = consignee;
bolInfo. Items = items;
bolInfo.SpecialInstructions = "Test Special Instructions";
bolInfo.FreightChargePaymentMethod = "Prepaid";
bolInfo.ServiceLevel = "Standard";
CreateBolRequest bolData = new CreateBolRequest();
bolData.BillOfLading = bolInfo;
bolData.PickupRequest = null;
bolData.GenerateUniversalPro = true;
return bolData;
}
}
Get Bill Of Lading
HTTP Method: GET
URL: /BillOfLading
URL: /BillOfLading
Request Parameters
Name | Type | Cardinality | Required | Description |
---|---|---|---|---|
ProNumber | string | One | Required | ProNumber for the BOL you want to retrieve. |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ProNumber | string | One | Pro Number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PickupRequestId | string | Zero or One | This will be present if you scheduled a Pickup Request with your BOL. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BillOfLading | object | One | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Code | integer | One | HTTP Status Code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Errors | array | One | List of Errors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Messages | array | One | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/BillOfLading?ProNumber=I111111111');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.BillOfLading;
using CallAPI.DataContracts.BillOfLading.Request;
using CallAPI.DataContracts.BillOfLading.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class BillOfLadingSample
{
string apiKey = "Your API Key";
//GET
public GetBolResponse GetBOL()
{
var proNumber = "I111111111";
var url = string.Format("{baseurl}/BillOfLading?ProNumber={0}", proNumber);
var response = new GetBolResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Party;
import DataContracts.BillOfLading.BillOfLading;
import DataContracts.BillOfLading.Consignee;
import DataContracts.BillOfLading.Item;
import DataContracts.BillOfLading.Request.CreateBolRequest;
import DataContracts.BillOfLading.Response.BolResponse;
import DataContracts.BillOfLading.Response.GetBolResponse;
public class BillOfLadingSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public GetBolResponse GetBOL() throws Exception {
GetBolResponse response = new GetBolResponse();
String url = "{baseurl}/BillOfLading";
String proNumber = "I111111111";
url += "?ProNumber=" + proNumber;
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);
HttpResponse httpResponse = httpClient.execute(httprequest);
BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();
response = mapper.readValue(result.toString(), GetBolResponse.class);
return response;
}
}
Print BOL
HTTP Method: GET
URL: /BillOfLading/PrintBOL
URL: /BillOfLading/PrintBOL
Request Parameters
Name | Type | Cardinality | Required | Description |
---|---|---|---|---|
ProNumber | string | One | Required | The Pro Number for the BOL to retrieve a PDF image of. |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BolDocument | string | One | Base64 encoded string of a pdf bol document | ||||||||||||||||||||
Code | integer | One | HTTP Status Code | ||||||||||||||||||||
Errors | array | One | |||||||||||||||||||||
Properties
|
|||||||||||||||||||||||
Messages | array | One | |||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/BillOfLading/PrintBOL?ProNumber=I111111111');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.BillOfLading;
using CallAPI.DataContracts.BillOfLading.Request;
using CallAPI.DataContracts.BillOfLading.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class BillOfLadingSample
{
string apiKey = "Your API Key";
//GET
public PrintBOLResponse PrintBOL()
{
var proNumber = "I111111111";
var url = string.Format("{baseurl}/BillOfLading/PrintBOL?ProNumber={0}", proNumber);
var response = new PrintBOLResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Party;
import DataContracts.BillOfLading.BillOfLading;
import DataContracts.BillOfLading.Consignee;
import DataContracts.BillOfLading.Item;
import DataContracts.BillOfLading.Request.CreateBolRequest;
import DataContracts.BillOfLading.Response.BolResponse;
import DataContracts.BillOfLading.Response.GetBolResponse;
import DataContracts.BillOfLading.Response.PrintBOLResponse;
import DataContracts.BillOfLading.Response.PrintShippingLabelsResponse;
public class BillOfLadingSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public PrintBOLResponse PrintBOL() throws Exception {
PrintBOLResponse response = new PrintBOLResponse();
String url = "{baseurl}/BillOfLading/PrintBOL";
String proNumber = "I111111111";
url += "?ProNumber=" + proNumber;
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);
HttpResponse httpResponse = httpClient.execute(httprequest);
BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();
response = mapper.readValue(result.toString(), PrintBOLResponse.class);
return response;
}
}
Print Shipping Labels
HTTP Method: GET
URL: /BillOfLading/PrintShippingLabels
URL: /BillOfLading/PrintShippingLabels
Request Parameters
Name | Type | Cardinality | Required | Description |
---|---|---|---|---|
ProNumber | string | One | Required | The Pro Number for the Bol you want to get labels for. |
Style | integer | One | Required | Between 1 and 13. See this document for descriptions of the different styles here. |
StartPosition | integer | Zero or One | Optional | Will default to 1. Between 1 and 10. |
NumberOfLabels | integer | One | Required | The number of labels to print. Between 1 and 100. |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ShippingLabelsFile | string | One | Base64 encoded string of a pdf with your labels. | ||||||||||||||||||||
Code | integer | One | HTTP Status Code | ||||||||||||||||||||
Errors | array | One | |||||||||||||||||||||
Properties
|
|||||||||||||||||||||||
Messages | array | One | |||||||||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/BillOfLading/PrintShippingLabels?ProNumber=I111111111&Style=1&StartPosition=1&NumberOfLabels=1');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.BillOfLading;
using CallAPI.DataContracts.BillOfLading.Request;
using CallAPI.DataContracts.BillOfLading.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class BillOfLadingSample
{
string apiKey = "Your API Key";
//GET
public PrintShippingLabelsResponse PrintShippingLabels()
{
var proNumber = "I111111111";
var style = 1;
var startPosition = 1;
var numberOfLabels = 1;
var url = string.Format("{baseurl}/BillOfLading/PrintShippingLabels?ProNumber={0}&Style={1}&StartPosition={2}&NumberOfLabels={3}",
proNumber, style, startPosition, numberOfLabels);
var response = new PrintShippingLabelsResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Party;
import DataContracts.BillOfLading.BillOfLading;
import DataContracts.BillOfLading.Consignee;
import DataContracts.BillOfLading.Item;
import DataContracts.BillOfLading.Request.CreateBolRequest;
import DataContracts.BillOfLading.Response.BolResponse;
import DataContracts.BillOfLading.Response.GetBolResponse;
import DataContracts.BillOfLading.Response.PrintBOLResponse;
import DataContracts.BillOfLading.Response.PrintShippingLabelsResponse;
public class BillOfLadingSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public PrintShippingLabelsResponse PrintShippingLabels() throws Exception {
PrintShippingLabelsResponse response = new PrintShippingLabelsResponse();
String url = "{baseurl}/BillOfLading/PrintShippingLabels";
String proNumber = "I111111111";
int style = 1;
int startPosition = 1;
int numberOfLabels = 1;
url += "?ProNumber=" + proNumber + "&Style=" + style + "&StartPosition=" + startPosition + "&NumberOfLabels=" + numberOfLabels;
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);
HttpResponse httpResponse = httpClient.execute(httprequest);
BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();
response = mapper.readValue(result.toString(), PrintShippingLabelsResponse.class);
return response;
}
}
Get Hazmat Description
HTTP Method: GET
URL: /BillOfLading/GetHazmatDescription
URL: /BillOfLading/GetHazmatDescription
Request Parameters
Name | Type | Cardinality | Required | Description |
---|---|---|---|---|
uNNANumber | string | One | Required | UNNA Number - supported format is UN1234 |
Response Parameters
Name | Type | Cardinality | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
UNNAList | array | ||||||||||||||
Properties
|
Example Request
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{baseurl}/BillOfLading/GetHazmatDescription?request.uNNANumber=UN1971');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'apiKey' => 'Your API Key'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
using CallAPI.DataContracts.BillOfLading;
using CallAPI.DataContracts.BillOfLading.Request;
using CallAPI.DataContracts.BillOfLading.Response;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace CallAPI
{
class BillOfLadingSample
{
string apiKey = "Your API Key";
//GET
public GetHazmatDescriptionResponse GetHazmatDescription()
{
var uNNANumber= "UN1971";
var url = string.Format("{baseurl}/BillOfLading/GetHazmatDescription?uNNANumber={0}",
uNNANumber);
var response = new GetHazmatDescriptionResponse();
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Add("apiKey", apiKey);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var apiResponse = client.GetAsync(url).Result;
response = apiResponse.Content.ReadAsAsync().Result;
}
return response;
}
}
}
package Samples;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import com.fasterxml.jackson.databind.ObjectMapper;
import DataContracts.Party;
import DataContracts.BillOfLading.BillOfLading;
import DataContracts.BillOfLading.Consignee;
import DataContracts.BillOfLading.Item;
import DataContracts.BillOfLading.Request.CreateBolRequest;
import DataContracts.BillOfLading.Response.BolResponse;
import DataContracts.BillOfLading.Response.GetBolResponse;
import DataContracts.BillOfLading.Response.GetHazmatDescriptionResponse;
public class BillOfLadingSample {
String apiKey = "Your API Key";
ObjectMapper mapper = new ObjectMapper();
public GetHazmatDescriptionResponse GetHazmatDescriptionResponse() throws Exception {
GetHazmatDescriptionResponse response = new GetHazmatDescriptionResponse();
String url = "{baseurl}/BillOfLading/GetHazmatDescription";
String uNNANumber= "UN1971";
url += "?uNNANumber=" + uNNANumber;
HttpClient httpClient = HttpClientBuilder.create().build();
HttpGet httprequest = new HttpGet(url);
httprequest.setHeader("apiKey", apiKey);
HttpResponse httpResponse = httpClient.execute(httprequest);
BufferedReader in = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
result.append(inputLine);
}
in.close();
response = mapper.readValue(result.toString(), GetHazmatDescriptionResponse.class);
return response;
}
}