Fetching Status from the RESTful API 

API Hub Documentation

  • Getting Started with the API Hub

  • Getting Started with Carriers

  • Using Liminal Webhooks to Register for Updates 

  • Using Liminal APIs 

  • Status & Image APIs with Webhook Calls

Your first step is to get an API Key.  After you have an API Key, we will verify that we can fetch data from your carrier’s API.  To turn the call into an automated webhook visit link

For server-side webhooks and data insertion, as well as client interactions, we will do this using SQLite and Python 3.9+ for availability on the widest variety of development platforms (all OS X, Linux, and Windows dev environments should have functional Python 3.9+ installs available from python.org or your platform’s vendor, potentially already installed). 

If you would like to follow along with the fully-annotated source code download it at Github

Let’s get started with a templated URL fetched using Python standard library tools. 

import JSON # for decoding some API responses
import urllib.request # can also use another 3rd party library 

# replace with your own secure credential store, and not the sandbox key 
class settings: 
    LIMINAL_NETWORK_API_KEY = "qNAJFePYEfzZag1pDqv" 

url = "https://api.liminalnetwork.com/{scac}/{method}?auth={api_key}&pro={pro}" 

def get_status(scac: str, pro: str) -> dict: 
    full_url = url.format( 
        scac=scac, 
        method="status", 
        api_key=settings.LIMINAL_NETWORK_API_KEY, 
        pro=pro, 
    ) 
    return json.loads(urllib.request.urlopen(full_url).read().decode()) 

When properly configured with your API Key, you can get_status(SCAC, PRO), and receive a JSON response that looks something like (formatted for easy reading): 

{'delivery_date': '2024-07-18',
'delivery_time': '2024-07-18T18:35:39', 
 'status': 'IN_TRANSIT', 
 'longstatus': 'In Transit', 
 'scac': 'SANDBOX', 
 'pro': '1721080796560' 
}  

From this JSON, we can see that this sample shipment is in transit. In the sandbox, pros always have images and documents available, are consistent in their state, and are always one of: IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERING, or DELIVERED, regardless of when you request the information. For example; the pro “1721080796560” used above will always return “IN_TRANSIT” when passed to the sandbox, with delivery dates and times always shifting into the future. 

For Final Mile Photos, all known shipments should return a status of IMAGES_AVAILABLE, IMAGES_COMPLETE, COMPLETE_DAMAGED, COMPLETE_MISSING, NOT_AT_ADDRESS, REFUSED, or OTHER. The above output was the result from performing an HTTPS GET request with the sandbox API Key with the given PRO: 

https://api.liminalnetwork.com/{method}?auth={api_key}&pro={pro}

For other carriers supported by Liminal Network, or if you have more than one carrier allowed per API key, you will want to include the SCAC of the carrier. For Liminal Network Final Mile, use “LN” for the SCAC (which are normally 4 letters): 

https://api.liminalnetwork.com/LN/{method}?auth={api_key}&pro={pro}

For all other carriers, you will want to use the SCAC referenced on the API Keys page: 

Last Updated | October 3, 2024


Have questions or need some assistance, Drop us a note.

API Hub Documentation

  • Getting Started with the API Hub

  • Getting Started with Carriers

  • Using Liminal Webhooks to Register for Updates 

  • Using Liminal APIs 

  • Status & Image APIs with Webhook Calls