BobbyWibowo/lolisafe

How to access the API

Tsubajashi opened this issue · 2 comments

Hi! i wanted to use https://zz.ht/ as a basis of uploading content to it.
I wanted to implement it in pyupload, but seem to not understand how the API responses.
Is there any documentation about what kind of API Response i get, and what i would need to deliver to use it properly?

Thanks in Advance, and sorry for the inconvenience caused by this ticket.

Hi there! Unfortunately there is no documentation for the APIs, since upstream never had any, so I never really bothered making one myself.

Either way, it should be fairly straightforward to use your browser's developer tools to sniff the network requests made to your lolisafe installation and infer the schematic from it.
Otherwise you can start looking at routes/api.js for all the JSON-based APIs to see what's available, and maybe then look for the appropriate controller files from it.

All of the API requests are essentially JSON-based (aside from upload which has to be multiform, as it has to carry the file itself as a payload), so they shouldn't appear cryptic. Elevated operations will only require your token for authentication.