获取审批单详情V2

接口描述

商旅审批单创建接口调用成功后,系统会生成一系列的临时用车规则,比如北京的送机、上海的接机、上海的市内用车、机票、酒店等等。
通过审批单创建接口返回的审批单号调用该接口可以得到这些临时规则的详细信息,以便调起滴滴用车H5页

请求地址

https://api.es.xiaojukeji.com/api-gateway/Approval/detail

返回数据格式

JSON

请求类型

GET

请求参数

参数名称 数据类型 必选 说明
client_id string yes 申请应用时分配的client_id
access_token string yes 授权后的access token
timestamp bigint yes 当前时间戳(精确到秒)
company_id string yes 企业ID
approval_id string yes 审批单号
sign string yes 签名

请求示例

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \
https://api.es.xiaojukeji.com/river/Approval/detail?client_id=client_id_test&access_token=access_token_test&timestamp=1566764837&approval_id=781948394919012&company_id=12345678980&=sign=fba8dfb887afe16cb71c50b26a5eae0e

返回参数说明

参数名称 数据类型 说明
errno int 审批单ID
errmsg string 成功时返回"SUCCESS",失败返回相应的错误信息
data object 审批单对应的规则
data中元素的结构
参数名称 数据类型 说明
approval_id string 审批单id
out_approval_id string 企业内部审批单ID
approval_type int 审批单类型(1-差旅 travel、2-商务出行 business trip按次数、3-商务出行 business trip按日期)
type int 费用归属的成本中心类型(0未填写,1部门,2项目)
budget_center_id string 费用归属部门/项目的id
reason string 申请原因
extra_info json 扩展信息,自定义字段
start_date string 行程开始日期,如2017-01-10
end_date string 行程结束日期,如2017-02-01
approval_status int 审批单状态:
0:待审批
1:审批中
2:已驳回
3:已通过
4:取消申请
6:已失效
7:审批通过后取消
8:审批通过,未到可用时间
scene_id string 用车场景id(101差旅;102行前审批)
city_type int 差旅城市是否需填写,0: 无需填写,不限城市,1: 需填写城市,无需填写具体出行时间 2: 需填写城市,需填写具体出行时间
car_rule []object 用车规则
hotel_rule []object 酒店规则
flight_rule []object 机票规则
train_rule []object 火车票规则
car_rule 中元素的结构
参数名称 数据类型 说明
rule_id string 规则id
rule_name string 规则名称
rule_status int 规则状态(0正常;1删除;2停用;3已过期;4旧版本)
city_id int 城市id
city_name string 城市名称
use_scene int 使用类型(0市内用车;1接机/站;2送机/站,4火车,6机票,10酒店)
total_count int 用车总次数,单位:次,负数表示不限总次数
available_count int 剩余用车次数,单位:次,剩余次数=总次数-待支付订单-已支付订单
total_money int 用车总额度,单位:分
available_money int 剩余用车额度,单位:分,剩余额度=总额度-待支付订单-已支付订单
perorder_money int 用车每单限额,单位:分
start_time string 规则开始时间(格式:2020-10-01 00:00:00)
end_time string 规则结束时间(格式:2020-10-05 12:00:00)
酒店规则 hotel_rule 中元素的结构
参数名称 数据类型 说明
rule_id string 规则id
rule_name string 规则名称
rule_status int 规则状态(0正常;1删除;2停用;3已过期;4旧版本)
city_list []object [{"id":"1","name":"北京"},{"id":"41","name":"呼和浩特"}]
total_count int 酒店总次数
available_count int 剩余次数,剩余次数=总次数-待支付订单-已支付订单
start_time string 规则开始时间(格式:2020-10-01 00:00:00)
end_time string 规则结束时间(格式:2020-10-05 12:00:00)
机票规则 flight_rule 中元素的结构
参数名称 数据类型 说明
rule_id string 规则id
rule_name string 规则名称
rule_status int 规则状态(0正常;1删除;2停用;3已过期;4旧版本)
city_line []object [{"start_id":"1","start_name":"北京","end_id":"41","end_name":"呼和浩特"},{"start_id":"41","start_name":"呼和浩特","end_id":"4","end_name":"上海"}]
total_count int 机票总次数
available_count int 剩余次数,剩余次数=总次数-待支付订单-已支付订单
start_time string 规则开始时间(格式:2020-10-01 00:00:00)
end_time string 规则结束时间(格式:2020-10-05 12:00:00)
火车票规则 flight_rule 中元素的结构
参数名称 数据类型 说明
rule_id string 规则id
rule_name string 规则名称
rule_status int 规则状态(0正常;1删除;2停用;3已过期;4旧版本)
city_line []object [{"start_id":"1","start_name":"北京","end_id":"41","end_name":"呼和浩特"},{"start_id":"41","start_name":"呼和浩特","end_id":"4","end_name":"上海"}]
total_count int 火车票总次数
available_count int 剩余次数,剩余次数=总次数-待支付订单-已支付订单
start_time string 规则开始时间(格式:2020-10-01 00:00:00)
end_time string 规则结束时间(格式:2020-10-05 12:00:00)

返回示例

成功返回值

{
    "errno":0,
    "errmsg":"SUCCESS",
    "data":{
        "approval_id":"1125914483602387",
        "out_approval_id":"",
        "approval_type":1,
        "type":0,
        "budget_center_id":"0",
        "reason":"",
        "extra_info":"",
        "start_date":"1646064000",
        "end_date":"1648828799",
        "approval_status":9,
        "scene_id":101,
        "city_type":1,
        "car_rule":[
            {
                "rule_id":"1125914399308869",
                "rule_name":"出发·前往机场/车站",
                "rule_status":"0",
                "city_id":1,
                "city_name":"北京",
                "use_scene":"2",
                "total_count":1,
                "available_count":1,
                "total_money":0,
                "available_money":0,
                "perorder_money":0,
                "start_time":"1646064000",
                "end_time":"1648828799"
            },
            {
                "rule_id":"1125914399313388",
                "rule_name":"到达·离开机场/车站",
                "rule_status":"0",
                "city_id":41,
                "city_name":"呼和浩特",
                "use_scene":"1",
                "total_count":1,
                "available_count":1,
                "total_money":0,
                "available_money":0,
                "perorder_money":0,
                "start_time":"1646064000",
                "end_time":"1648828799"
            },
            {
                "rule_id":"1125914399314222",
                "rule_name":"市内用车",
                "rule_status":"0",
                "city_id":41,
                "city_name":"呼和浩特",
                "use_scene":"0",
                "total_count":0,
                "available_count":0,
                "total_money":0,
                "available_money":0,
                "perorder_money":0,
                "start_time":"1646064000",
                "end_time":"1648828799"
            },
            {
                "rule_id":"1125914399323106",
                "rule_name":"出发·前往机场/车站",
                "rule_status":"0",
                "city_id":41,
                "city_name":"呼和浩特",
                "use_scene":"2",
                "total_count":1,
                "available_count":1,
                "total_money":0,
                "available_money":0,
                "perorder_money":0,
                "start_time":"1646064000",
                "end_time":"1648828799"
            },
            {
                "rule_id":"1125914399281943",
                "rule_name":"到达·离开机场/车站",
                "rule_status":"0",
                "city_id":4,
                "city_name":"上海",
                "use_scene":"1",
                "total_count":1,
                "available_count":1,
                "total_money":0,
                "available_money":0,
                "perorder_money":0,
                "start_time":"1646064000",
                "end_time":"1648828799"
            },
            {
                "rule_id":"1125914399290727",
                "rule_name":"市内用车",
                "rule_status":"0",
                "city_id":4,
                "city_name":"上海",
                "use_scene":"0",
                "total_count":0,
                "available_count":0,
                "total_money":0,
                "available_money":0,
                "perorder_money":0,
                "start_time":"1646064000",
                "end_time":"1648828799"
            }
        ],
        "hotel_rule":[
            {
                "rule_id":"1125914399309491",
                "rule_name":"预订酒店",
                "rule_status":"0",
                "total_count":1,
                "available_count":0,
                "start_time":"1646064000",
                "end_time":"1648828799",
                "city_list":[
                    {
                        "id":"1",
                        "name":"北京"
                    },
                    {
                        "id":"41",
                        "name":"呼和浩特"
                    },
                    {
                        "id":"4",
                        "name":"上海"
                    }
                ]
            }
        ],
        "flight_rule":[
            {
                "rule_id":"1125914399323114",
                "rule_name":"预订机票",
                "rule_status":"0",
                "total_count":10,
                "available_count":10,
                "start_time":"1645891200",
                "end_time":"1649001599",
                "city_line":[
                    {
                        "start_id":"1",
                        "start_name":"北京",
                        "end_id":"41",
                        "end_name":"呼和浩特"
                    },
                    {
                        "start_id":"41",
                        "start_name":"呼和浩特",
                        "end_id":"4",
                        "end_name":"上海"
                    }
                ]
            }
        ],
        "train_rule":[
            {
                "rule_id":"1125914399295420",
                "rule_name":"预订火车",
                "rule_status":"0",
                "total_count":1,
                "available_count":1,
                "start_time":"1646064000",
                "end_time":"1648828799",
                "city_line":[
                    {
                        "start_id":"1",
                        "start_name":"北京",
                        "end_id":"41",
                        "end_name":"呼和浩特"
                    },
                    {
                        "start_id":"41",
                        "start_name":"呼和浩特",
                        "end_id":"4",
                        "end_name":"上海"
                    }
                ]
            }
        ]
    }
}

失败返回值

{
    "errno":50505,
    "errmsg":"获取审批单信息失败(未获取到规则id集合,请检查审批单id)",
    "data": null
}

接口错误解决方案

通用错误解决文档

  1. 4xx 错误
  2. 1xxx 错误

50505(获取审批单信息失败(未获取到规则id集合,请检查审批单id))

审批单号可能不存在

results matching ""

    No results matching ""