数据校验API
更新时间:2022-05-18
数据校验工具【FOR 商户】
注:校验时请严格遵守上述接口协议规则,非必传字段可按参数类型将value置空
功能:校验不同场景下商户侧推送数据是否符合百度接入规范。
接口地址:
https://maphotel.baidu.com/map_mc/mc/tpcheckdata
method: http post
查询请求参数:
字段名 | 类型 | 必填 | 释义 | |
---|---|---|---|---|
1 | tp_name | string | 是 | tp名称 |
2 | timestamp | string | 是 | 时间戳 |
3 | salt | string | 是 | 随机数 |
4 | sign | string | 是 | 签名 |
5 | check_type | string | 是 | 关注check_type参数释义 |
6 | check_data | string | 是 | JSON类型,将待校验的数据 按照 {"form_name": "实际值"}打包请求 |
校验接口返回样例:
字段标签 | 字段名称 | 字段说明 | |
---|---|---|---|
1 | errno | 错误码 | 0:成功;1007:失败 |
2 | errstr | 具体错误描述 | |
3 | desc | 描述 | 操作成功或系统错误(失败) |
工具查询样例(以酒店基础数据【商户即时推送百度】为例):
{
"content":{
"tp_name":"xiecheng",
"timestamp":1630128216,
"salt":"1234",
"sign":"77a82e37e7288578c408742e31db45cf",
"content":{
"detail":{
"basic":{
"tid":"369673",
"poi_name":"北京歌华开元大酒店",
"poi_address":"北京市朝阳区北三环鼓楼外大街19号",
"latitude":"39.971402",
"longitude":"116.400311",
"city":"北京",
"tel":"18360297082",
"status":1
},
"everyday_lowest_price":{
"2022-04-22":{
"room_type_name":"双创房",
"price":88
},
"2022-04-23":{
"room_type_name":"双床房",
"price":88
}
},
"detail_info":{
"hotel":{
"info":{
"overall_rating":4.5,
"service_rating":4.5,
"category":"其他",
"aoi":"森林湿地公园",
"price":"",
"business_state":"正常营业",
"source_url":"",
"source_url_mobile":"",
"brand":"",
"hygiene_rating":4.5,
"facility_rating":4.5,
"level":6,
"inner_facility":"床具:毯子或被子 公用区wifi 空调 手动窗帘",
"hotel_facility":"",
"hotel_service":"行李寄存 叫醒服务 24小时前台 免费停车场",
"checkin_policy":"",
"hotel_type":"其它",
"open_year":"2018-05-01",
"environment_exterior":"森林湿地公园;鸽子窝公园;老虎石海上公园",
"hotel_flag":"1",
"id":"ctrip_2328835",
"short_comm":"酒店周边的环境很好,有一大片树林,空气好",
"reservation_call":"95010",
"reservation_url":"https:\/\/hotels.ctrip.com\/hotel\/2328835.html?allianceid=20407%26amp;sid=451676%26amp;utm_source=baidu%26amp;utm_medium=referral%26amp;utm_campaign=baidumaphotel",
"county":"{root.hotelStaticInfo.hotelLocation.locationName}",
"hotel_introduction":"北戴河望汐·乐园酒店坐落于森林湿地公园,不论您是商务出差还是休闲旅游酒店都是理想的下榻之处。",
"comment_all_num":40,
"comment_yes_num":"",
"comment_no_num":"",
"comment_url":"https:\/\/hotels.ctrip.com\/hotel\/dianping\/2328835.html?Allianceid=20407%26amp;sid=451676%26amp;utm_source=baidu%26amp;utm_medium=referral%26amp;utm_campaign=baidumaphotel",
"reservation_url_mobile":"http:\/\/m.ctrip.com\/webapp\/Hotel\/HotelDetail\/2328835.html?Allianceid=20407%26amp;sid=451948%26amp;sourceid=1606",
"discount_url_mobile":"http:\/\/m.ctrip.com\/webapp\/Hotel\/HotelDetail\/2328835.html?Allianceid=20407%26amp;sid=451948%26amp;sourceid=1606",
"comment_url_mobile":"http:\/\/m.ctrip.com\/webapp\/Hotel\/HotelDetail\/2328835.html?Allianceid=20407%26amp;sid=451948%26amp;sourceid=1606"
},
"indentify":"hotel"
},
"hotelcomment":{
"info":{
"comment_num":40,
"comment_all_num":40,
"comment_yes_num":"",
"comment_no_num":"",
"comment_url":"https:\/\/hotels.ctrip.com\/hotel\/dianping\/2328835.html?Allianceid=20407%26amp;sid=451676%26amp;utm_source=baidu%26amp;utm_medium=referral%26amp;utm_campaign=baidumaphotel",
"comment_url_mobile":"http:\/\/m.ctrip.com\/webapp\/Hotel\/HotelDetail\/2328835.html?Allianceid=20407%26amp;sid=451948%26amp;sourceid=1606",
"comment":[
{
"content":"酒店周边的环境很好,有一大片树林,空气好,安静",
"date":"2021-06-02",
"one_url":"https:\/\/hotels.ctrip.com\/hotel\/dianping\/2328835.html?Allianceid=20407%26amp;sid=451676%26amp;utm_source=baidu%26amp;utm_medium=referral%26amp;utm_campaign=baidumaphotel",
"user_name":"携程用户",
"user_logo":"https:\/\/hotel-pic.cdn.bcebos.com\/ctrip\/xiechenglvxinglogo180180_ec9348808cfce46fc62899e4f469b65c.jpg",
"nick_user_recommend":"1",
"overall_rating":"5",
"comment_photo":[
{
"pic_url":"https:\/\/hotel-pic.cdn.bcebos.com\/ctrip\/230j170000010v1uzA7C5_R_550_412_12ab570d43f3fe6d7fb33d6a4f2eb681.jpg"
}
],
"timestamp":1622563200
}
]
},
"indentify":"hotelcomment"
},
"hotelphoto":{
"info":{
"photo_exterior":[
{
"img_url":"https:\/\/hotel-pic.cdn.bcebos.com\/ctrip\/200r0t000000ihp26075B_R_1080_540_29d12a27759e2e83a608d6f2bdb1565e.jpg",
"photo_url_mobilephone":"https:\/\/hotel-pic.cdn.bcebos.com\/ctrip\/200r0t000000ihp26075B_R_1280_720_ce71b14df54df200619112b66c8bfe43.jpg",
"photo_score":10000,
"photo_type":"头图",
"photo_tag":"酒店图片",
"photo_room_id":"",
"photo_room_name":"",
"photo_room_tag":"",
"src":"ctrip"
}
],
"photo_exterior_num":6,
"photo_num":6,
"photo_url":"=https:\/\/hotels.ctrip.com\/pic\/2328835.html?Allianceid=20407%26amp;sid=451676%26amp;utm_source=baidu%26amp;utm_medium=referral%26amp;utm_campaign=baidumaphotel"
},
"indentify":"hotelphoto"
}
},
"extends_id":[
{
"src":"ctrip",
"tid":"5213524",
"confidence":100
},
{
"src":"elong",
"tid":"5123524",
"confidence":100
},
{
"src":"qunar",
"tid":"1233424",
"confidence":100
}
]
}
}
}
}
校验接口返回样例 (校验成功):
{
"errno": 0,
"errstr": "",
"desc": "操作成功",
"data": {},
"_logid": 1274323618
}
校验接口返回样例 (校验失败):
{
"errno": 1007,
"errstr": "[\"[start] Integer value found, but a string is required\\n\"]",
"desc": "校验失败",
"data": {},
"_logid": 1143605732
}
chenk_type释义目录:
校验场景 | 传参 |
---|---|
酒店基础数据[商户即时推送百度] | static_hotel |
酒店物理房型查询[百度天级查询商户] | house_hotel |
酒店房型/房态/房价变动通知[商户即时推送百度] | house_price_change_hotel |
酒店房态/房价查询[百度即时请求商户] | house_price_hotel |
酒店试单请求[百度即时请求商户] | trial_order |
自营填单页/预下单/预支付/库存锁定[百度即时请求商户] | put_order |
用户发票信息回传[百度即时请求商户] | invoice_order |
支付结果通知[百度->商户] | pay_return |
订单状态变更回传[商户->百度] | pay_order_update |
订单取消请求[百度->商户] | pay_cancel |
退款结果通知[百度->商户] | pay_refund |