Skip to content

Create Draft

  • Endpoint Path: /api/v2/editor/{type}/create
  • Method: POST
  • Request: Rest + application/json

Headers Optional Parameter

Parameter NamePublic Mode (Required)Private Mode (Required)
X-Fresns-Aidrequiredrequired
X-Fresns-Aid-Tokenrequiredrequired
X-Fresns-Uidrequiredrequired
X-Fresns-Uid-Tokenrequiredrequired

Rest Params

Parameter NameTypeRequiredDescription
typeStringrequiredpost or comment

Body Params

Parameter NameTypeRequiredPost DescriptionComment Description
createTypeNumberrequiredCreation type 1. Quick create 2. Editor create
postQuotePidStringoptionalQuoted post PID
Not required
Post-specific
editorFskeyStringoptionalIs it a plugin editor, empty means no
postGidStringoptionalGroup, default selected groupPost-specific
postTitleStringoptionalTitle, default with titlePost-specific
postIsCommentDisabledBooleanNOWhether comments are disabledPost-specific
postIsCommentPrivateBooleanNOWhether the comment is private
Visible only to the comment author and post author
Post-specific
commentPidStringoptionalComment-specificComment on which post, required
commentCidStringoptionalComment-specificEmpty means comment on post
Value means reply to this comment
contentStringoptionalMain content, default with content
isMarkdownBooleanoptionalis content in MD format
isAnonymousBooleanoptionalis it anonymous
mapObjectoptionallocation information
extendsArrayoptionalextended content
archivesArrayoptionalextended parameters

Request Description

  • When creating a draft, if there is already a draft with createType=1 in the database and it is empty (no content, no files, no extended content), this creation will directly return that draft.
  • createType=2 indicates a draft actively created by the user.

Return

json
{
    "code": 0,
    "message": "ok",
    "data": {
        "detail": {
            // Common Data Structure -> Post Log Info or Comment Log Info
        },
        "editControls": {
            "isEditDraft": "Boolean / Whether it is an editable draft",
            "editableStatus": "Boolean / Whether it can be edited",
            "editableTime": "String / Remaining editable time, for example 03:00 means 3 minutes left",
            "deadlineTime": "String / The specific date and time of the editable deadline, for example 2022-07-01 15:05:00"
        }
    }
}

Released under the Apache-2.0 License