根据商品信息推荐商品标题相关信息
一、请求参数
调用该接口前,请先使用【/product/get/product/update/rule】接口查询类目id响应结果recommend_name_rule.satisfy_prefix是否=true,当类目id为true时,再使用该接口查询类目id的推荐结果,当类目id为false时该接口查询结果会为空。
请求URL:
POST https://kf.fw199.com/gateway/dd/product/get/recommend/name
公共参数
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| appid | String | 是 | 合作伙伴AppId | |
| timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
| seller_nick | String | 是 | 38173182 | 抖店的账号,对应蜂巢授权返回doudianseller字段 |
| sign | String | 是 |
业务参数
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| scene | List | 是 | [“product_name_prefix”] | 暂时仅开放一种场景:1. product_name_prefix,表示基于命中的商品类目属性推荐商品标题前缀 |
| category_leaf_id | Number | 是 | 26150 | 商品叶子类目id,请先使用【/product/getProductUpdateRule】接口查询类目id查看recommend_name_rule. satisfy_prefix是否=true |
| first_cid | Number | 是 | 20080 | 一级类目id,scene为product_name_prefix时必传,没有时传0 |
| first_cid_name | String | 是 | 时尚饰品 | 一级类目名,scene为product_name_prefix时必传 |
| second_cid | Number | 是 | 20998 | 二级类目id,scene为product_name_prefix时必传,没有时传0 |
| second_cid_name | String | 是 | 耳饰 | 二级类目名,scene为product_name_prefix时必传 |
| third_cid | Number | 是 | 26150 | 三级类目id,scene为product_name_prefix时必传,没有时传0 |
| third_cid_name | String | 是 | 耳钉 | 三级类目名,scene为product_name_prefix时必传 |
| +select_property | Map | 是 | {“1687”:[{“value”:0,”name”:”填入品牌名”}],”3320”:[{“value”:18972,”name”:”99新”}]} | 商品类目属性,参考”select_property”:{“1687”:[{“value”:0,”name”:”填入品牌名”}],”3320”:[{“value”:18972,”name”:”99新”}]} |
| -value | Number | 是 | 27182 | 属性id |
| -name | String | 是 | 钛钢 | 属性名称 |
| use_brand_name | Bool | 否 | false | 是否勾选使用品牌名 |
二、请求示例代码
Java
请求示例代码
@Test public void DDProductGetRecommendName() throws Exception { Map<String, Object> data = new HashMap<String, Object>(); data.put("appid", Config.AppId); Long timestamp = System.currentTimeMillis() / 1000; data.put("timestamp", timestamp.toString()); data.put("seller_nick", Config.DDSellerNick);
data.put("scene", "[\"product_name_prefix\"]"); data.put("category_leaf_id", 26150); data.put("first_cid", 20080); data.put("first_cid_name", "时尚饰品"); data.put("second_cid", 20998); data.put("second_cid_name", "耳饰"); data.put("third_cid", 26150); data.put("third_cid_name", "耳钉"); data.put("select_property", "{\"1687\":[{\"value\":0,\"name\":\"填入品牌名\"}],\"3320\":[{\"value\":18972,\"name\":\"99新\"}]}"); data.put("use_brand_name", false);
data.put("sign", Sign(data,Config.AppSecret)); // 调用服务API String resp = doHttpRequest(Config.DDProductGetRecommendName, data); System.out.println(resp); }三、返回结果
{ "code": 0, "message": "ok", "data": { "recommend_name": [{ "recommend_scene": "product_name_prefix", "recommend_value": "耳饰 " }, { "recommend_scene": "product_name_suffix", "recommend_value": "" }] }}说明: code为0表示成功,非0为失败,message会包含失败原因。返回字段说明见文档 https://op.jinritemai.com/docs/api-docs/14/2428