跳转到内容
返回官网

根据商品信息推荐商品标题相关信息

一、请求参数

调用该接口前,请先使用【/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

公共参数

参数名称参数类型是否必须示例值参数描述
appidString合作伙伴AppId
timestampString1657525936当前Unix时间戳,秒
seller_nickString38173182抖店的账号,对应蜂巢授权返回doudianseller字段
signString

业务参数

参数名称参数类型是否必须示例值参数描述
sceneList[“product_name_prefix”]暂时仅开放一种场景:1. product_name_prefix,表示基于命中的商品类目属性推荐商品标题前缀
category_leaf_idNumber26150商品叶子类目id,请先使用【/product/getProductUpdateRule】接口查询类目id查看recommend_name_rule. satisfy_prefix是否=true
first_cidNumber20080一级类目id,scene为product_name_prefix时必传,没有时传0
first_cid_nameString时尚饰品一级类目名,scene为product_name_prefix时必传
second_cidNumber20998二级类目id,scene为product_name_prefix时必传,没有时传0
second_cid_nameString耳饰二级类目名,scene为product_name_prefix时必传
third_cidNumber26150三级类目id,scene为product_name_prefix时必传,没有时传0
third_cid_nameString耳钉三级类目名,scene为product_name_prefix时必传
+select_propertyMap{“1687”:[{“value”:0,”name”:”填入品牌名”}],”3320”:[{“value”:18972,”name”:”99新”}]}商品类目属性,参考”select_property”:{“1687”:[{“value”:0,”name”:”填入品牌名”}],”3320”:[{“value”:18972,”name”:”99新”}]}
-valueNumber27182属性id
-nameString钛钢属性名称
use_brand_nameBoolfalse是否勾选使用品牌名

二、请求示例代码

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