HTMLify - API Reference
Endpoints
Search API
Endpoint: /api/search
Method: GET
Arguments:
q |
Query sting |
Sample Response:
{"result-count": 1, "results": [{ "comments": "0", "id": 3486, "mode": "r", "name": "filename.ext", "owner": "username", "path": "username/filename.ext", "snippet": "Snippet of file content maching the query string", "views": 32, "weight": 4 } ]}
Embed API
Endpoint: /api/embed
Method: GET
Arguments:
id |
File ID |
footer |
OPTIONAL, true | flase, by default true, show/hide snippet footer |
raw-button |
OPTIONAL, true | flase, by default true, show/hide snippet Raw Button |
live=button |
OPTIONAL, true | flase, by default true, show/hide snippet Live Button |
download-button |
OPTIONAL, true | flase, by default true, show/hide snippet Download Button |
copy-button |
OPTIONAL, true | flase, by default true, show/hide snippet Copy Button |
File API
Endpoint: /api/file
Method: GET
Arguments:
id |
File ID |
Sample Response:
{"type": "text", "title": "File's name or title", "url": "Files's url", "content": "File content if the file is a text file", "owner": "username"}
File Creation API
Endpoint: /api/paste
Method: POST
Arguments:
api-key |
Your API key |
username |
Your Username |
content |
File Content |
title |
File title |
ext |
OPTIONAL, file extention, txt by default |
as-guest |
true | flase, OPTIONAL, by default: flase |
password |
OPTIONAL, file password |
mode |
OPTIONAL, | s | p | r |, file mode |
visibility |
OPTIONAL, | p | o |, file visibility, default p |
Sample Response:
{"url":"file-url", "id":125}
File Edit API
Endpoint: /api/edit
Method: POST
Arguments:
id |
File ID |
username |
Your Username |
api-key |
Your API Key |
content |
New Content for the file |
Sample Response:
{"success":"8 bytes written"}
File Deletation API
Endpoint: /api/delete
Method: POST
Arguments:
id |
File ID |
api-key |
Your api key |
username |
Your username |
Sample Response:
{"success":"file deleted"}
ShortLink API
Endpoint: /api/shortlink
Method: GET
Arguments:
id |
ShortCode by ID |
url |
ShortCode URL, new shortlink will created if not found |
shortcode |
Get ShortLink by shortcode |
Sample Response:
{"id": 2, "href": "/redirection/address", "hits": 4, "shortcode": "abcd", "url": "http://127.0.0.1:5000/r/abcd"}
Notification API
Endpoint: /api/notification
Method: POST
Arguments:
username |
Required, your username |
api-key |
Required, API KEY assosiaed to the username |
id |
If your want to get single notification details, keep empty if want all |
markseen |
Use this to mark a notification as seen, |
Comment API
Endpoint: /api/comment
Method: POST
Arguments:
username |
Required, your username |
api-key |
Required, API KEY assosiated with username |
id |
To get comment info per a perticular command |
delete |
Provide comment ID to delete comment |
file |
File id you wan to comment on it |
content |
Required if file parameter is provided |
Status Codes
0 |
OK |
1 |
MISSING PARAMETERS |
2 |
INVALID PARAMETERS |
3 |
UNAUTORISED OPRATION |
4 |
INVELID REQUEST METHOD |
5 |
API RATE LIMIT EXCEED |
6 |
Requested content not found |