接口使用场景等说明:可通过该接口帮助推广者对目标图片生成带有推广者信息的暗码图。
生成的图片如何使用?请参考 https://www.veapi.cn/taokelianmeng/562.html
| 环境 | http 地址 | https 地址 |
|---|---|---|
| 正式环境 | http://api.veapi.cn/tbk/picembed | 暂无 |
| 参数名称 | 参数类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| vekey | String | 是 | V123M56 | 公共参数,接口秘钥,请在会员中心获取 |
| pid | String | 是 | mm_xxx_xxx_xxx | 推广位 |
| item_id | Number | 是 | 566522333 | 商品ID |
| pic_stream | Byte[] | 否 | - | 自定义的需打码的图片。通常不建议使用本参数,接口会自动获取该item_id产品的主图使用,如需使用本参数自定义图片,请用POST方式提供base64图片。 |
| relation_id | String | 否 | 1223213 | 您的渠道ID,当使用本参数时,请务必确保PID是“渠道专属PID”才有效。 |
GET/POST http://api.veapi.cn/tbk/picembed?vekey=xxx&relation_id=2543285643&item_id=23883488910
$api="http://api.veapi.cn/tbk/picembed?vekey=xxx&relation_id=2543285643&item_id=23883488910"; $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/tbk/picembed?vekey=xxx&relation_id=2543285643&item_id=23883488910";
// 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/tbk/picembed?vekey=xxx&relation_id=2543285643&item_id=23883488910" # 发送请求 response = requests.get(target_url) # 获取页面内容 if response.status_code == 200: print response.text
| 参数名称 | 参数类型 | 示例值 | 描述 |
|---|---|---|---|
| embed_pic_url | String | https://xxx | 打码图下载地址,15分钟内有效。生成的图片如何使用?请参考这里 |
{ "error": "0", "msg": "商业化图片生成成功", "data": { "embed_pic_url": "https://saas-gateway.oss-cn-beijing.aliyuCcc...", "request_id": "nkybmb0f9r9e" } }