CloseTrip API

CloseTrip API

API to close a trip

Clients call this API to close a previously created trip. Either trip_id or feed_unique_id needs to be passed to close a trip. close_date_time should be passed in the UTC timestamp only.

API Endpoint:

Request Parameters:

Name

Type

Location

Description

Example

Name

Type

Location

Description

Example

Authorization

string

headers

JWT token required to authenticate API call.

Authorization: Bearer eyJhbGciOiJIUzI1Ni

Attributes:

FieldName

Data type

Description

Example

Mandatory

trip_id

Number

Trip id

512342

No

feed_unique_id

String

Feed unique Id

"632642-1564386538-584104"

No

close_date_time

Datetime

Closing time

"2019-08-12 13:00:00"

No

comment

String

Comment for future reference

"Trip close comment"

No

Request Body:

Example value:

{ "trip_id": 512342, "feed_unique_id": "632642-1564386538-584104", "close_date_time": "2019-08-12 13:00:00", "comment": "Trip close comment" }

Schema:

Either trip_id or feed_unique_id is mandatory for closing a trip

{ "trip_id":{ "description":"Trip id of the trip to be closed", "datatype":"integer", "example":512342, "mandatory":true }, "feed_unique_id":{ "description":"Feed Unique id of the trip to be closed", "datatype":"string", "example":"632642-1564386538-584104", "mandatory":false }, "close_date_time":{ "description":"date and time on trip closure", "datatype":"string", "example":"2019-08-12 13:00:00", "mandatory":true }, "comment":{ "description":"trip closure comment", "datatype":"string", "example":"Closing trip after speaking to driver", "mandatory":true },

Responses:

Status code 200 Trip closed successfully

{ "status": "true", "response": "Trip having trip_id - 9178849 is now closed." }

Status code 401 Bad Request - Auth failure

"UnAuthorized"

Status 422 Resource not found

{ "status": false, "response": "No trip found." }

Status code 422 Unprocessable entry

{ "status": false, "response": "Missing parameters feed_unique_id or trip_id" }

Status code 422 Unprocessable entry

{ "status": "false", "response": "Trip close time can not be less than trip created time." }

Status code 500 Internal server error - when server cannot process the payload and runtime error occurs

There could be multiple scenarios for errors. Most frequent errors are listed above.

Post your questions in the comment box to get answers from the experts who watch this page.

For engineering support: visit FT Support