获取店铺信息
商家授权以后,获取店铺信息。
1.请求参数:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
sign | String | 接口签名 | 如何计算生成见示例代码 |
sysid | String | 必填, 应用ID , 必填,不清楚咨询客服 | |
state_id | String | 必填, 与先前授权链接中的参数一样 |
2. 请求示例代码(Java)
@Test
public void getShopInfo() throws Exception {
String url ="https://kf.fw199.com/gateway/partner/getshopinfo";
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost( url );
//业务参数
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("sysid", "101");
data.put("state_id", "abc1322232200");
// 参数签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
for (Map.Entry<String, String> entry : data.entrySet()) {
params.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
//发起POST请求
try {
httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
HttpResponse httpResponse = httpclient.execute(httpPost);
if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
result = EntityUtils.toString(httpResponse.getEntity());
} else {
result = ("doPost Error Response: " + httpResponse.getStatusLine().toString());
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(result);
3. 返回结果如下:
{
"code": 0,
"message": "ok",
"data": {
"sys_id": "101",
"seller_nick": "xxxxx",
"dead_line": "2025-10-05 00:00:00",
"state_id": "888777"
},
"trace_id": ""
}
说明: code为0表示成功,非0为失败,message会包含失败原因。
文档更新时间: 2025-09-05 16:21 作者:admin