蜂巢物流公司列表
获取蜂巢定义的启用状态物流公司主表列表
一、接口名称
接口路径:POST /gateway/logistics/company/list
请求方式:application/x-www-form-urlencoded
二、请求参数
| 字段 | 类型 | 说明 | 必需 |
|---|---|---|---|
| appid | string | 合作伙伴 AppId | 是 |
| timestamp | string | Unix 时间戳(秒) | 是 |
| sign | string | 请求签名,算法见接入指南 | 是 |
本接口无额外业务参数,仅需公共签名参数。
三、请求示例代码
Java
@Testpublic void logisticsCompanyList() throws Exception {
// 业务参 Map<String, String> data = new HashMap<>(); data.put("appid", Config.AppId); Long timestamp = System.currentTimeMillis() / 1000; data.put("timestamp", timestamp.toString()); // 参数签名 data.put("sign", Utils.Sign(data, Config.AppSecret));
String apiUrl = Config.GatewayUrl + "/logistics/company/list"; String result = doHttpRequest(apiUrl, data); System.out.println("result:" + result);}四、返回结果
{ "code": 0, "message": "ok", "data": [ { "company_code": "HTKY", "standard_name": "极兔快递", "official_name": "极兔速递" }, { "company_code": "SF", "standard_name": "顺丰快递", "official_name": "顺丰速运" }, { "company_code": "ZTO", "standard_name": "中通快递", "official_name": "中通快递" } ]}返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| code | number | 0 表示成功,非 0 表示失败 |
| message | string | 错误信息或 ok |
| data | array | 物流公司列表 |
| data[].company_code | string | 蜂巢内部统一编码,如 HTKY、SF、ZTO |
| data[].standard_name | string | 蜂巢标准名称,如 极兔快递、顺丰快递 |
| data[].official_name | string | 官方名称,如 极兔速递、顺丰速运 |