REST API 插入贴纸文档
更新时间 2025/02/22 07:19:43
英飞画布服务端支持基于 Restful API 往画布中插入贴纸。
前提条件
Http 请求
- 请求路径
https://api.infi.cn/u3wbs/wbs/websdk/sticker/add
- 请求参数 Query
字段
类型
描述
appId
string
应用 appId,可以在开发者门户中获取
expire
integer
签名过期时间戳(毫秒)
recordId
string
画布 recordId,即创建画布时返回的 recordId
userId
string
创建者 Id
signature
string
签名,生成方式见链接
- 请求参数示例
appId=APP_ID&expire=EXPIRE_NUM&recordId=RECORD_ID_STRING&userId=USER_ID_STRING&signature=SIGNATURE_STRING
请求的参数连同请求签名需要以 Url Search Params 形式拼接至接口路径之后。
- 请求参数 Body
字段
类型
描述
是否必填
position
object
预置元素的坐标
是
position.x
integer
元素左上角 x 坐标
是
position.y
integer
元素左上角 y 坐标
是
scale
integer
放缩,数值需要大于0
是
frameId
string
帧框 ID
否
icon
string
贴纸名称,目前支持的贴纸:start,push-hard,rush,awesome,correct-one,wrong-one,stop,give-up,warning-one,warning-two,correct-two,wrong-two,guide-board,todo-flag,start-flag,end-flag
是
-
请求参数 Body 示例
{
"position": {
"x": 1234,
"y": 1234
},
"scale": 0.5,
"frameId": "",
"icon": "start"
} -
请求返回体
字段
类型
描述
code
integer
0 表示成功,其他表示失败
reqId
string
请求 id
reqTime
integer
请求时间戳
obj
object
解析结果
obj.elementId
string
元素 ID
返回体示例:
{
"code": 0,
"reqId": "12345678901234",
"reqTime": 12345678901234,
"obj": {
"elementId": "ELEMENT_ID_STRING"
}
}
- 请求失败情况 响应包体中 code 字段不为 0 时表请求失败,失败信息请查询错误码列表。