Click or drag to resize
ParaPlan Logo

How To Track Manifest Changes

This document will highlight how to maintain up-to-date manifest on devices without push notifications or for users that do not have push notifications enabled.

Tip Tip

Your app should always allow the user to manually perform a full manifest update. The standard way to do this is with a pull to refresh gesture.

Note Note

All times referenced in this document are stored as Unix timestamp. Use epochconverter.com to convert human-readable dates and vice versa.

Keeping the driver's manifest up-to-date with the server is important to maintain trust in the app. When the manifest changes, the driver should know in less then 30 seconds. This call is very lightweight and fast. It can be called every 10-15 seconds without performance concerns.

Keeping the manifest up to date is a 3 step process:

  1. Check for changes

  2. Refresh manifest from server

  3. Mark changes as collected

Check for Changes
Note Note

The token and device are obtained when logging into API

ManifestChanges

  1. Send a GET request to:ManifestChanges(String, String, String)

    Note Note

    For a smaller dataset, use ManifestChangesSlim(String, String, String)

    C#
    1var url = $"{storedRESTUrl}/TripService/Trips/ManifestChanges?Token={token}&Device={device}&Timestamp={timestamp}";
    2using (WebClient client = new WebClient())
    3{
    4    string s = client.DownloadString(url);
    5    var token = JsonConvert.DeserializeObject<ListResponse<ManifestChange>>(s);
    6
    7}
  2. It will return back a ListResponseT of ManifestChange with information about manifest changes that will look like:

    json
     {
        "errorMessage": "",
        "success": true,
        "tokenExists": true,
        "tokenIsValid": true,
        "list": [{
            "collected": false,
            "driverId": "timhibbard@engraph.com",
            "message": "Manifest change: JESSICA BOLSTER 10:31 PM PU 10:50 PM DO",
            "timestamp": "1571106053",
            "tripId": "33649"
        }, {
            "collected": false,
            "driverId": "timhibbard@engraph.com",
            "message": "Removed Kaye Smith 10\/16\/2019 8:00 AM PU from manifest",
            "timestamp": "1571275497",
            "tripId": "33683"
        }]
    }
Refresh manifest from server

Once we know a change exists on the server, there are several ways we can update our driver's manifest. The easiest way is do do a full refresh. There is also a more surgical approach if bandwidth preservation is a must.

Full refresh

  • Send a GET request to:TripsInWrapper(String, String, String, String, String, String)

Subset refresh

  • Note Note

    The TripIds parameter is a comma seperated string of TripId (i.e. "31154,2354,9854")

    Send a GET request to:TripDetails(String, String, String)

    C#
    1var url = $"{storedRESTUrl}/TripService/TripDetails?Token={token}&Device={device}&tripids={tripIds}";
    2using (WebClient client = new WebClient())
    3{
    4    string s = client.DownloadString(url);
    5    var token = JsonConvert.DeserializeObject<ListResponse<Stop>>(s);
    6
    7}
Mark changes as collected

Once the data has been refreshed in your app, you need to let the server know you have processed the changes. This prevents unecessary server hits.

ManifestChangesMarkAsCollected

  1. Send a GET request to:ManifestChangesMarkAsCollected(String, String, String)

    C#
    1var url = $"{storedRESTUrl}/TripService/Trips/ManifestChangesProcessed?Token={token}&Device={device}&Timestamp={timestamp}";
    2using (WebClient client = new WebClient())
    3{
    4    string s = client.DownloadString(url);
    5    var token = JsonConvert.DeserializeObject<SimpleResponse>(s);
    6
    7}
  2. It will return back a SimpleResponse indicating if the operation was successful that will look like:

    json
    {
      "errorMessage": "",
      "success": true,
      "tokenExists": true,
      "tokenIsValid": true
    }