Skip to content

Travelyaari Search Bus API

SoumyaSian edited this page Oct 28, 2017 · 14 revisions

1.2 Search Bus

Intent

search_bus

Request Params Description

KEYWORD DESCRIPTION
FROM_CITY_ID Travelyaari ID for from city
TO_CITY_ID Travelyaari ID for to city
JOURNEYDATE Date of journey

Payload

{
     "fromCityId": $FROM_CITY_ID,
     "toCityId" :$TO_CITY_ID,
     "journeyDate" : "$JOURNEYDATE"
}

Response Params Description

KEY DESCRIPTION
NON_REFUNDABLE True or False (True represents ticket amount is non refundable)
COMPANY_ID Travelyaari ID for the bus company
ROUTE_BUS_ID Travelyaari ID for the bus
BUS_TYPE Type of the bus
BUS_TYPE.AXLE Type of the axle
BUS_TYPE.AXEL Type of the axel
BUS_TYPE.IS_AC True or false ( True represents AC bus )
BUS_TYPE.MAKE Make type of the bus
BUS_TYPE.AXEL Type of the axel
PICKUPS Object gives the information of about the pickups
PICKUPS.PICKUP_TIME Time of the pickup
PICKUPS.PICKUP_AREA Area/Location of the pickup
PICKUPS.PICKUP_NAME Name of the pickup place
PICKUPS.PICKUP_CODE Unique code for the pickup place
DROPOFFS Object gives the information of about the dropoffs
DROPOFFS.DROP_OFF_NAME Name of the destination
DROPOFFS.DROP_OFF_TIME Time to reach destination
DROPOFFS.DROP_OFF_CODE Code of destination
AMENITIES Array of available code of the amenities which will be mapped with amenities given
BUS_STATUS Object with seats available , base fare etc
BUS_STATUS.AVAILABILITY Available seats in the bus
BUS_STATUS.BASE_FARES Array of bus fares
DISPLAY_BUS_TYPE Type of the bus (Ex: seater, AC etc)
DISCOUNT_AMT Amount could be dicountable
COMPANY_SUFFIX Short name of the bus company
TO_NAME Destination
FROM_NAME Origin
TO_NAME Destination
CHART_CODE Chart code of the destination
DURATION Duration of the journey
BUS_LABEL Label of the bus
COMPANY_NAME Name of the bus company
ARRIVAL_TIME Arrival time of the bus to the destination
DEPARTURE_TIME Departure time of the from the origin
TRIP_ID Travelyaari ID for the trip

Response Body

{
        "buses": [
            {
                "NonRefundable": $NON_REFUNDABLE,
                "MTicket": true,
                "CompanyId": $COMPANY_ID,
                "ProvCompId": $PROV_COMP_ID,
                "ProvId": $PROV_ID,
                "RouteBusId": $ROUTE_BUS_ID,
                "BusType": {
                    "IsAC": "$IS_AC",
                    "Seating": "$SEATING",
                    "Make": "$MAKE",
                    "Axle": "$AXLE",
                    "Axel": "$AXEL"
                },
                "Pickups": [
                    {
                        "PickupTime": "$PICKUP_TIME",
                        "PickupArea": "$PICKUP_AREA",
                        "PickupName": "$PICKUP_NAME",
                        "PickupCode": "$PICKUP_CODE"
                    }...,               
                ],
                "Dropoffs": [
                    {
                        "DropoffTime": "$DROP_OFF_TIME",
                        "DropoffName": "$DROP_OFF_NAME",
                        "DropoffCode": "$DROP_OFF_CODE"
                    } ...,
                ],
                "Canc": [
                    {
                        "Amt": 0,
                        "Pct": 100,
                        "Mins": 0
                    }
                ],
                "Amenities": [$AMENITIES],
                "BusStatus": {
                    "Availability": $AVAILABILITY,
                    "RouteBusId": $ROUTE_BUS_ID,
                    "BaseFares": [$BASE_FARES],
                    "TotalTax": $TOTAL_MAX
                },
                "DisplayBusType": "$DISPLAY_BUS_TYPE",
                "Visibility": true,
                "CommPct": 10,
                "DiscountAmt": $DISCOUNT_AMT,
                "CompanySuffix": "$COMPANY_SUFFIX",
                "ToName": "$TO_NAME",
                "FromName": "$FROM_NAME",
                "ChartCode": "$CHART_CODE",
                "Duration": "$DURATION",
                "BusLabel": "$BUS_LABEL",
                "CompanyName": "$COMPANY_NAME",
                "ArrTime": "$ARRIVAL_TIME",
                "DeptTime": "$DEPARTURE_TIME",
                "TripId": "$TRIP_ID"
            }
        ],
        "amenities": [$AMENITIES]
    }

Error messages

Some error messages, you might get for an invalid search request. The HTTP response code in this case will be 400.

Status Error message Description
400 fromId is missing From Id is not passed in the request
400 fromId is missing To Id is not passed in the request
400 journeyDate is missing Journey date is not passed in the request
Clone this wiki locally