文档中心 > API类目 > 属性类型API

dsc.goodstype.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

请求参数

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

响应参数

名称 类型 示例值 描述
attr_id Number 属性ID
cat_id Number 属性类型ID
attr_name String 属性名称
attr_cat_type Number 分类筛选样式
attr_input_type Number 该属性值的录入方式
attr_type Number 属性是否可选
attr_values Text 可选值列表
attr_index Number 能否进行检索
sort_order Number 排序
is_linked Number 相同属性值的商品是否关联

请求示例

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

响应示例

  • XML
  • JSON
<dsc>
<info>
<cat_id>1</cat_id>
<attr_name>颜色</attr_name>
<attr_cat_type>1</attr_cat_type>
<attr_input_type>1</attr_input_type>
<attr_type>1</attr_type>
<attr_values>白色 灰色 黑色 红色 绿色 蓝色 紫色 深兰色</attr_values>
<attr_index>0</attr_index>
<sort_order>0</sort_order>
<is_linked>0</is_linked>
</info>
</dsc>
{
"info": {
"cat_id": "1",
"attr_name": "颜色",
"attr_cat_type": "1",
"attr_input_type": "1",
"attr_type": "1",
"attr_values": "白色 灰色 黑色 红色 绿色 蓝色 紫色 深兰色",
"attr_index": "0",
"sort_order": "0",
"is_linked": "0",
}
}

异常示例

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

错误码解释

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

0:成功获取数据

1:数据为空值

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

返回
顶部