Skip to content

API接口

温馨提示

推荐使用SDK,集成更方便

API接口地址

bash
https://api.fastposter.net
https://api.fastposter.net

生成海报接口

POST /v1/build/poster

请求头.

参数名类型是否必填说明示例
TokenString访问TOKENxxxxx 20位

请求体为 JSON格式 数据,需要指定Content-Typeapplication/json

参数名类型是否必填说明示例
uuidString海报UUID2a72b451834d4c59
payloadString载荷,对应海报的参数。支持使用base64进行编码。{"name": "测试文本"}
typeString海报文件类型 png jpeg webp pdfpng
scaleFloat海报缩放比例[0.1~1.0] (默认1.0)1.0
b64Boolean是否将图片以base64编码返回(默认falsefalse

请求体 JSON格式 数据示例

json
{
  "uuid": "2a72b451834d4c59",
  "payload": "eyJuYW1lIjoi5rWL6K-V5paH5pysIn0="
}
{
  "uuid": "2a72b451834d4c59",
  "payload": "eyJuYW1lIjoi5rWL6K-V5paH5pysIn0="
}

完整示例

HTTP报文

txt
POST /v1/build/poster HTTP/1.1
Client-Type: java
Client-Version: 1.2.5
Content-Type: application/json
User-Agent: PostmanRuntime/7.30.0
Accept: */*
Cache-Control: no-cache
Host: api.fastposter.net
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 164

{"uuid":"2a72b451834d4c59","payload":"eyJuYW1lIjoi5rWL6K-V5paH5pysIn0="}
POST /v1/build/poster HTTP/1.1
Client-Type: java
Client-Version: 1.2.5
Content-Type: application/json
User-Agent: PostmanRuntime/7.30.0
Accept: */*
Cache-Control: no-cache
Host: api.fastposter.net
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 164

{"uuid":"2a72b451834d4c59","payload":"eyJuYW1lIjoi5rWL6K-V5paH5pysIn0="}

生成的海报图片

生成链接地址

POST /v1/link

请求参数与 生成海报接口 保持一致

返回示例

json
{
  "code": 0,
  "data": {
    "url": "https://fastposter.net/v/4AJxm2i******Pc2qWqNO"
  }
}
{
  "code": 0,
  "data": {
    "url": "https://fastposter.net/v/4AJxm2i******Pc2qWqNO"
  }
}

常见问题

海报出现乱码

生成的海报出现乱码,将payload参数进行base64编码即可。

错误码

错误码说明
1001海报uuid不能为空
1004载荷不能为空
1106Token不匹配
1201账户可用资源不足
1202海报不存在