生成艺术字签名
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| msg | string | 是 | 需要生成签名的文字内容 | 蔡徐坤 |
| id1 | string | 是 | 字体ID或中文名称,默认901,例:902/一笔艺术签 | 901 |
| id4 | string | 否 | 字体阴影颜色,默认#FFFFFF | #FFFFFF |
| id5 | string | 否 | 文字颜色,默认#000000 | #000000 |
| id6 | string | 否 | 背景颜色,默认#FFFFFF | #FFFFFF |
| type | string | 否 | 输出类型(json/text/img)=lb则输出字体列表 | json |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "msg",
"type": "string",
"required": true,
"description": "需要生成签名的文字内容",
"example": "蔡徐坤"
},
{
"name": "id1",
"type": "string",
"required": true,
"description": "字体ID或中文名称,默认901,例:902/一笔艺术签",
"example": "901"
},
{
"name": "id4",
"type": "string",
"required": false,
"description": "字体阴影颜色,默认#FFFFFF",
"example": "#FFFFFF"
},
{
"name": "id5",
"type": "string",
"required": false,
"description": "文字颜色,默认#000000",
"example": "#000000"
},
{
"name": "id6",
"type": "string",
"required": false,
"description": "背景颜色,默认#FFFFFF",
"example": "#FFFFFF"
},
{
"name": "type",
"type": "string",
"required": false,
"description": "输出类型(json/text/img)=lb则输出字体列表",
"example": "json"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "艺术签名",
"description": "生成艺术字签名",
"version": "1.0.0"
},
"paths": {
"/api/yljk/ysqm/ysqm/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": "需要生成签名的文字内容"
},
{
"name": "id1",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "901"
},
"description": "字体ID或中文名称,默认901,例:902/一笔艺术签"
},
{
"name": "id4",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "#FFFFFF"
},
"description": "字体阴影颜色,默认#FFFFFF"
},
{
"name": "id5",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "#000000"
},
"description": "文字颜色,默认#000000"
},
{
"name": "id6",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "#FFFFFF"
},
"description": "背景颜色,默认#FFFFFF"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "输出类型(json/text/img)=lb则输出字体列表"
}
],
"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": "需要生成签名的文字内容"
},
{
"name": "id1",
"in": "query",
"required": true,
"schema": {
"type": "string",
"example": "901"
},
"description": "字体ID或中文名称,默认901,例:902/一笔艺术签"
},
{
"name": "id4",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "#FFFFFF"
},
"description": "字体阴影颜色,默认#FFFFFF"
},
{
"name": "id5",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "#000000"
},
"description": "文字颜色,默认#000000"
},
{
"name": "id6",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "#FFFFFF"
},
"description": "背景颜色,默认#FFFFFF"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "输出类型(json/text/img)=lb则输出字体列表"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api-v2.317ak.com",
"description": "当前访问入口(https)"
}
]
}
{
"msg": "蔡徐坤",
"url": "http://21.jiqie.cn/112/114.132.201.221_0930042008.jpg",
"font_id": "901",
"font_name": "一笔艺术签",
"colors": {
"border": "#FFFFFF",
"background": "#FFFFFF",
"text": "#0000FF"
}
}
艺术签名接口用于生成个性化艺术字签名图片。
适用于娱乐、设计等场景,为用户提供文字艺术化处理服务。
https://api-v2.317ak.com/api/yljk/ysqm/ysqm/api.php
GET、POST
接口调用需要密钥鉴权。
首选鉴权方式:Query 参数传递。
请求时添加参数:
key=接口调用密钥
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥 |
| msg | string | 是 | 需要生成签名的文字内容,例如:蔡徐坤 |
| id1 | string | 是 | 字体 ID 或中文名称,默认 901,例如:902、一笔艺术签 |
| id4 | string | 否 | 字体阴影颜色,默认 #FFFFFF |
| id5 | string | 否 | 文字颜色,默认 #000000 |
| id6 | string | 否 | 背景颜色,默认 #FFFFFF |
| type | string | 否 | 输出类型,可填写 json、text、img;填写 lb 时输出字体列表 |
{
"msg": "蔡徐坤",
"url": "http://21.jiqie.cn/112/114.132.201.221_0930042008.jpg",
"font_id": "901",
"font_name": "一笔艺术签",
"colors": {
"border": "#FFFFFF",
"background": "#FFFFFF",
"text": "#0000FF"
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
| msg | string | 生成艺术签名的文字内容 |
| url | string | 生成后的签名图片地址 |
| font_id | string | 使用的字体 ID |
| font_name | string | 使用的字体名称 |
| colors | object | 签名颜色配置 |
| colors.border | string | 字体阴影颜色 |
| colors.background | string | 背景颜色 |
| colors.text | 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-v2.317ak.com/api/yljk/ysqm/ysqm/api.php" \
--data-urlencode "key=你的接口密钥" \
--data-urlencode "msg=蔡徐坤" \
--data-urlencode "id1=901" \
--data-urlencode "type=json"
// PHP
$url = "https://api-v2.317ak.com/api/yljk/ysqm/ysqm/api.php";
$params = [
"key" => "你的接口密钥",
"msg" => "蔡徐坤",
"id1" => "901",
"type" => "json"
];
$response = file_get_contents($url. "?". http_build_query($params));
echo $response;
key 传递密钥,请确保参数名称及内容填写正确,否则可能导致调用失败。msg 为需要生成艺术签名的文字内容,请确认内容编码正确,避免因特殊字符导致生成结果异常。id1 用于指定签名字体,需填写有效字体 ID 或中文字体名称;如需使用其他字体效果,可先获取字体列表后再选择。id4、id5、id6 建议使用标准颜色格式(如 #FFFFFF),填写不规范可能影响生成效果。type 可用于控制返回内容格式;如需获取字体列表,请按接口要求传入对应参数值。# 艺术签名生成
curl -G 'https://api-v2.317ak.com/api/yljk/ysqm/ysqm/api.php' \
--data-urlencode 'key=YOUR_API_KEY' \
--data-urlencode 'msg=蔡徐坤' \
--data-urlencode 'id1=901' \
--data-urlencode 'id4=#FFFFFF' \
--data-urlencode 'id5=#000000' \
--data-urlencode 'id6=#FFFFFF' \
--data-urlencode 'type=json'