Packagelytics API
Track your fleet, connect with customers and document deliveries, all with a beautifully designed API.
Last updated
Was this helpful?
Track your fleet, connect with customers and document deliveries, all with a beautifully designed API.
Last updated
Was this helpful?
The Packagelytics Application Programming Interface (API) gives you the tools you need to build a full featured delivery management system. It allows you to create routes and dispatch them to the Packagelytics driver app. Built in route optimization, text notifications and photo proof of delivery from within the app guarantees an efficient, timely, customer centric delivery experience.
In this quickstart guide, we will show you how to programmatically create and dispatch routes to drivers. Briefly, the steps involved are:
Create a driver (linked with the Packagelytics PID on his device)
Create a route belonging to that driver with several initial stops
Adding additional stops to the route (optional)
Dispatching the route to the driver so he can see it on the Packagelytics app on his phone
All authentication in the Packagelytics API is done using an API key. You can retrieve your API key by logging into www.packagelytics.com and clicking the [API Key] link on the top navigation bar.
The easiest way to add a driver is to do it manually on the admin portal at www.packagelytics.com. Click the [Drivers] link on the top navigation bar and click [New Driver]. Next, get your driver to download the Packagelytics app from the Apple App Store or Google Play Store. Enter the name, PID (the PID can be found on the Packagelytics driver app when the driver runs it for the first time) and phone number of the driver you want to add. Once a driver is added, it will show up on the driver listing page.
Once this is done, you need to retrieve the user_id
of the driver (a user) you want to dispatch the route to. You do this by making a GET call on the users endpoint.
GET
https://packagelytics.com/api/v1/users
Retrieve all users in your Packagelytics account.
Authorization
string
YOUR_API_KEY
Content-Type
string
application/json
In this example, I want to dispatch a route to the driver "Jason iPhone" with the PID
PID015250, so I'm going to note down his user_id
5ea3ee5f8aca520017861df3 and use it when creating and assigning a route to him.
POST
https://packagelytics.com/api/v1/routes
Create a route with stops and assign it to a driver.
Authorization
string
YOUR_API_KEY
Content-Type
string
application/json
Input
Output
If the route was created successfully, the API will return a route_id
(in the example above, the route_id
is 5ea47ad5e9ab5d7953b4e030. You can then view the route on your dashboard at https://packagelytics.com/dashboard/routes/5ea47ad5e9ab5d7953b4e030. Note that the route has not been dispatched to the driver yet, and is not in optimized order (this will be done by the driver using the Packagelytics app).
Now, suppose you want to add more stops to the initial route that you created. All you need to do is call the Create Stops API one at a time and specify a route_id
to assign the stop to.
POST
https://packagelytics.com/api/v1/routes
Create a route with stops and assign it to a driver.
Authorization
string
YOUR_API_KEY
Content-Type
string
application/json
Output
You can now see the new stop (Yellow Dog Brewing Co) added to the end of route.
The last step is to dispatch this route to your driver so it shows up on the Packagelytics app on his phone.
POST
https://packagelytics.com/api/v1/routes/5ea47ad5e9ab5d7953b4e030/dispatch
Dispatch a route to its driver.
Authorization
string
YOUR_API_KEY
Content-Type
string
application/json
Output
If the route was dispatched correctly, you would see a dispatch message and timestamp on the top right hand corner of the route detail page.
The driver will get a push notification and can now view the new route on his phone.