地址智能解析
在电商平台,用户可能输入的地址信息不规范,通过本接口可以智能解析收件信息中的省、市、区县、收件地址、姓名、电话、邮编、身份证号等。
1.请求参数:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
request_data | json | 需要解析的地址信息,这是一个集合,一次最多不超过20条 | |
sign | String | 接口签名 | 如何计算生成见示例代码 |
request_data的详细说明
参数名 | 类型 | 说明 |
---|---|---|
object_id | String | 必填 , 本次请求唯一,用于分区哪条地址,由开发者自行生成传入,字符和数字都可以允许, 蜂巢原样返回 |
resolve_address | String | 必填, 需要解析的地址 |
request_data的json示例, 最多一次20条。
[{
"object_id": "001",
"resolve_address": "袁月青 131 7622 8763 四川省成都市高新西区百叶路1号电子科技大学成都学院计算机(分院)"
}, {
"object_id": "002",
"resolve_address": "深圳市盐田区万科东海岸21-102,收件人:叶侠,电话:131 7622 8764"
}, {
"object_id": "003",
"resolve_address": "江西南昌市青山湖区广兰大道418号东华理工大学核工系南区9栋1112室 13176228768 孙东明"
}, {
"object_id": "004",
"resolve_address": "陈思燕 17694800022 610726199307251717广东省梅州市蕉岭县邹邹路5803号邹邹小区8单元22403室"
}, {
"object_id": "005",
"resolve_address": "盐田区山海四季城F栋1B,卢燕13129871122"
}, {
"object_id": "006",
"resolve_address": "2106632881250832143袁月青 1317628763 河南省开封市兰考县车站路济阳学校对面"
}, {
"object_id": "007",
"resolve_address": "210913-221438288790278 袁月青1317628763河南省开封市兰考县车站路济阳学校对面"
}]
2. 请求示例代码(Java)
@Test
public void addrResolve() throws Exception {
String requestData = "[{" +
" \"object_id\": \"001\"," +
" \"resolve_address\": \"袁月青 131 7622 8763 四川省成都市高新西区百叶路1号电子科技大学成都学院计算机(分院)\"" +
" }," +
" {" +
" \"object_id\": \"002\"," +
" \"resolve_address\": \"深圳市盐田区万科东海岸21-102,收件人:叶侠,电话:131 7622 8764\"" +
" }," +
" {" +
" \"object_id\": \"003\"," +
" \"resolve_address\": \"江西南昌市青山湖区广兰大道418号东华理工大学核工系南区9栋1112室 13176228768 孙东明\"" +
" }," +
" {" +
" \"object_id\": \"004\"," +
" \"resolve_address\": \"陈思燕 17694800022 610726199307251717广东省梅州市蕉岭县邹邹路5803号邹邹小区8单元22403室\"" +
" }, " +
" {" +
" \"object_id\": \"005\"," +
" \"resolve_address\": \"盐田区山海四季城F栋1B,卢燕13129871122\"" +
" }, " +
" {" +
" \"object_id\": \"006\"," +
" \"resolve_address\": \"2106632881250832143袁月青 1317628763 河南省开封市兰考县车站路济阳学校对面\"" +
" }, " +
" {" +
" \"object_id\": \"007\"," +
" \"resolve_address\": \"210913-221438288790278 袁月青1317628763河南省开封市兰考县车站路济阳学校对面\"" +
" } " +
"]";
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("request_data",requestData );
// 参数签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
doHttpRequest(Config.AddrResolveUrl, data);
}
3. 返回结果如下:
{
"code": 0,
"message": "ok",
"data": [{
"resolve_address": "袁月青 131 7622 8763 四川省成都市高新西区百叶路1号电子科技大学成都学院计算机(分院)",
"object_id": "001",
"result": {
"id_number": "",
"mobile": "13176228763",
"post_code": "0",
"name": "袁月青",
"province": "四川省",
"city": "成都市",
"region": "郫都区",
"town": "犀浦街道",
"street": "高新西区百叶路1号电子科技大学成都学院计算机分院"
}
}, {
"resolve_address": "深圳市盐田区万科东海岸21-102,收件人:叶侠,电话:131 7622 8764",
"object_id": "002",
"result": {
"id_number": "",
"mobile": "13176228764",
"post_code": "0",
"name": "叶侠",
"province": "广东省",
"city": "深圳市",
"region": "盐田区",
"town": "梅沙街道",
"street": "万科东海岸21-102"
}
}, {
"resolve_address": "江西南昌市青山湖区广兰大道418号东华理工大学核工系南区9栋1112室 13176228768 孙东明",
"object_id": "003",
"result": {
"id_number": "",
"mobile": "13176228768",
"post_code": "0",
"name": "孙东明",
"province": "江西省",
"city": "南昌市",
"region": "青山湖区",
"town": "蛟桥镇",
"street": "广兰大道418号东华理工大学核工系南区9栋1112室"
}
}, {
"resolve_address": "陈思燕 17694800022 610726199307251717广东省梅州市蕉岭县邹邹路5803号邹邹小区8单元22403室",
"object_id": "004",
"result": {
"id_number": "610726199307251717",
"mobile": "17694800022",
"post_code": "0",
"name": "陈思燕",
"province": "广东省",
"city": "梅州市",
"region": "蕉岭县",
"town": "蕉城镇",
"street": "邹邹路5803号邹邹小区8单元22403室"
}
}, {
"resolve_address": "盐田区山海四季城F栋1B,卢燕13129871122",
"object_id": "005",
"result": {
"id_number": "",
"mobile": "13129871122",
"post_code": "0",
"name": "卢燕",
"province": "广东省",
"city": "深圳市",
"region": "盐田区",
"town": "盐田街道",
"street": "山海四季城F栋1B"
}
}, {
"resolve_address": "2106632881250832143袁月青 1317628763 河南省开封市兰考县车站路济阳学校对面",
"object_id": "006",
"result": {
"id_number": "",
"mobile": "1317628763",
"post_code": "0",
"name": "袁月青",
"province": "河南省",
"city": "开封市",
"region": "兰考县",
"town": "城关镇",
"street": "车站路济阳学校对面"
}
}, {
"resolve_address": "210913-221438288790278 袁月青1317628763河南省开封市兰考县车站路济阳学校对面",
"object_id": "007",
"result": {
"id_number": "",
"mobile": "1317628763",
"post_code": "0",
"name": "袁月青",
"province": "河南省",
"city": "开封市",
"region": "兰考县",
"town": "城关镇",
"street": "车站路济阳学校对面"
}
}],
"trace_id": ""
}
说明: code为0表示成功,非0为失败,message会包含失败原因。
文档更新时间: 2023-03-14 17:06 作者:admin