Skip to content

File Upload

  • Endpoint Path: /api/fresns/common/v1/file/upload
  • Method: POST
  • Request: multipart/form-data

Headers Optional Parameter

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

Form-data Params

KeyTypeRequiredDescription
usageTypeStringrequiredFile usage type
usageFsidStringrequiredUsage target fsid
archiveCodeStringoptionalelementType File Archive
typeStringrequiredChoose one from image, video, audio, document
fileFilerequired
warningStringoptionalFile Warning none, nudity, violence, sensitive
moreInfoStringoptionalFile custom information (Object to String)

Request Description

usageTypeusageFsidarchiveCode
userAvatarUser uidOrUsername
userBannerUser uidOrUsername
userArchiveUser uidOrUsernameArchive code
conversationReceives the user uidOrUsername
postPost ID pid
commentComment ID comment
postDraftPost Draft ID did
postDraftArchivePost Draft ID didArchive code
commentDraftComment Draft ID did
commentDraftArchiveComment Draft ID didArchive code

Return

json
{
    "code": 0,
    "message": "ok",
    "data": {
        // Common Data Structure -> File Info
    }
}

Released under the Apache-2.0 License