Skip to content
Microus API系统
返回首页

示例接口

公开接口 免费

一个简单的示例接口,返回Hello World信息,演示API系统的基本功能

请求信息

请求方式 GET
返回格式 JSON
请求地址
https://api.microku.cn/api/test.php
示例地址
/api/test.php?key=YOUR_API_KEY&name=John

请求参数

参数名 类型 必填 说明
name string 你的名字,默认为World

返回参数

字段名 类型 说明
code integer 状态码
msg string 状态消息
data.message string 返回消息内容
timestamp integer 时间戳

状态码说明

状态码 状态信息 说明
200 OK 请求成功
400 Bad Request 请求参数错误
401 Unauthorized 未授权,无效的API密钥
403 Forbidden 权限不足或余额不足
404 Not Found 接口不存在
429 Too Many Requests 请求过于频繁
500 Internal Server Error 服务器内部错误
502 Bad Gateway 网关错误

在线测试

name
点击"发送请求"按钮查看返回结果...

调用示例

PHP (cURL)
<?php
$url = 'https://api.microku.cn/api/test.php';
$params = [
    'name' => 'value',
];

$url .= '?' . http_build_query($params);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);