Skip to content

General API Endpoints

Lewis L. Foster edited this page May 2, 2020 · 3 revisions

General API Endpoints

FILES

/api/upload - POST - Upload a file

Headers

  • Auth - The API key to authenticate

Body (multipart/form-data)

  • file - The file to be uploaded

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • FileLink - If the upload was successful, this contains the link to the uploaded file (STR)

/uploads/<filename> - GET - Get an uploaded file

Headers

  • N/A

Body

  • N/A

Response (MIME type of uploaded file)

  • Binary Data

LINKS

/api/url - POST - Create a short link

Headers

  • Auth - The API key to authenticate
  • url - The long URL to shortern

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • shorturl - If the request was successfuly, this will conntain the shorterned link (STR)

/link/<linkid> - GET - Get redirected to the long URL of a short link

Headers

  • N/A

Body

  • N/A

Response

  • HTTP 302 - A HTTP 302 redirect to the long URL

Clone this wiki locally