| 接口地址:http://www.tuling123.com/openapi/api |
|---|
| 返回格式:json |
| 请求方式:get |
| 请求示例:http://www.tuling123.com/openapi/api?key=your_key&info=your |
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 必填 | 在图灵机器人平台申请的apikey 扫码关注公众号 |
| info | string | 必填 | 要发送的消息 |
| 名称 | 类型 | 说明 |
|---|---|---|
| code | string | 状态码 |
| text | string | 消息 |
{
"code": 100000,
"text": "我发啥消息?"
}| 错误码 | 说明 |
|---|---|
| 5000 | 无解析结果 |
| 6000 | 暂不支持该功能 |
| 4000 | 请求参数格式错误 |
| 4001 | 加密方式错误 |
| 4002 | 无功能权限 |
| 4003 | 该apikey没有可用请求次数 |
| 4005 | 无功能权限 |
| 4007 | apikey不合法 |
| 4100 | userid获取失败 |
| 4200 | 上传格式错误 |
| 4300 | 批量操作超过限制 |
| 4400 | 没有上传合法userid |
| 4500 | userid申请个数超过限制 |
| 4600 | 输入内容为空 |
| 4602 | 输入文本内容超长(上限150) |
| 7002 | 上传信息失败 |
| 8008 | 服务器错误 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2020/01/06 22:16
*/
//----------------------------------
// 手机号码归属地 调用类
//----------------------------------
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'http://www.tuling123.com/openapi/api?key=yourkey&info=你要发的消息';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
resp, err := http.Get("http://www.tuling123.com/openapi/api?key=yourkey&info=你要发的消息")
if err != nil {
log.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}