返回一张许愿失败的表情包图片
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| msg | string | 是 | 写下你的愿望 | 想要一个老婆 |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "msg",
"type": "string",
"required": true,
"description": "写下你的愿望",
"example": "想要一个老婆"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "许愿失败",
"description": "返回一张许愿失败的表情包图片",
"version": "1.0.0"
},
"paths": {
"/api/bqbjk/xuyuan/api.php": {
"get": {
"summary": "许愿失败",
"description": "返回一张许愿失败的表情包图片",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "msg",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "想要一个老婆"
},
"description": "写下你的愿望"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "许愿失败",
"description": "返回一张许愿失败的表情包图片",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "msg",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "想要一个老婆"
},
"description": "写下你的愿望"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api-v2.317ak.com",
"description": "当前访问入口(https)"
}
]
}
返回一张许愿失败的表情包图片,适用于表情分类相关场景调用。
用户可提交愿望内容,获取对应的趣味图片结果。
https://api-v2.317ak.com/api/bqbjk/xuyuan/api.php
GET、POST
接口调用需要密钥。
采用 Query 鉴权方式,请求时传入 key 参数作为接口调用密钥。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
key |
string | 是 | 接口调用密钥 |
msg |
string | 是 | 写下你的愿望,例如:想要一个老婆 |
参数取值说明:
msg 用于填写许愿内容,接口将根据填写的愿望生成对应的许愿失败表情包图片。{
"image": "返回的许愿失败表情包图片"
}
| 字段 | 类型 | 说明 |
|---|---|---|
| image | string | 许愿失败表情包图片内容或图片地址 |
接口发生错误时,返回 JSON 格式错误信息:
{"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 -X GET "https://api-v2.317ak.com/api/bqbjk/xuyuan/api.php?key=你的密钥&msg=想要一个老婆"
// PHP
## 注意事项
- 请妥善保管接口调用密钥,避免将密钥直接暴露在前端代码、公开仓库或可被他人获取的位置。
- 调用接口时需通过 Query 参数 `key` 传递有效密钥,例如 `key=你的密钥`,缺少密钥或密钥无效时可能无法正常获取结果。
- 接口支持 GET、POST 请求方式,请根据实际开发场景选择合适的请求方式。
- 参数 `msg` 用于填写愿望内容,建议传入简洁明确的文本,例如“想要一个老婆”,避免提交过长或无意义内容。
- 请合理控制接口调用频率,避免短时间内大量重复请求影响正常使用。
- 建议使用 HTTPS 方式请求接口,保障请求过程中的数据安全。
- 本接口返回内容为许愿失败表情包图片,未提供固定返回示例,实际响应结果以接口返回内容为准。#!/bin/bash
# 许愿失败接口调用示例
url="https://api-v2.317ak.com/api/bqbjk/xuyuan/api.php"
key="YOUR_API_KEY"
msg="想要一个老婆"
curl -G "$url" \
--data-urlencode "key=$key" \
--data-urlencode "msg=$msg"