创建草稿(帖子)
开发中
POST
/api/v2/editor/post/create
createType=1
的草稿,并且为空时(无内容、无文件、无扩展内容),则本次创建将直接返回该草稿。createType=2
表示为用户主动创建的草稿。请求参数
Header 参数
X-Fresns-App-Id
string
必需
密钥位置:控制面板->应用中心->应用密钥
默认值:
{{appId}}
X-Fresns-Client-Platform-Id
integer
必需
默认值:
{{clientPlatformId}}
X-Fresns-Client-Version
string
必需
默认值:
{{clientVersion}}
X-Fresns-Client-Device-Info
string
必需
压缩 Object 信息为字符串传参
默认值:
{{clientDeviceInfo}}
X-Fresns-Aid
string
可选
默认值:
{{aid}}
X-Fresns-Aid-Token
string
可选
默认值:
{{aidToken}}
X-Fresns-Uid
integer
可选
默认值:
{{uid}}
X-Fresns-Uid-Token
string
可选
默认值:
{{uidToken}}
X-Fresns-Signature
string
签名
X-Fresns-Signature-Timestamp
string
必需
Body 参数application/json
createType
number
必需
editorUnikey
string
可选
postGid
string
可选
postTitle
string
标题,默认自带标题
postIsComment
boolean
可选
postIsCommentPublic
boolean
可选
不公开则仅帖子作者可见
postQuotePid
string
可选
非必填
content
string
可选
isMarkdown
boolean
可选
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": {
// 通用数据结构->帖子日志信息 或者 评论日志信息
}
}
}
修改于 2023-03-28 07:32:48