微提醒是把市面主流的通讯工具进行整合,通过联合循环通知的方式,以确保你最大可能不错过提醒内容。
调用地址: http://gw.fishapi.com/api/notice
返回格式:json
请求方式: http get
请求示例: http://gw.fishapi.com/api/notice?token=您申请的TOKEN &key=XXX&content=XXX&start_time=XXX
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
token | 是 | string | 个人认证token |
key | 是 | String | 设置任务后获得的key |
content | 是 | String | 消息内容 |
start_time | 否 | String | 消息开始发送的时间,格式(2020-05-01 00:00:00)。为空表示马上发送 |
错误码 | 说明 |
---|---|
1004
| 请求方法错误 |
参数错误 | |
key错误 | |
系统错误 | |
其它错误 |
错误码 | 说明 |
---|---|
301 | 当前IP请求超过限制 |
302 | 被禁止的IP |
303 | 请求超过次数限制 |
401 | token不能为空 |
400 | 错误的请求token |
404 | 该API不存在 |
500 | 服务暂时不可用 |
501 | 接口维护 |
502 | 接口停用 |
503 | 调用方法错误 |
504 | 远程服务器错误 |
505 | 没有调用次数 |
506 | 调用超时 |
507 | 参数错误 |
$url = "http://gw.fishapi.com/api/notice";
$params = array (
'token' => '你的token',
'key' => '设置任务后获得的key',
'content' => '消息内容',
'start_time' => '消息开始发送的时间,格式(2020-05-01 00:00:00)。为空表示马上发送',
);
$paramstring = http_build_query($params);
$content = request($url,$paramstring);
$result = json_decode($content,true);
function request($url,$params=false,$ispost=0){
$httpInfo = array();
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT , 60 );
curl_setopt( $ch, CURLOPT_TIMEOUT , 60);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if( $ispost )
{
curl_setopt( $ch , CURLOPT_POST , true );
curl_setopt( $ch , CURLOPT_POSTFIELDS , $params );
curl_setopt( $ch , CURLOPT_URL , $url );
}
else
{
if($params){
curl_setopt( $ch , CURLOPT_URL , $url.'?'.$params );
}else{
curl_setopt( $ch , CURLOPT_URL , $url);
}
}
$response = curl_exec( $ch );
if ($response === FALSE) {
//echo "cURL Error: " . curl_error($ch);
return false;
}
$httpCode = curl_getinfo( $ch , CURLINFO_HTTP_CODE );
$httpInfo = array_merge( $httpInfo , curl_getinfo( $ch ) );
curl_close( $ch );
return $response;
}
方式 | 详细 |
---|---|
微信 | xiwangcs |
QQ | 81527007 |
电话 | 17181378718 |