Provide v1 API
API v1 should make use of text identifiers to ensure stability (IDs aren't really stable). The stable API should have the following facilities.
-
Retrieving languages ( GET /api/v1/languages
route) -
Retrieving pastes ( GET /api/v1/pastes/<identifier>
route) -
Uploading pastes ( POST /api/v1/pastes
route) -
Code execution ( POST /api/v1/run/<language>/<operation>
route - maybe it should beGET
, but having request body withGET
would be confusing)
Additionally, GET /<identifier>.txt
is considered to be part of an API.
The API should make use of CORS to allow other websites to make requests to an API. Use of API doesn't require authorization, although if user accounts were to be introduced, it should be allowed to provide authentication.
Edited by Konrad Borowski