班次查询

GetBusSchedules获取直通车线路的班次信息

接口说明

HTTPS请求方式:POST

url:https://www.qudali.com/OpenApi/GetBusSchedules

使用调试工具调试该接口
参数说明
参数 类型 长度 可空 描述
apiKey string 32 由官方平台提供的apiKey
bindProductId int 4 直通车套餐绑定的直通车Id,如果是直通车查询班次填写0。
busLineId int 4 线路Id
departId int 4 始发站点Id
arriveId int 4 目的站点Id
date datetime 班次日期,格式为"yyyy-MM-dd"
sign string 32

由apiSecret,与参数bindProductId、busLineId、departId、arriveId、date生成的待签名字符串,通过MD5签名运算后的值。

签名规则
返回说明

Json格式的Result对象

{
    "ErrorCode": 0,
    "Success": true,
    "Message": null,
    "HasException": false,
    "Value": {
        "BusRoutes": [
            {
                "ProductId": 5,
                "ProductName": "直通车+讲解券+熊猫门票",
                "DepartName": null,
                "ArriveId": 2,
                "ArriveName": null,
                "Price1": 80,
                "Price2": 54,
                "Price3": 25,
                "ElapsedTime": "45分钟",
                "Distance": "25公里",
                "IncludeFee": ...,
                "OrderIllustration": ...,
                "Remark": "",
                "Sections": [
                    {
                        "Id": 1,
                        "BusLineId": 1,
                        "DepartId": 1,
                        "ArriveId": 2,
                        "DepartName": "武侯祠/锦里",
                        "ArriveName": "熊猫繁育中心",
                        "Date": null,
                        "ElapsedTime": "45分钟",
                        "Distance": "25公里",
                        "Schedules": [
                            {
                                "Schedule": "09:30",
                                "Seats": 33,
                                "OccupiedSeats": 0
                            },
                            {
                                "Schedule": "11:30",
                                "Seats": 33,
                                "OccupiedSeats": 0
                            },
                            {
                                "Schedule": "14:30",
                                "Seats": 33,
                                "OccupiedSeats": 0
                            },
                            {
                                "Schedule": "16:30",
                                "Seats": 33,
                                "OccupiedSeats": 0
                            },
                            ...
                        ]
                    },
                    ...
                ]
            },
            ...
        ]}
    "Tag": null
}
返回值 描述
Success 本次调用是否成功
ErrorCode 错误代码
Message 失败时为异常信息,成功时为null
Value Json格式的ApiBusRouteSearchItem对象.请参考DEMO
Tag 如无特别说明,在返回数据带分页的情况下,Tag一般指查询记录的总条数,其它情况为null
对象说明

ApiBusRouteSearchItem对象:

public class ApiBusRouteSearchItem
{
    public ApiBusRouteSearchItem()
    {
        BusRoutes = new List<ApiBusRouteInfo>();
    }

    /// <summary>
    /// 这条线路下的所有产品
    /// </summary>
    public List<ApiBusRouteInfo> BusRoutes { get; set; }

    /// <summary>
    /// 线路ID
    /// </summary>
    public int BusLineId { get; set; }

    /// <summary>
    /// 行程日期
    /// </summary>
    public string Date { get; set; }

    /// <summary>
    /// 出发地Id
    /// </summary>
    public int DepartId { get; set; }

    /// <summary>
    /// 目的地Id
    /// </summary>
    public int ArriveId { get; set; }

    /// <summary>
    /// 出发地名称
    /// </summary>
    public string DepartName { get; set; }

    /// <summary>
    /// 目的地名称
    /// </summary>
    public string ArriveName { get; set; }

    /// <summary>
    /// 展示标题
    /// </summary>
    public string HeadTitle { get; set; }
}