This is an old revision of the document!
API call
GET https://tfy.tech101.in/api/v1/hire-requests
Headers
Authorization: Bearer admin-token
Headers
HTTP/1.1 200 OK
Body
[ { "id": "hire-request-id", "dates": { "load": "desired-loading-date", "delivery": "desired-delivery-date" }, "cities": { "load": { "id": "uuid-of-city", "name": "name-of-city" }, "delivery": { "id": "uuid-of-city", "name": "name-of-city" } } }, { ... more requests ... } ]
Headers
HTTP/1.1 401 INVALID-TOKEN
Headers
HTTP/1.1 403 FORBIDDEN
Headers
HTTP/1.1 500 ERROR Content-Type: text/plain
Body
Sample error message
API call
https://tfy.tech101.in/api/v1/hire-requests/uuid-of-request
Headers
Authorization: Bearer admin-token Content-Type: application/json
Headers
HTTP/1.1 200 OK
Body
{ "id": "hire-request-id", "hirer": { "id": "uuid-of-hirer", "name": "name-of-hirer", "phone": "phone-number-of-hirer" }, "dates": { "load": "desired-loading-date", "delivery": "desired-delivery-date" }, "cities": { "load": { "id": "uuid-of-city", "name": "name-of-city" }, "delivery": { "id": "uuid-of-city", "name": "name-of-city" } }, "truckType": { "id": "uuid-of-truck-type", "name": "name-of-truck-type" }, "capacity": capacity-in-tonnes, "addresses": { "load": "complete-loading-address", "delivery": "complete-delivery-address" }, "tariff": quoted-tariff }
Headers
HTTP/1.1 401 INVALID-TOKEN
Headers
HTTP/1.1 403 FORBIDDEN
Headers
HTTP/1.1 400 INVALID-REQUEST-ID Content-Type: text/plain
Headers
HTTP/1.1 404 HIRE-REQUEST-NOT-FOUND
Headers
HTTP/1.1 500 ERROR Content-Type: text/plain
Body
Sample error message
API call
GET https://tfy.tech101.in/api/v1/hire-requests/uuid-of-request/trucks
Headers
Authorization: Bearer admin-token
Headers
HTTP/1.1 200 OK Content-Type: application/json
Body
[ "truck": { "id": "uuid-of-truck", "registration": "registration-number-of-truck" }, "driver": { "id": "uuid-of-driver", "name": "name-of-driver", "phone": "" } ]
Headers
HTTP/1.1 401 INVALID-TOKEN
Headers
HTTP/1.1 403 FORBIDDEN
Headers
HTTP/1.1 400 INVALID-HIRE-REQUEST Content-Type: text/plain
Body
Hire request must be a UUID.
Headers
HTTP/1.1 404 HIRE-REQUEST-NOT-FOUND
where <object-type> can be HIRE-REQUEST or SUGGESTION
Headers
HTTP/1.1 500 ERROR Content-Type: text/plain
Body
Sample error message
API call
POST https://tfy.tech101.in/api/v1/bookings
Headers
Authorization: Bearer user-token Content-Type: application/json
Body
{ "requestId": "uuid-of-hire-request", "truckId": "uuid-of-assigned-truck" }
Headers
HTTP/1.1 200 OK Content-Type: application/json
Body
{ "id": "uuid-of-booking", "hirer": { "id": "uuid-of-hirer", "name": "name-of-hirer", "phone": "phone-number-of-hirer" }, "truck": { "id": "uuid-of-truck", "registration": "registration-number-of-truck", "type": { "id": "uuid-of-truck-type", "name": "name-of-truck-type" } , "capacity": capacity-in-tonnes }, "driver": { "id": "uuid-of-driver", "name": "name-of-driver", "phone": "phone-number-of-driver" }, "plan": { "load": { "date": "YYYY-MM-DD, date of loading", "city": { "id": "uuid-of-city", "name": "name-of-city" }, "address": "full-address-of-loading-point" }, "delivery": { "date": "YYYY-MM-DD, date of delivery", "city": { "id": "uuid-of-city", "name": "name-of-city" }, "address": "full-address-of-delivery-point" } }, "tariff": tariff-in-rupees }
Headers
HTTP/1.1 401 INVALID-TOKEN
Headers
HTTP/1.1 403 FORBIDDEN
Headers
HTTP/1.1 400 INVALID-<field-name> Content-Type: text/plain
where <field-name> is one of
Body
Validation error specific to the error in the field
Headers
HTTP/1.1 404 <object-type>-NOT-FOUND
where <object-type> can be one of
Headers
HTTP/1.1 500 ERROR Content-Type: text/plain
Body
Sample error message
API call
GET https://tfy.tech101.in/api/v1/trips
Headers
Authorization: Bearer user-token
Headers
HTTP/1.1 200 OK
Body
[ { "id": "uuid-of-trip", "truck": { "id": "uuid-of-truck", "registration": "registration-number" }, "source":{ "date": "YYYY-MM-DD, date when truck leaves source", "city": { "id": "uuid-of-city", "name": "name-of-city" }, }, "destination": { "date": "YYYY-MM-DD, date when truck reaches destination", "city": { "id": "uuid-of-city", "name": "name-of-city" } } }, { ... more trips ... } ]
Headers
HTTP/1.1 204 DONE
Headers
HTTP/1.1 401 INVALID-TOKEN
Headers
HTTP/1.1 403 FORBIDDEN
Headers
HTTP/1.1 500 ERROR Content-Type: text/plain
Body
Sample error message