fresns
  1. 编辑器
fresns
  • 请求标头
  • 通用数据结构
  • 错误码
  • 全局配置
    • 全局配置信息
      GET
    • 状态码信息
      GET
    • 扩展档案配置
      GET
    • 上传用的令牌
      GET
    • 用户角色
      GET
    • 地图服务商
      GET
    • 内容类型
      GET
    • 表情图
      GET
    • 阻止词
      GET
  • 公共业务
    • 输入提示信息
    • 回调返参查询
    • 发送验证码
    • 上传日志
    • 上传文件
    • 文件下载链接
    • 下载过文件的用户
  • 账号
    • 注册
    • 登录
    • 重置密码
    • 获取账号详情
    • 钱包交易记录
    • 身份验证
    • 修改账号资料
    • 退出登录
    • 申请删除账号
    • 撤销删除申请
  • 用户
    • 获取用户列表
    • 获取用户详情
    • 获取用户认识的关注者
    • 获取用户互动的用户列表
    • 获取用户标记的内容列表
    • 用户登录
    • 用户面板
    • 修改用户资料
    • 操作标记
    • 标记备注
  • 消息
    • [通知]获取消息列表
    • [通知]更新阅读状态
    • [通知]删除消息
    • [对话]获取对话列表
    • [对话]获取对话详情
    • [对话]获取消息列表
    • [对话]置顶对话
    • [对话]更新阅读状态
    • [对话]发送消息
    • [对话]删除对话或对话的消息
  • 小组
    • 获取树结构小组列表
    • 获取小组分类
    • 获取小组列表
    • 获取小组详情
    • 获取小组互动的用户列表
  • 话题
    • 获取话题列表
    • 获取话题详情
    • 获取话题互动的用户列表
  • 帖子
    • 获取帖子列表
    • 获取关注对象的帖子列表
    • 获取位置附近的帖子列表
    • 获取帖子详情
    • 获取帖子互动的用户列表
    • 获取帖子的附属用户列表
    • 获取帖子的日志列表
    • 获取帖子日志详情
    • 删除帖子
  • 评论
    • 获取评论列表
    • 获取关注对象的评论列表
    • 获取位置附近的评论列表
    • 获取评论详情
    • 获取评论互动的用户列表
    • 获取评论的日志列表
    • 获取评论日志详情
    • 删除评论
  • 编辑器
    • 快速发表(帖子)
      POST
    • 快速发表(评论)
      POST
    • 编辑器配置信息
      GET
    • 获取草稿列表(帖子)
      GET
    • 获取草稿列表(评论)
      GET
    • 创建草稿(帖子)
      POST
    • 创建草稿(评论)
      POST
    • 生成编辑草稿(帖子)
      POST
    • 生成编辑草稿(评论)
      POST
    • 获取草稿详情(帖子)
      GET
    • 获取草稿详情(评论)
      GET
    • 更新草稿内容(帖子)
      PUT
    • 更新草稿内容(评论)
      PUT
    • 提交发表(或审核)
      POST
    • 撤回审核中草稿
      PATCH
    • 删除草稿
      DELETE
  • 搜索
    • 用户
    • 小组
    • 话题
    • 帖子
    • 评论
  1. 编辑器

创建草稿(帖子)

开发中
POST
http://localhost:8080/api/v2/editor/post/create
创建草稿时,如果数据库已经有 createType=1 的草稿,并且为空时(无内容、无文件、无扩展内容),则本次创建将直接返回该草稿。
createType=2 表示为用户主动创建的草稿。

请求参数

Header 参数
X-Fresns-App-Id
string 
必需
密钥 App ID
密钥位置:控制面板->应用中心->应用密钥
默认值:
{{appId}}
X-Fresns-Client-Platform-Id
integer 
必需
平台编号,与密钥的「平台」匹配
默认值:
{{clientPlatformId}}
X-Fresns-Client-Version
string 
必需
你的客户端版本号,推荐使用语义化版本号
默认值:
{{clientVersion}}
X-Fresns-Client-Device-Info
string 
必需
交互设备信息 session_logs > device_info
压缩 Object 信息为字符串传参
默认值:
{{clientDeviceInfo}}
X-Fresns-Aid
string 
可选
账号参数(留空则视为未登录账号)
默认值:
{{aid}}
X-Fresns-Aid-Token
string 
可选
账号身份凭证(传参 aid 时必传)
默认值:
{{aidToken}}
X-Fresns-Uid
integer 
可选
用户参数(留空则视为未登录用户)
默认值:
{{uid}}
X-Fresns-Uid-Token
string 
可选
用户身份凭证(传参 uid 时必传)
默认值:
{{uidToken}}
X-Fresns-Signature
string 
签名
必需
X-Fresns-Signature-Timestamp
string 
必需
签名生成时间(当前 Unix 时间戳,精确到秒或毫秒都支持)
Body 参数application/json
createType
number 
必需
创建类型 1.快捷创建 2.编辑器创建
editorUnikey
string 
可选
是否插件编辑器,留空为否
postGid
string 
可选
小组,默认选中了小组
postTitle
string 
标题,默认自带标题
可选
postIsComment
boolean 
可选
默认配置:是否可以评论帖子
postIsCommentPublic
boolean 
可选
默认配置:是否公开评论
不公开则仅帖子作者可见
postQuotePid
string 
可选
引用的帖子 PID
非必填
content
string 
可选
正文内容,默认自带内容
isMarkdown
boolean 
可选
默认配置:内容是否为 MD 格式
isAnonymous
boolean 
默认配置:是否匿名
可选
map
object 
默认配置:位置信息
可选
extends
object (ExtendContent) 
默认配置:扩展内容
可选
textBox
array[object (ExtendContentItem) {17}] 
必需
infoBox
array[object (ExtendContentItem) {17}] 
必需
interactionBox
array[object (ExtendContentItem) {17}] 
必需
archives
array[object (ExtendParam) {4}] 
默认配置:扩展参数
可选
code
string 
标识码
可选
name
string 
名称
可选
description
string 
描述
可选
value
string 
参数值
可选
示例
{
    "createType": 0,
    "editorUnikey": "string",
    "postGid": "string",
    "postTitle": "string",
    "postIsComment": true,
    "postIsCommentPublic": true,
    "postQuotePid": "string",
    "content": "string",
    "isMarkdown": true,
    "isAnonymous": true,
    "map": {},
    "extends": {
        "textBox": [
            {
                "eid": "string",
                "type": 0,
                "textContent": "string",
                "textIsMarkdown": true,
                "infoType": 0,
                "infoTypeString": "string",
                "cover": "string",
                "title": "string",
                "titleColor": "string",
                "descPrimary": "string",
                "descPrimaryColor": "string",
                "descSecondary": "string",
                "descSecondaryColor": "string",
                "buttonName": "string",
                "buttonColor": "string",
                "position": 0,
                "accessUrl": "string"
            }
        ],
        "infoBox": [
            {
                "eid": "string",
                "type": 0,
                "textContent": "string",
                "textIsMarkdown": true,
                "infoType": 0,
                "infoTypeString": "string",
                "cover": "string",
                "title": "string",
                "titleColor": "string",
                "descPrimary": "string",
                "descPrimaryColor": "string",
                "descSecondary": "string",
                "descSecondaryColor": "string",
                "buttonName": "string",
                "buttonColor": "string",
                "position": 0,
                "accessUrl": "string"
            }
        ],
        "interactionBox": [
            {
                "eid": "string",
                "type": 0,
                "textContent": "string",
                "textIsMarkdown": true,
                "infoType": 0,
                "infoTypeString": "string",
                "cover": "string",
                "title": "string",
                "titleColor": "string",
                "descPrimary": "string",
                "descPrimaryColor": "string",
                "descSecondary": "string",
                "descSecondaryColor": "string",
                "buttonName": "string",
                "buttonColor": "string",
                "position": 0,
                "accessUrl": "string"
            }
        ]
    },
    "archives": [
        {
            "code": "string",
            "name": "string",
            "description": "string",
            "value": "string"
        }
    ]
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:8080/api/v2/editor/post/create' \
--header 'X-Fresns-App-Id;' \
--header 'X-Fresns-Client-Platform-Id;' \
--header 'X-Fresns-Client-Version;' \
--header 'X-Fresns-Client-Device-Info;' \
--header 'X-Fresns-Aid: ' \
--header 'X-Fresns-Aid-Token: ' \
--header 'X-Fresns-Uid: ' \
--header 'X-Fresns-Uid-Token: ' \
--header 'X-Fresns-Signature;' \
--header 'X-Fresns-Signature-Timestamp;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "createType": 0,
    "editorUnikey": "string",
    "postGid": "string",
    "postTitle": "string",
    "postIsComment": true,
    "postIsCommentPublic": true,
    "postQuotePid": "string",
    "content": "string",
    "isMarkdown": true,
    "isAnonymous": true,
    "map": {},
    "extends": {
        "textBox": [
            {
                "eid": "string",
                "type": 0,
                "textContent": "string",
                "textIsMarkdown": true,
                "infoType": 0,
                "infoTypeString": "string",
                "cover": "string",
                "title": "string",
                "titleColor": "string",
                "descPrimary": "string",
                "descPrimaryColor": "string",
                "descSecondary": "string",
                "descSecondaryColor": "string",
                "buttonName": "string",
                "buttonColor": "string",
                "position": 0,
                "accessUrl": "string"
            }
        ],
        "infoBox": [
            {
                "eid": "string",
                "type": 0,
                "textContent": "string",
                "textIsMarkdown": true,
                "infoType": 0,
                "infoTypeString": "string",
                "cover": "string",
                "title": "string",
                "titleColor": "string",
                "descPrimary": "string",
                "descPrimaryColor": "string",
                "descSecondary": "string",
                "descSecondaryColor": "string",
                "buttonName": "string",
                "buttonColor": "string",
                "position": 0,
                "accessUrl": "string"
            }
        ],
        "interactionBox": [
            {
                "eid": "string",
                "type": 0,
                "textContent": "string",
                "textIsMarkdown": true,
                "infoType": 0,
                "infoTypeString": "string",
                "cover": "string",
                "title": "string",
                "titleColor": "string",
                "descPrimary": "string",
                "descPrimaryColor": "string",
                "descSecondary": "string",
                "descSecondaryColor": "string",
                "buttonName": "string",
                "buttonColor": "string",
                "position": 0,
                "accessUrl": "string"
            }
        ]
    },
    "archives": [
        {
            "code": "string",
            "name": "string",
            "description": "string",
            "value": "string"
        }
    ]
}'

返回响应

🟢200成功
application/json
Body
code
integer 
必需
message
string 
必需
data
object 
必需
detail
object (PostLog) 
必需
示例
{
    "code": 0,
    "message": "ok",
    "data": {
        "detail": {
            // 通用数据结构->帖子日志信息 或者 评论日志信息
        }
    }
}
上一页
获取草稿列表(评论)
下一页
创建草稿(评论)
Built with