You are on page 1of 7

Block chain file storage API document

**guide:

200: StatusOK

404: StatusNotFound

503: StatusServiceUnavailable

Name Package File storage module

Name API Upload File

Description Upload file

/fe6b561cf1187e106e3dfb6829b2e12c78783
Route

Method Post

jwt-token: before you run api , you must run login for
Header User api.

Not json object {


uploadFile file
    Ownerpk  string
    FileName string
Request Form data     FileType string
Template     FileHash string= hash of the file
    Timefile string
    Signture string = filFileName + FileType +FileHash +
Ownerpk + timef
}
Status 503:'{"MessageAPI": "file too big"}'
Status 503:'{"MessageAPI":"invalid file"}
Status 503:'{"MessageAPI”:
"file name does not match + extension"}
Status 503:'{"MessageAPI":
"file extension does not match"}
Status 503:'{"MessageAPI": " file hash does not  match"}
Response JSON
Status 503:'{"MessageAPI": "please check your time"}
Template
Status 503:'{"MessageAPI":"public key  not exist"}
Status 503:'{"MessageAPI":"
"You are not allowed to Upload file""}
{ status: "200", '{"MessageAPI":"
File Upload Successfully "}

Name Package File storage module


ExploreFiles
Name API

User see meta data of this files


Description

/a9f0be2e898c28ac59c79d642722b88966c
Route

Method post

jwt-token: before you run api , you must run login for
Header User api.

{
    " PublicKey": "string",
Request JSON     " Password": "string"
Template }

Status 503:{"MessageAPI":"please enter your correct


request"}
Status 503: {"MessageAPI":"error in public key"}
Status 503: {"MessageAPI":"error in password"}
Response JSON { status: "200", data={ [] array of meta data , total size of files
Template }
OwnedFiles[]
** array of file list owned to me == can do download file ==delete file
SharedFile[]
** array of file list shared to me == can do download file== unshare file
Name Package File storage module

RetriveFiles
Name API

User can retrieve file from link


Description

/abb3e140af96a1dfd63803e716473c
Route

Method post

jwt-token: before you run api , you must run login for
Header User api.

{
    " PublicKey": "string",
    " Password": "string",
Request JSON "FileID":"string",
Template "Time":"string",
"Signture":"string"=> PublicKey+ Password+ FileID
}

Status 503:{"MessageAPI":"please enter your correct


request"}
Status 503: {"MessageAPI":"error in public key"}
Status 503: {"MessageAPI":"error in password"}
Status 503: {"MessageAPI":"please check your time"}
Response JSON Status 503: {"MessageAPI":"you are
Template not allowed to download"}
Status 503: {"MessageAPI":" You don't have this file or
share to you"}
Status 503: {"MessageAPI":" server is down"}

{ status: "200", {"MessageAPI":"Link of file"}

Name Package File storage module

DeleteFiles
Name API
User can delete his file
Description

/bbfcf281d1c9c237c81e7b5526280
Route

Method post

jwt-token: before you run api , you must run login for
Header User api.

{
    " PublicKey": "string",
    " Password": "string",
Request JSON "FileID":"string",
Template "Time":"string",
"Signture":"string"=> PublicKey+ Password+ FileID
}

Status 503:{"MessageAPI":"please enter your correct


request"}
Status 503: {"MessageAPI":"error in public key"}
Status 503: {"MessageAPI":"error in password"}
Status 503: {"MessageAPI":"please check your time"}
Response JSON
Status 503: {"MessageAPI":"you are not allowed to delete
Template
file"}
Status 503: {"MessageAPI":" You don't have this file or
share to you"}
{ status: "200",{"MessageAPI":"File Deleted Successfully
}

Name Package File storage module

Share File
Name API
User can share his file
Description

/c4f5cf2170b878cfeb691eeb8a795
Route

Method post

jwt-token: before you run api , you must run login for
Header User api.

{
    " PublicKey": "string",
    " Password": "string",
"FileID":"string",
Request JSON
"PermissionPkList":"[]string",
Template
"Signture":"string"=> PermissionPkList + FileID
+ PublicKey
}

Status 503:{"MessageAPI":"please enter your correct


request"}
Status 503: {"MessageAPI":"error in public key"}
Status 503: {"MessageAPI":"error in password"}
Status 503: {"MessageAPI":"please check your time"}
Status 503: {"MessageAPI":"you are not allowed to share
Response JSON
file"}
Template
Status 503: {"MessageAPI":" You don't have this file"}
Status 503:{"MessageAPI":"this public key is not
associated with any account"}
{status:"200",{"MessageAPI":"you shared file successfull
y
}

Name Package File storage module


Name API Unshare file

User can Unshare his file


Description

/fbd4f20dfe6b57e8979c7bb41bc
Route

Method post

jwt-token: before you run api , you must run login for
Header User api.

{
    " PublicKey": "string",
    " Password": "string",
Request JSON
"FileID":"string",
Template
"Signture":"string"=> PublicKey+ Password+ FileID
}

Status 503:{"MessageAPI":"please enter your correct


request"}
Status 503: {"MessageAPI":"error in public key"}
Status 503: {"MessageAPI":"error in password"}
Response JSON Status 503: {"MessageAPI":"please check your time"}
Template Status 503: {"MessageAPI":"you are
not allowed to unshare file"}
Status 503: {"MessageAPI":"you not take share file"}
{ status: "200",{"MessageAPI":"you unshare file
successfully}

You might also like