产品发布规则获取接口

获取用户发布产品的规则

1.请求参数:

请求URL:

POST hhttps://kf.fw199.com/gateway/taobao/tmall/product/add/schema/get

参数名 类型 必须 示例值 说明
appid String true uwkahf@jfs92 合作伙伴AppId
timestamp String true 1633618722 当前时间戳
tb_seller_nick String true kingdo 淘宝卖家店铺登录账号,非店铺名称
sign String true 999de41d862efaa6f1084ead3b3ba480 如何计算生成见示例代码
category_id Number true 328818231125 商品发布的目标类目,必须是叶子类目
brand_id Number false 3232 品牌ID

2. 请求示例代码(Java)

      @Test
   public void TmallProductAddSchemaGetRequest() throws Exception {
        String tb_seller_nick = Config.TBSellerNick;
        //业务参数
        Map<String, String> data = new HashMap<String, String>();
        data.put("appid", Config.AppId);
        data.put("tb_seller_nick", tb_seller_nick);
        Long timestamp = System.currentTimeMillis() / 1000;
        data.put("timestamp", timestamp.toString());
        data.put("category_id", "201241307");
//        data.put("brand_id", "10000497"); 
        data.put("sign", Utils.Sign(data, Config.AppSecret));
        // 调用服务API
        String rsp =   doHttpRequest(Config.TmallProductAddSchemaGetRequestUrl, data);
        // 需要进行编码转换,比如 "\u003c" 转成  "<"   ,  "\u003e" 转成 ">" 等
        String unescapeRsp = StringEscapeUtils.unescapeJavaScript(rsp);
        System.out.println(unescapeRsp);
    }

3. 返回结果

返回结果如下, 限于篇幅,只展现部分get_product_result,完成的接口返回内容点击下载

 {
    "code":0,
    "message":"ok",
    "data":{
        "add_product_rule":"\u003citemRule\u003e\u003cfield id=\"product_id\" name=\"产品编号\" type=\"input\"\u003e\u003cdefault-value\u003e337259102\..........fields\u003e\u003c/field\u003e\u003c/itemRule\u003e",
        "request_id":"zyqf3xu5bnem"
    },
    "trace_id":""
}

说明: code为0表示成功,非0为失败,message会包含失败原因, add_product_rule为产品信息数据。schema形式

文档更新时间: 2023-04-14 22:19   作者:admin