Skip to content

API Access

We welcome developers to integrate OneTracker service and we allow public access to some of our APIs.

Overview

Only HTTPS is supported. All APIs are accessed from https://api.onetracker.app and all data is sent and received in JSON.

All failed requests should receive a 4xx-5xx response with a message field that contains error description.

Authentication

Create authentication token

POST /auth/token

Successful requests will receive an authentication token, which can be sent in x-api-token header to endpoints that require user authentication.

Failed request will receive a 401 response.

Example

Request
{
    "email": "test@example.com",
    "password": "abcd1234"
}
Response
{
  "message": "ok",
  "session": {
    "user_id": 156,
    "token": "eP0FUZhN76Wu7igUkCPigR2wEMBDtzaW",
    "expiration": "2020-08-03T03:15:54.677770006Z"
  }
}

Parcels

List parcels

GET /parcels

Example

Resposne
{
  "message": "ok",
  "parcels": [
    {
      "id": 174,
      "user_id": 6,
      "email_id": 183,
      "email_sender": "example.com",
      "retailer_name": "Example",
      "description": "Camera",
      "notification_level": 1,
      "is_archived": 0,
      "carrier": "FedEx",
      "carrier_name": "FedEx",
      "carrier_redirection_available": true,
      "tracker_cached": false,
      "tracking_id": "407072905722",
      "tracking_url": "",
      "tracking_status": "delivered",
      "tracking_status_description": "",
      "tracking_status_text": "",
      "tracking_extra_info": "",
      "tracking_location": "Sunnyvale, CA",
      "tracking_time_estimated": "2018-08-08T20:00:00Z",
      "tracking_time_delivered": "2018-08-08T15:51:00Z",
      "tracking_lock": 0,
      "tracking_events": null,
      "time_added": "2018-08-07T00:50:30Z",
      "time_updated": "2018-08-18T20:01:23Z"
    }
  ]
}

Get one parcel

GET /parcels/:parcel_id

Replace :parcel_id with parcel ID returned in the list response.

Example

Response
{
  "message": "ok",
  "parcel": {
    "id": 938,
    "user_id": 6,
    "email_id": 0,
    "email_sender": "",
    "retailer_name": "",
    "description": "",
    "notification_level": 1,
    "is_archived": 0,
    "carrier": "FedEx",
    "carrier_name": "",
    "carrier_redirection_available": false,
    "tracker_cached": false,
    "tracking_id": "123456789012",
    "tracking_url": "",
    "tracking_status": "delivered",
    "tracking_status_description": "",
    "tracking_status_text": "",
    "tracking_extra_info": "",
    "tracking_location": "MEMPHIS, TN",
    "tracking_time_estimated": "1001-01-01T00:00:00Z",
    "tracking_time_delivered": "2020-01-17T16:30:00Z",
    "tracking_lock": 0,
    "tracking_events": [
      {
        "id": 5699,
        "parcel_id": 938,
        "carrier_id": "",
        "carrier_name": "",
        "status": "delivered",
        "text": "Delivered. Signed for by: REF 39609023995",
        "location": "MEMPHIS, TN",
        "latitude": 35.149536,
        "longitude": -90.04898,
        "time": "2020-01-17T16:30:00Z",
        "time_added": "2020-05-05T05:47:56Z"
      },
      {
        "id": 5697,
        "parcel_id": 938,
        "carrier_id": "",
        "carrier_name": "",
        "status": "pre_transit",
        "text": "Shipment information sent to FedEx",
        "location": "",
        "latitude": 0,
        "longitude": 0,
        "time": "2019-12-09T07:50:11Z",
        "time_added": "2020-05-05T05:47:56Z"
      }
    ],
    "time_added": "2020-05-05T04:42:39Z",
    "time_updated": "2020-05-05T05:47:56Z"
  }
}

Delete parcel

DELETE /parcels/:parcel_id

Example

Response
{
  "message": "ok"
}