接口使用场景等说明:本功能适用于采集群等场景。将其他推广者的推广链接转换成自己的;通过此api可以将他人的招商推广链接,转换成自己的招商推广链接。
环境 | http 地址 | https 地址 |
---|---|---|
正式环境 | http://api.veapi.cn/pdd/pdd_zsuniturl | 暂无 |
参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
custom_parameters | String | 是 | 自定义参数,必须是与p_id备案关联过(参备案接口),为链接打上自定义标签;参数最长限制64个字节;格式:{"uid":"11","sid":"22"},如果您只传Uid,那么也可以直接用字符串表示,如custom_parameters=11。其中 uid 必选,用户唯一标识,每个用户仅且对应一个标识; sid可选,表示上下文信息标识,例如sessionId等。该json字符串中也可以加入其他自定义的key/value对。 | |
pid | String | 是 | 渠道id | |
source_url | String | 是 | 需转链的链接,支持拼多多商品链接、进宝长链/短链(即为转链接口生成的长短链),本参数请urleocde编码后传参 | |
generate_schema_url | Boolean | 否 | 是否返回 schema URL |
GET/POST http://api.veapi.cn/pdd/pdd_zsuniturl?vekey=xxx&&source_url=https%3A%2F%2Fmobile.yangkeduo.com%2Fgoods2.html%3Fgoods_id%3D437722366322&pid=4079456_34211517&custom_parameters=6688
$api="http://api.veapi.cn/pdd/pdd_zsuniturl?vekey=xxx&&source_url=https%3A%2F%2Fmobile.yangkeduo.com%2Fgoods2.html%3Fgoods_id%3D437722366322&pid=4079456_34211517&custom_parameters=6688"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api); //curl_setopt($ch, CURLOPT_POST, true); //POST方式时启用 //curl_setopt($ch, CURLOPT_POSTFIELDS, $postData ); //POST方式时传参 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //如果使用https请启用 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //如果使用https请启用 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); //返回数据流,不直接输出 curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); //使用gzip压缩传输让访问更快 curl_setopt($ch, CURLOPT_TIMEOUT, 6); //允许执行的最长秒数。这里设定6S curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $result = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); echo $result; //返回值
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpRequest; public class testGetParam { public static void main(String[] args) { // API网址 String url = "http://api.veapi.cn/pdd/pdd_zsuniturl?vekey=xxx&&source_url=https%3A%2F%2Fmobile.yangkeduo.com%2Fgoods2.html%3Fgoods_id%3D437722366322&pid=4079456_34211517&custom_parameters=6688"; // JDK 8u111版本后,若目标页面为HTTPS协议,请启用proxy用户密码鉴权 //System.setProperty("jdk.http.auth.tunneling.disabledSchemes", ""); // 发送请求 String result = HttpRequest.get(url) .timeout(10000)//设置超时,毫秒 .execute().body(); System.out.println(result); } }
import requests # 要访问的API网页 target_url = "http://api.veapi.cn/pdd/pdd_zsuniturl?vekey=xxx&&source_url=https%3A%2F%2Fmobile.yangkeduo.com%2Fgoods2.html%3Fgoods_id%3D437722366322&pid=4079456_34211517&custom_parameters=6688" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
参数名称 | 参数类型 | 示例值 | 描述 |
---|---|---|---|
mobile_short_url | String | 推广短链接(可唤起拼多多app) | |
mobile_url | String | 推广长链接(唤起拼多多app) | |
multi_group_mobile_short_url | String | 推广短链接(唤起拼多多app) | |
multi_group_mobile_url | String | 推广长链接(可唤起拼多多app) | |
multi_group_short_url | String | 双人团推广短链接 | |
multi_group_url | String | 双人团推广长链接 | |
schema_url | String | schema的链接 | |
short_url | String | 单人团推广短链接 | |
url | String | 单人团推广长链接 |
{ "error": "0", "msg": "生成招商推广链接成功", "data": { "multi_group_mobile_short_url": "https://p.pinduoduo.com/btgAgHbt", "multi_group_url": "https://mobile.yangkeduo.com/duo_coupon_landing.html?goods_id=437722366322&pid=4079456_34211517&goods_sign=E9T2x4AHv-ZEb5jhweHb3NKAeZDcCtGh_JXscuRXol&customParameters=6688&authDuoId=2003157&cpsSign=CC_221221_4079456_34211517_522f206b5c2c5bd6c34efccb1613dfe6&_x_ddjb_act=%7B%22st%22%3A%221%22%7D&duoduo_type=3", "mobile_url": "https://mobile.yangkeduo.com/duo_coupon_landing.html?goods_id=437722366322&pid=4079456_34211517&goods_sign=E9T2x4AHv-ZEb5jhweHb3NKAeZDcCtGh_JXscuRXol&customParameters=6688&authDuoId=2003157&cpsSign=CC_221221_4079456_34211517_522f206b5c2c5bd6c34efccb1613dfe6&_x_ddjb_act=%7B%22st%22%3A%221%22%7D&duoduo_type=2&launch_pdd=1&campaign=ddjb&cid=launch_dl_force_", "multi_group_short_url": "https://p.pinduoduo.com/HjLAKwQB", "mobile_short_url": "https://p.pinduoduo.com/xLBn9nyk", "multi_group_mobile_url": "https://mobile.yangkeduo.com/duo_coupon_landing.html?goods_id=437722366322&pid=4079456_34211517&goods_sign=E9T2x4AHv-ZEb5jhweHb3NKAeZDcCtGh_JXscuRXol&customParameters=6688&authDuoId=2003157&cpsSign=CC_221221_4079456_34211517_522f206b5c2c5bd6c34efccb1613dfe6&_x_ddjb_act=%7B%22st%22%3A%221%22%7D&duoduo_type=3&launch_pdd=1&campaign=ddjb&cid=launch_dl_force_", "request_id": "16716077749055926", "url": "https://mobile.yangkeduo.com/duo_coupon_landing.html?goods_id=437722366322&pid=4079456_34211517&goods_sign=E9T2x4AHv-ZEb5jhweHb3NKAeZDcCtGh_JXscuRXol&customParameters=6688&authDuoId=2003157&cpsSign=CC_221221_4079456_34211517_522f206b5c2c5bd6c34efccb1613dfe6&_x_ddjb_act=%7B%22st%22%3A%221%22%7D&duoduo_type=2", "short_url": "https://p.pinduoduo.com/lCwnc1o2" }, "request_id": "t8YsgC2" }