欢迎来到 wabc.cc 官方网站!
短连接_短网址生成_营销推广利器_专属域名

短连接_短网址生成_营销推广利器_专属域名

API参数 创建短连接获取连接统计数据新增域名 调用地址: http,https://tmcool.api.bdymkt.com/links 请求方式: POST 支持格式: application/json;charset=UTF-8 调用工具: 去调试 请求参数(Headers) 请求参数(Query) 名称 类型 是否必须 示例值 描述 target string true

联系电话: 13983470003
产品详情
API参数 创建短连接获取连接统计数据新增域名 调用地址: http,https://tmcool.api.bdymkt.com/links 请求方式: POST 支持格式: application/json;charset=UTF-8 调用工具: 去调试 请求参数(Headers) 请求参数(Query)
  • 名称
  • 类型
  • 是否必须
  • 示例值
  • 描述
  • target
  • string
  • true
  • https://www.q-5.cn/user/user_app_add.php
  • 长连接
  • description
  • string
  • false
  • null
  • 备注 (可为空)
  • expire_in
  • string
  • false
  • 1d
  • 短连接过期时长(为空代表永不过期)单位M/H/D,1d代表一天
  • password
  • string
  • false
  • null
  • 短连接打开密码(可为空),为空代表不加密
  • customurl
  • string
  • false
  • 4dfg6
  • 自定义短连接后缀(可为空),为空 使用系统默认生成
  • reuse
  • string
  • true
  • false
  • 管理员权限,固定值false
  • domain
  • string
  • false
  • http://baidu.com
  • 自定义专属域名,需要提前绑定域名
请求参数(Body) 请求参数(Path) 请求示例 javapythongocurlphpnodejs 示例代码使用, 需要使用Maven加入依赖
<dependency>
    <groupId>com.baidubce</groupId>
    <artifactId>api-explorer-sdk</artifactId>
    <version>1.0.0</version>
</dependency>
                                    
                                        
import com.baidubce.http.ApiExplorerClient;
import com.baidubce.http.AppSigner;
import com.baidubce.http.HttpMethodName;
import com.baidubce.model.ApiExplorerRequest;
import com.baidubce.model.ApiExplorerResponse;

// 创建短连接 Java示例代码
public class RequestDemo {
    public static void main(String[] args) {
        String path = "https://tmcool.api.bdymkt.com/api/v2/links";
        ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path);
        request.setCredentials("您的 access key", "您的 secret key");

        request.addHeaderParameter("Content-Type", "application/json;charset=UTF-8");
        
        request.addQueryParameter("target", "");
        request.addQueryParameter("description", "");
        request.addQueryParameter("expire_in", "");
        request.addQueryParameter("password", "");
        request.addQueryParameter("customurl", "");
        request.addQueryParameter("reuse", "");
        request.addQueryParameter("domain", "");
        
        String requestExample = "{\r\n  \"target\": \"https:\/\/www.q-5.cn\/user\/user_app_add.php\",\r\n  \"description\": \"双11全场5折活动广告连接\",\r\n  \"expire_in\": \"1d\",\r\n  \"password\": \"\",\r\n  \"customurl\": \"\",\r\n  \"reuse\": false,\r\n  \"domain\": \"\"\r\n}";
        request.setJsonBody(requestExample);
        

        ApiExplorerClient client = new ApiExplorerClient(new AppSigner());

        try {
          ApiExplorerResponse response = client.sendRequest(request);
          // 返回结果格式为Json字符串
          System.out.println(response.getResult());
        } catch (Exception e) {
          e.printStackTrace();
        }
    }
}
                                    

                                    点击复制代码
                                
正常返回示例
                                    {
    "id":"1c8d9416-5abe-433b-bf29-fe3391b19997",
    "address":"fxM9co",
    "description":null,
    "banned":false,
    "password":false,
    "expire_in":null,
    "target":"https://console.bce.baidu.com/apigw/?_=1608200575625#/apigw/appManage/testApi~apiId=GWAI-kt2CKaiubs8&groupId=GWGP-iMUSZ3j7UpG&apiName=%E5%88%9B%E5%BB%BA%E7%9F%AD%E8%BF%9E%E6%8E%A5",
    "visit_count":0,
    "created_at":"2020-12-17T10:26:56.508Z",
    "updated_at":"2020-12-17T10:26:56.508Z",
    "link":"https://url.q-5.cn/fxM9co"
    
}

                                
失败返回示例
                                    {
    "error":"请输入网址"
    
}
                                
错误码定义
标签: {}
在线客服
微信联系
客服
扫码加微信(手机同号)
电话咨询
返回顶部