淘口令解析api接口
将淘口令解析还原成url,商品口令、券口令可完美解析出商品id;
目前支持的口令类型有:商品口令、二合一优惠券口令、聚拼团商品口令、淘礼金领券口令….
1.请求参数:
请求URL:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | |
timestamp | String | 当前时间戳 | |
password_content | String | 淘口令,支持传入包含口令的整个文案 | |
sign | String | 接口签名 | 如何计算生成见示例代码 |
2. 请求示例代码(Java)
@Test
public void tbkTPWdConvert() throws Exception {
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
// 需要解析的淘口令 必填
data.put("password_content", "0\uD83D\uDC48\uD83D\uDCB0N5xQcrX37jK£dἌ开\uD83D\uDC49淘bào\uD83D\uDC48或點几url链 https://m.tb.cn/h.4TZZUob?sm=4dbe69 至浏lằn器【i9-10900K/10900KF I7 10700K I5 10600K 10400F 盒装CPU处理器】");
// 签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
// 调用服务API
doHttpRequest(Config.TaoBaoTBKTpWdConvertUrl ,data);
}
3. 返回结果如下:
{
"code": 0,
"message": "ok",
"data": {
"content": "i9-10900K/10900KF I7 10700K I5 10600K 10400F 盒装CPU处理器",
"native_url": "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav\u0026module=h5\u0026h5Url=https%3A%2F%2Fitem.taobao.com%2Fitem.htm%3Fut_sk%3D1.XLsJFeauwD8DAHBJnWHiWXzL_21380790_1608880919542.Copy.1%26id%3D625031446126%26sourceType%3Ditem%26price%3D799-3699%26suid%3D7CC5BD39-65C4-459C-8308-8D680B183CCB%26shareUniqueId%3D6594471986%26un%3D5fffe982f4c015a04b68d5f77a161062%26share_crt_v%3D1%26spm%3Da211b4.23434152%26sp_tk%3DTjV4UWNyWDM3aks%3D%26bxsign%3DtcdxwjgTnw4_vl84zJv0XCuw2yswMI8bUf-vpd01ISeoYSoDl5EAW9tHXghOKmJxzgbaZQVxNMRkSsFTK7DehSe26SrJdY4kUcE6Ibi5Xs-m_w%26visa%3D13a09278fde22a2e%26disablePopup%3Dtrue%26disableSJ%3D1\u0026appkey=23434152\u0026visa=13a09278fde22a2e",
"num_iid": "625031446126",
"pic_url": "http://gw.alicdn.com/bao/uploaded/i2/79607718/O1CN01bdCS1726stRz3U1bk_!!79607718.jpg",
"request_id": "3yngxyub7gk9",
"suc": true,
"thumb_pic_url": "http://gw.alicdn.com/bao/uploaded/i2/79607718/O1CN01bdCS1726stRz3U1bk_!!79607718.jpg_170x170.jpg",
"title": "淘口令",
"url": "https://item.taobao.com/item.htm?ut_sk=1.XLsJFeauwD8DAHBJnWHiWXzL_21380790_1608880919542.Copy.1\u0026id=625031446126\u0026sourceType=item\u0026price=799-3699\u0026suid=7CC5BD39-65C4-459C-8308-8D680B183CCB\u0026shareUniqueId=6594471986\u0026un=5fffe982f4c015a04b68d5f77a161062\u0026share_crt_v=1\u0026spm=a211b4.23434152\u0026sp_tk=TjV4UWNyWDM3aks=\u0026bxsign=tcdxwjgTnw4_vl84zJv0XCuw2yswMI8bUf-vpd01ISeoYSoDl5EAW9tHXghOKmJxzgbaZQVxNMRkSsFTK7DehSe26SrJdY4kUcE6Ibi5Xs-m_w\u0026visa=13a09278fde22a2e\u0026disablePopup=true\u0026disableSJ=1"
}
}
说明: code为0表示成功,非0为失败,message会包含失败原因。
4. 返回字段说明
字段 | 类型 | 说明 |
---|---|---|
num_iid | Number | 商品id, 只要口令是商品口令或券口令时才返回商品id |
content | String | 淘口令-文案 |
title | String | 商品标题 |
price | String | 商品价格(手淘分享的口令,才可以解析出价格) |
pic_url | String | 口令图片 |
url | String | 跳转url(长链) |
native_url | String | 移动端调起地址 |
thumb_pic_url | String | 缩略图 |
文档更新时间: 2023-03-14 16:41 作者:admin