# 获取店铺信息(获取店铺 id 及店铺名)
接口地址: http://www.damaijia168.com/vv/external/pddShopInfo
请求方式: GET
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| item_id | string | 是 | 商品 id |
# 请求示例
{
"item_id": "143176280967"
}
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://test.damaijia168.com/vv/external/pddShopInfo' \
--header 'Authorization: f38e89384ea1e8ee1bcxxxxxxx' \
--form 'item_id="143176280967"'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://test.damaijia168.com/vv/external/pddShopInfo',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('item_id' => '143176280967'),
CURLOPT_HTTPHEADER => array(
'Authorization: f38e89384ea1e8ee1bcxxxxxxx'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
JAVA请求代码示例
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("item_id","143176280967")
.build();
Request request = new Request.Builder()
.url("http://test.damaijia168.com/vv/external/pddShopInfo")
.method("POST", body)
.addHeader("Authorization", "f38e89384ea1e8ee1bcxxxxxxx")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
url = "http://test.damaijia168.com/vv/external/pddShopInfo"
payload={'item_id': '143176280967'}
files=[
]
headers = {
'Authorization': 'f38e89384ea1e8ee1bcxxxxxxx'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| --item_id | string | 商品id |
| --title | string | 商品标题 |
| --images | string | 图片地址 |
| --owner_id | string | 店铺 id(店铺 owner_id) |
| --shop_name | string | 店铺名字 |
| --deduct_money | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data":{
"item_id":"143176280967",
"title":"好东西好东西",
"images":"http://img.alicdn.com/imgextra/i3/618895543/o2con1ny_kh_j41qok2h0gt90_!!618898843.jpg",
"owner_id":"77896215",
"shop_name":"小铃铛店铺",
"deduct_money": 1
},
"status": 0
}
# 错误码
| 状态码(status) | 错误信息 | 解决方案 |
|---|---|---|
| 132 | 请求格式必须为JSON | 修改请求参数格式为json |
| 422 | 参数列表不合法,在err中会给出提示 | 根据提示做相应修改 |
| 200 | 认证失败 | 请确保请求头里的Authorization存在或者未过期 |