随机返回一段坤坤语音链接
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
}
]
{
"openapi": "3.1.1",
"info": {
"title": "坤坤语音",
"description": "随机返回一段坤坤语音链接",
"version": "1.0.0"
},
"paths": {
"/api/yy/kkyy/api.php": {
"get": {
"summary": "坤坤语音",
"description": "随机返回一段坤坤语音链接",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "坤坤语音",
"description": "随机返回一段坤坤语音链接",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.317ak.com",
"description": "当前访问入口(https)"
}
]
}
坤坤语音接口用于随机返回一段坤坤语音链接。
适用于需要获取语音内容的应用场景调用。
https://api.317ak.com/api/yy/kkyy/api.php
GET, POST
本接口调用需要密钥认证。
首选鉴权方式:Query
请求时通过 Query 参数传递密钥:
key=接口调用密钥
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,通过 Query 参数传递,用于接口鉴权 |
{
"code": 200,
"data": {
"url": "https://example.com/audio/kun.mp3"
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 请求状态标识 |
| data | object | 返回数据内容 |
| data.url | string | 随机返回的语音链接 |
{"code":0,"msg":"接口调用失败","errcode":11001}
| errcode | 含义 |
|---|---|
| 11001 | 未提供调用密钥 |
| 11002 | 密钥错误 |
| 11003 | 密钥已禁用 |
| 11004 | 积分余额不足 |
| 11005 | 请求过于频繁(QPM 限制) |
| 11006 | 接口维护中 |
| 11007 | 接口已禁用 |
| 11008 | 接口不可用 |
| 11009 | 密钥校验暂不可用 |
| 11010 | 积分系统暂不可用 |
| 11011 | 收费接口须提供有效密钥 |
| 11012 | 鉴权方式错误 |
| 11013 | 接口不存在 |
| 11014 | 请求目标地址无效 |
| 11015 | 请求目标地址不允许 |
| 11016 | 请求目标服务失败 |
| 11017 | 服务暂不可用 |
| 11018 | 请求方式不允许 |
| 11019 | 当前IP不在白名单内 |
| 11020 | 启用访问通道功能须提供有效密钥 |
| 11021 | 未配置可用访问通道 |
| 11022 | 访问通道不可用 |
| 11023 | 密钥已过期 |
| 11024 | 令牌分配积分不足 |
curl -G "https://api.317ak.com/api/yy/kkyy/api.php" \
--data-urlencode "key=你的密钥"
# PHP
$url = "https://api.317ak.com/api/yy/kkyy/api.php?key=你的密钥";
$response = file_get_contents($url);
echo $response;
key 参数,避免泄露给无关人员。key 参数为必填项,请确认传入内容完整有效,否则可能导致接口调用失败。curl -G "https://api.317ak.com/api/yy/kkyy/api.php" \
--data-urlencode "key=YOUR_API_KEY"