防红短链生成
将长网址进行防红处理。
接口地址:https://api.uomg.com/api/long2fh
返回格式:json
请求方式:get/post
请求示例:https://api.uomg.com/api/long2fh?dwzapi=urlcn&url=http://qrpay.uomg.com
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
url | 是 | string | 需要进行防红的长网址 | |
dwzapi | 否 | string | 选择缩短接口[tcn|dwzcn|urlcn|suoim|mrwso|] |
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
code | string | 返回的状态码 | |
ae_url | string | 返回防红后的短网址 | |
msg | string | 返回防红后的长网址! | |
msg | string | 返回错误提示信息! |
返回示例:
{ "code": "1", "msg": "existence", "ae_url": "https:\/\/url.cn\/5V2IwUr", "longurl": "http:\/\/api.ututxi79.cn\/5560?RnOqjTk.css" }
服务级错误码参照(error_code):
错误码 | 说明 | |
---|---|---|
200301 | URL不能为空! | |
200302 | URL地址错误! | |
200303 | 当前IP已被拉黑 | |
200304 | 当前IP生成频率太高,已禁止生成 | |
200305 | 当前域名已被拉黑 | |
200306 | 未知错误,联系管理员 | |
200307 | 防红接口异常,联系站长 |
系统级错误码参照:
错误码 | 说明 | 旧版本(resultcode) | |
---|---|---|---|
10001 | 错误的请求KEY | 101 | |
10002 | 该KEY无请求权限 | 102 | |
10003 | KEY过期 | 103 | |
10004 | 错误的OPENID | 104 | |
10005 | 应用未审核超时,请提交认证 | 105 | |
10007 | 未知的请求源 | 107 | |
10008 | 被禁止的IP | 108 | |
10009 | 被禁止的KEY | 109 | |
10011 | 当前IP请求超过限制 | 111 | |
10012 | 请求超过次数限制 | 112 | |
10013 | 测试KEY超过请求限制 | 113 | |
10014 | 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) | 114 | |
10020 | 接口异常 | 120 | |
10021 | 接口停用 | 121 |
错误码格式说明(示例:200201):
2 | 002 | 01 | |
---|---|---|---|
服务级错误(1为系统级错误) | 服务模块代码(即数据ID) | 具体错误代码 |
PHP演示:
<?php
header("Content-Type:text/html;charset=UTF-8");
date_default_timezone_set("PRC");
$url = "http://qrpay.uomg.com";
$result = file_get_contents("https://api.uomg.com/api/long2dwz?url=".$url);
$arr=json_decode($result,true);
if ($arr['code']==1) {
echo $arr['ae_url'];
} else {
echo $arr['msg'];
}
?>