Skip to content

Create Draft

  • Endpoint Path: /api/fresns/v1/editor/{type}/draft
  • Method: POST
  • Request: Rest + application/json

Headers Optional Parameter

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

Path Variables

KeyTypeRequiredDescription
typeStringrequiredpost or comment

Body Params

KeyTypeRequiredDescription
createTypeNumberrequiredCreation type 1. Quick create 2. Editor create
editorFskeyStringoptionalIs it a plugin editor, empty means no
commentPidStringoptionalComment-Only Comment on this post
commentCidStringoptionalComment-Only Reply to this comment
quotePidStringoptionalPost-Only Quoted Post ID
gidStringoptionalPost-Only Group
titleStringoptionalPost-Only Title
contentStringoptionalContent
Insert the file in the content in the format [file:{fid}]
isMarkdownBooleanoptionalContent in MD format
isAnonymousBooleanoptionalAnonymous
commentPolicyNumberoptionalPost-Only Who can comment?
1 Everyone 2 People you follow 3 People you follow or verified 4 No one is allowed 5 Only users you mention
commentPrivateBooleanoptionalPost Are all comments private
Comment Is this comment private
Private is only visible to the author of the comment and the author of the post.
gtidStringoptionalGeotag ID
locationInfoObjectoptionalLocation Info
archivesArrayoptionalArchive Parameter
extendsArrayoptionalExtend Content

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 -> Draft 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