查询快递地址是否可达
查询快递地址是否可达 支持的地址类型:
0、发货地址+收货地址
1、发货地址
2、收货地址
1.请求参数:
请求URL:
POST https://kf.fw199.com/gateway/ks/express/reachable/query
参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
---|---|---|---|---|
appid | String | 是 | 合作伙伴AppId | |
timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
seller_nick | String | 是 | 38173182 | 快手的店铺账号,对应蜂巢授权返回seller_nick字段 |
sign | String | 是 |
业务参数
参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
---|---|---|---|---|
request_data | json | 是 | 要查询地址集合, 一次不超过50个 |
取号业务报文参数request_data示例json
[
{
"requestId": "1000",
"expressCompanyCode": "ZTO",
"type": 0,
"senderAddress": {
"provinceName": "浙江省",
"cityName": "杭州市",
"districtName": "余杭区",
"detailAddress": "闲兴路3号"
},
"receiverAddress": {
"provinceName": "上海",
"cityName": "上海市",
"districtName": "浦东新区",
"detailAddress": "东方路100号"
}
},
{
"requestId": "2000",
"expressCompanyCode": "SF",
"type": 0,
"senderAddress": {
"provinceName": "浙江省",
"cityName": "宁波市",
"districtName": "海曙区",
"detailAddress": "西北街41号"
},
"receiverAddress": {
"provinceName": "青海省",
"cityName": "西宁市",
"districtName": "城东区",
"detailAddress": "共和路2号"
}
}
]
2. 请求示例代码(Java)
@Test
public void ExpressReachableQuery() throws Exception {
String sellerNick = Config.KSSellerNick ;
//业务参
Map<String, String> data = new HashMap();
data.put("appid", Config.AppId);
data.put("seller_nick", sellerNick);
Long timestamp = System.currentTimeMillis();
data.put("timestamp", timestamp.toString());
String reqData = "[\n" +
" {\n" +
" \"requestId\": \"1000\",\n" +
" \"expressCompanyCode\": \"ZTO\",\n" +
" \"type\": 0,\n" +
" \"senderAddress\": {\n" +
" \n" +
" \"provinceName\": \"浙江省\", \n" +
" \"cityName\": \"杭州市\", \n" +
" \"districtName\": \"余杭区\", \n" +
" \"detailAddress\": \"闲兴路3号\"\n" +
" },\n" +
" \"receiverAddress\": { \n" +
" \"provinceName\": \"上海\", \n" +
" \"cityName\": \"上海市\", \n" +
" \"districtName\": \"浦东新区\", \n" +
" \"detailAddress\": \"东方路100号\"\n" +
" } \n" +
" },\n" +
" {\n" +
" \"requestId\": \"2000\",\n" +
" \"expressCompanyCode\": \"SF\",\n" +
" \"type\": 0,\n" +
" \"senderAddress\": {\n" +
" \n" +
" \"provinceName\": \"浙江省\", \n" +
" \"cityName\": \"宁波市\", \n" +
" \"districtName\": \"海曙区\", \n" +
" \"detailAddress\": \"西北街41号\"\n" +
" },\n" +
" \"receiverAddress\": { \n" +
" \"provinceName\": \"青海省\", \n" +
" \"cityName\": \"西宁市\", \n" +
" \"districtName\": \"城东区\", \n" +
" \"detailAddress\": \"共和路2号\"\n" +
" } \n" +
" }\n" +
" ]";
data.put("request_data",reqData);
// 参数签名
data.put("sign", Utils.Sign(data, Config.AppSecret));
String result = doHttpRequest(Config.KS_OPEN_EXPRESS_REACHABLE_QUERY, data);
System.out.println("result:"+result);
}
3. 返回结果
返回结果如下
{
"code": 0,
"message": "ok",
"data": [
{
"reachable": true,
"requestId": "1000",
"code": 0,
"message": ""
},
{
"reachable": true,
"requestId": "2000",
"code": 0,
"message": ""
}
]
}
返回code为0表示成功, 非0为失败,失败时message会有失败原因。requestId会原样返回,reachable为true表示可达。
文档更新时间: 2023-06-27 00:07 作者:admin