View All Collections

7. VIEW ALL COLLECTIONS

URL: https://app.detrack.com/api/v1/collections/view/all.json
HTTP POST REQUEST

Note: the request structure below is for Method #1: Name/Value Pair (NVP) + JSON String. For Method #2: Custom Header + JSON Body, please refer to the json parameter only.

Parameter Description
key Your API key. You can obtain this from your dashboard.
json The JSON string containing the date for which you wish to view all collections. It should contain the following field:

Field Description
date The collection date. Format: YYYY-MM-DD e.g. 2014-02-28. Required field.
HTTP POST RESPONSE (JSON)
Field Description
info Contains information on the status of the request.

Field Description
status The status of the request. The value will be “ok” if request is processed successfully or “failed” if the key or json parameter is missing.
error Contains the error details if the request failed. Note: this field is set only if the request failed.

Field Description
code The error code. Please refer to Collection Error Codes
message The corresponding error message.
collections This field may or may not be empty. If not empty, it should contain an array of collections with the following fields:

Field Description
date The collection date. Format: YYYY-MM-DD e.g. 2014-02-28.
do The D.O. #. This field is unique for the date.
address The collection address.
collection_time The collection time window.
collect_from The name of the sender to collect from.
phone The phone number of the sender.
notify_email The email address to send customer-facing collection updates to.
notify_url The URL to post collection updates to. Please refer to Collection Push Notification
assign_to The name of the vehicle to assign this collection to.
instructions Collection instructions for the driver.
zone The zone that this collection falls under.
reason The reason of non-collection if the collection is not collected.
note Any note recorded by the driver regarding this collection.
sent_by The name of the sender who signed for the collection.
image If the POD contains an image (signature / photo), the value will be 1. Otherwise, it will be 0Please refer to Download Collection POD Image File
view_image_url If the POD contains an image (signature / photo), this field will contain an access-controlled link (user must be logged in to Detrack) to the image. Otherwise, it will be empty.
time The time the POD is received. ISO 8601 format: YYYYMMDDTHH:MM:SS+HH:MM e.g. 2014-02-13T09:30:45+08:00
pod_lat The latitude of the driver’s last known location when submitting POD for this collection.
pod_lng The longitude of the driver’s last known location when submitting POD for this collection.
pod_address The address of the driver’s last known location when submitting POD for this collection.
items This field may or may not be empty. If not empty, it should contain an array of items with the following fields:

Field Description
sku Stock keeping unit or item #.
desc The item description.
qty Quantity of the item to be collected.
reject Quantity of the item rejected.
reason Reason of item rejection.

For additional fields, please refer to Additional Collection Fields.

SAMPLE REQUEST JSON
{
   "date":"2014-02-13"
}
SAMPLE RESPONSE JSON
{
   "info":{
      "status":"ok"
   },
   "collections":[
      {
         "date":"2014-02-13",
         "address":"63 Ubi Avenue 1 Singapore 408937",
         "collection_time":"09:00 AM - 12:00 PM",
         "collect_from":"John Tan",
         "phone":"+6591234567",
         "notify_email":"john.tan@example.com",
         "notify_url":"http://www.example.com/notify.php",
         "assign_to":"GT1234H",
         "instructions":"Call customer upon arrival.",
         "zone":"East",
         "reason":"",
         "note":"Sender commented that collection is very prompt.",
         "sent_by":"John",
         "image":1,
         "view_image_url":"https://app.detrack.com/collections/photo/52cbaf87f92ea105a4000115.jpg",
         "do":"DO140213001",
         "status":"Collected",
         "time":"2014-02-13T09:30:45+08:00",
         "pod_lat":1.32502083807714,
         "pod_lng":103.893779271220,
         "pod_address":"63 Ubi Avenue 1, Singapore 408937",
         "items":[
            {
               "sku":"T0201",
               "desc":"Test Item #01",
               "qty":1,
               "reject":0,
               "reason":""
            },
            {
               "sku":"T0202",
               "desc":"Test Item #02",
               "qty":5,
               "reject":0,
               "reason":""
            },
            {
               "sku":"T0203",
               "desc":"Test Item #03",
               "qty":10,
               "reject":0,
               "reason":""
            }
         ]
      },
      {
         "date":"2014-02-13",
         "address":"59 Ubi Avenue 1 Singapore 408938",
         "collection_time":"02:00 PM - 05:30 PM",
         "collect_from":"Jane Lim",
         "phone":"+6581234567",
         "notify_email":"jane.lim@example.com",
         "notify_url":"http://www.example.com/notify.php",
         "assign_to":"GT1234H",
         "instructions":"Change pass at security counter before proceeding to level 3.",
         "zone":"East",
         "reason":"",
         "note":"",
         "sent_by":"",
         "image":0,
         "view_image_url":"",
         "do":"DO140213002",
         "status":"In Progress",
         "time":"",
         "pod_lat":"",
         "pod_lng":"",
         "pod_address":"",
         "items":[
            {
               "sku":"T0211",
               "desc":"Test Item #11",
               "qty":1,
               "reject":0,
               "reason":""
            },
            {
               "sku":"T0212",
               "desc":"Test Item #12",
               "qty":5,
               "reject":0,
               "reason":""
            },
            {
               "sku":"T0213",
               "desc":"Test Item #13",
               "qty":10,
               "reject":0,
               "reason":""
            }
         ]
      }
   ]
}