dsc.goods.gallery.info.get (获取单条商品相册信息API)

获取单条商品相册信息API,获取商品相册相关信息。

公共参数

请求地址:
环境 HTTP请求地址 HTTPS请求地址
正式环境 http://www.xxx.com/api.php https://www.xxx.com/api.php
公共请求参数:
名称 类型 是否必须 描述
method String API接口名称
app_key String API接口AppKey

请求参数

名称 类型 是否必须 示例值 更多限制 描述
img_id Number 可选 (唯一性) 商品相册ID
format type 必须 json json或xml 接口类型

响应参数

名称 类型 示例值 描述
img_id Number 相册ID
goods_id Number 商品ID
img_url String 相册图片
img_desc Number 相册排序
thumb_url String 相册图片缩略图
img_original String 相册图片原图
external_url String 相册外链地址

请求示例

  • PHP
$url="http(s)://www.xxx.com/api.php?app_key=A788F457-1A7D-4CC7-ABA0-BFE212BCCD9A&method=dsc.goods.gallery.info.get&img_id=1&format=xml"
$Http = new Http();
$Http->doGet($url);

响应示例

  • XML
  • JSON
<dsc>
<info>
<img_id>1</img_id>
<goods_id>2</goods_id>
<img_url>images/201407/goods_img/1_P_1404770700378.jpg</img_url>
<img_desc>0</img_desc>
<thumb_url>images/201407/thumb_img/1_thumb_P_1404770700713.jpg</thumb_url>
<img_original>images/201407/source_img/1_P_1404770700644.jpg</img_original>
</info>
</dsc>
{
"info": {
"img_id": "1",
"goods_id": "2",
"img_url": "images/201407/goods_img/1_P_1404770700378.jpg",
"img_desc": "0",
"thumb_url": "images/201407/thumb_img/1_thumb_P_1404770700713.jpg",
"img_original": "images/201407/source_img/1_P_1404770700644.jpg",
}
}

异常示例

  • XML
  • JSON
<dsc>
<result>success</result>
<error>0</error>
<msg>成功获取数据</msg>
</dsc>
{
"result": "success",
"error": 0,
"msg": "成功获取数据",
}

错误码解释

错误码 错误描述 解决方案
error 返回值

0:成功获取数据

1:数据为空值

2:条件为空或参数不存在

返回
顶部