-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalacrity_api.txt
55 lines (39 loc) · 1.71 KB
/
alacrity_api.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ALACRITY API GUIDE
This is a basic guide on how to use Alacrity. Each request to alacrity requires well formed json in this format:
{
"command" : "command_syntax_here",
"path" : "/path/to/file",
"data" : "any_base64_encoded_data"
}
The "command" value is for alacrity command
The "path" value is the path where data will be stored and where data can be accessed
The "data" value is the data that will be stored in the path specified. This must be base64 encoded
The file's mimetype will be determined by the file extension extracted from the path
ALACRITY COMMANDS
This is a list of commands Alacrity currently have
Command: Store data
The "store" command is sent together with path and data fields. Data will be stored in the path provided.
The file's mimetype will be determined by the file extension given in the path
Syntax: "store"
Path field: "/path/to/file"
Data filed: "any base64 encoded data"
Example: {"command":"store", "path":"/path/to/file", "data":"any base64 encoded data"}
Command: View data
The "view" command is sent together with path field, it ignores the data field being sent. Data will be returned using the path provided.
All view data will be base64 encoded. You can assume the file mime type based on file extension, but its not guaranteed.
Syntax: "view"
Path field: "/path/to/file"
Data field: "any base64 encoded data"
Example: {"command":"view", "path":"/path/to/file"}
ALACRITY RESPONSE
Success store
{"saved" : "/path/to/file"}
Success view
{"view" : "base64 encoded data", "file" : "/path/to/file"}
Error
{"error" : "error code"}
ALACRITY ERROR CODES
e0001 = "error: file does not exist"
e0002 = "error: cant decode message"
e0003 = "error: no data received"
e0004 = "error: couldnt parse command"