Freight Tiger Ticketing System

API Endpoint
587-839-0380

FT Ticketing system runs on Spring Boot with gradle.

Build

  • gradle build

Run

  • gradle bootRun

Postman Collection

Import into your postman app

973-665-5833

User API

Function

  • Get user token

  • Create a user

  • Get list of users

  • Update a user

  • Delete a user

User: Get Token and Context

This API gets user token and context (profile) using username and password

Resource Group

Get user token

POST /localhost:8000/user/token
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "username": "admin@qatransporter",
  "password": "qatransporter123"
}
Schema
{
  "$schema": "/json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string"
    },
    "password": {
      "type": "string"
    }
  },
  "required": [
    "username",
    "password"
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "ft_user_id": 3320,
  "ft_company_id": 1199,
  "first_name": "Hindu",
  "last_name": "Sree",
  "ft_user_picture": "\"/localhost:8080/assets/img/user.png\"",
  "role": "TKT_COMPANY_ADMIN",
  "phone": "+91-98765443210",
  "email": "admin@qatransporter.com",
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMzMjAsImlzcyI6Imh0dHA6XC9cLzEzLjEyNi4xOTAuMjA3XC9hcGlcL2F1dGhlbnRpY2F0ZSIsImlhdCI6MTUyOTA0OTUzNywiZXhwIjoxNTI5NjU0MzM3LCJuYmYiOjE1MjkwNDk1MzcsImp0aSI6Imx1NVFudjA0RzJhV2NWOHgifQ.kOe_D_K7cUS_JyBiA4bLzWM6AXAm1WuUAPT2GAdFh2Y",
  "expiry": "2018-06-16T07:58:21.797+0000"
}
Schema
{
  "$schema": "/json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "ft_user_id": {
      "type": "number"
    },
    "ft_company_id": {
      "type": "number"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    },
    "ft_user_picture": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "token": {
      "type": "string"
    },
    "expiry": {
      "type": "string"
    }
  },
  "required": [
    "ft_user_id",
    "ft_company_id",
    "first_name",
    "last_name",
    "ft_user_picture",
    "role",
    "phone",
    "email",
    "token",
    "expiry"
  ]
}

Get user token
oilstove/user/token

Get user token and context


Create a Trip Request

POST /localhost:8000/trip_request
Requestsexample 1
Headers
X-Auth-Token: `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMzMjAsImlzcyI6Imh0dHA6XC9cLzEzLjEyNi4xOTAuMjA3XC9hcGlcL2F1dGhlbnRpY2F0ZSIsImlhdCI6MTUyOTA0OTUzNywiZXhwIjoxNTI5NjU0MzM3LCJuYmYiOjE1MjkwNDk1MzcsImp0aSI6Imx1NVFudjA0RzJhV2NWOHgifQ.kOe_D_K7cUS_JyBiA4bLzWM6AXAm1WuUAPT2GAdFh2Y` (string)
Content-Type: application/json
Body
{
  "notifications": true,
  "priority": "Low, Medium, High, Critical",
  "followers": [
    "1234",
    "1235",
    "1223"
  ],
  "assignments": [
    1234,
    1235,
    1223
  ],
  "escalations": [
    1234,
    1235,
    1223
  ],
  "trip_request": {
    "is_eway_bill": true,
    "is_track": false,
    "route": "Mumbai to Delhi",
    "consignee": {
      "name": "John Doe",
      "phone": "+91-9876543210"
    },
    "loading_point": {
      "lat": 12.12121212,
      "long": 12.12121212
    },
    "unloading_point": {
      "lat": 12.12121212,
      "long": 12.12121212
    },
    "trips": {
      "vehicle_numbers": [
        "KA01 AB1234",
        "KA01 AB5235",
        "KA01 AB8134"
      ]
    },
    "eway": {
      "attachments": [
        {
          "document_type": "Hello, world!",
          "filename": "vehicle-registration.pdf",
          "filepath": "s3bucket/path/to/file"
        }
      ]
    },
    "track": {
      "devices": [
        {
          "location_source": "sim, gps, portable, smartPhone, manual",
          "driver_phone": "+91-9876543210",
          "driver_name": "Hello, world!"
        }
      ]
    }
  }
}
Schema
{
  "$schema": "/json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "notifications": {
      "type": "boolean",
      "description": "Notifications for followers. Defaults to true."
    },
    "priority": {
      "type": "string"
    },
    "followers": {
      "type": "array",
      "description": "Followers array of FT user IDs"
    },
    "assignments": {
      "type": "array",
      "description": "Assign trip request by array of FT user IDs"
    },
    "escalations": {
      "type": "array",
      "description": "Escalate trip request by array of FT user IDs"
    },
    "trip_request": {
      "type": "object",
      "properties": {
        "is_eway_bill": {
          "type": "boolean",
          "description": "Specifies if a trip requires eWay bill"
        },
        "is_track": {
          "type": "boolean",
          "description": "Specifies if trip required track and trace"
        },
        "route": {
          "type": "string",
          "description": "Trip route"
        },
        "consignee": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Consignee name"
            },
            "phone": {
              "type": "string",
              "description": "Consignee phone number"
            }
          },
          "required": [
            "name",
            "phone"
          ]
        },
        "loading_point": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "description": "Loading point latitude"
            },
            "long": {
              "type": "number",
              "description": "Loading point longitude"
            }
          },
          "required": [
            "lat",
            "long"
          ]
        },
        "unloading_point": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "description": "Loading point latitude"
            },
            "long": {
              "type": "number",
              "description": "Loading point longitude"
            }
          },
          "required": [
            "lat",
            "long"
          ]
        },
        "trips": {
          "type": "object",
          "properties": {
            "vehicle_numbers": {
              "type": "array"
            }
          },
          "required": [
            "vehicle_numbers"
          ]
        },
        "eway": {
          "$ref": "#/definitions/attachments",
          "description": "eWay bill data"
        },
        "track": {
          "$ref": "#/definitions/devices",
          "description": "Track and trace devices"
        }
      },
      "required": [
        "route",
        "consignee",
        "loading_point",
        "unloading_point",
        "trips",
        "eway",
        "track"
      ]
    }
  },
  "required": [
    "trip_request"
  ],
  "definitions": {
    "attachments": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "array"
        }
      }
    },
    "devices": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "array"
        }
      }
    }
  }
}
Responses200
Headers
X-Auth-Token: `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjMzMjAsImlzcyI6Imh0dHA6XC9cLzEzLjEyNi4xOTAuMjA3XC9hcGlcL2F1dGhlbnRpY2F0ZSIsImlhdCI6MTUyOTA0OTUzNywiZXhwIjoxNTI5NjU0MzM3LCJuYmYiOjE1MjkwNDk1MzcsImp0aSI6Imx1NVFudjA0RzJhV2NWOHgifQ.kOe_D_K7cUS_JyBiA4bLzWM6AXAm1WuUAPT2GAdFh2Y` (string)
Content-Type: application/json
Body
{
  "id": "TR101",
  "route": "Bangalore to Mumbai",
  "priority": "Low",
  "status": "Open",
  "assignments": [
    {
      "user_id": 123,
      "first_name": "Hindu",
      "last_name": "Sree",
      "role": "TKT_COMPANY_ADMIN",
      "created_at": "15-06-2018 13:00:00",
      "updated_at": "15-06-2018 13:00:00"
    }
  ]
}
Schema
{
  "$schema": "/json-schema.org/draft-04/schema#",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/definitions/assignments"
    },
    {
      "properties": {
        "id": {
          "type": "string"
        },
        "route": {
          "type": "string"
        },
        "priority": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    }
  ],
  "required": [
    "id",
    "route",
    "priority",
    "status"
  ],
  "definitions": {
    "assignments": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "array"
        }
      }
    }
  }
}

Create a Trip Request
(514) 641-9347/trip_request

Creates a trip request


Generated by (289) 695-8414 on 04 Jul 2018