Skip to content

Admin API Endpoints

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

Admin API Endpoints

FILES

/api/admin/listfiles - GET - List all files uploaded

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration

Body

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • files - An array of the filenames of all uploaded files

/api/admin/uploadfile - POST - Upload a file with a custom name

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • Auth - The API key for the uploaded file
  • filename - The filename to save the file as

Body (multipart/form-data)

  • file - Binary Data

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • FileLink - The link to the uploaded file

/api/admin/deletefile - DELETE - Deletes an uploaded file

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • Auth - The API key for authorization

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)

/api/admin/renamefile - PUT - Rename an uploaded file

Headers

  • username - The username for admin authentication set in configuration
  • 'password' - The password for admin authentication set in configuration
  • Auth - The API key for authorization
  • oldfilename - The current filename of the file to be renamed
  • newfilename - The new filename for the current file

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • NewLink - The new link for the file

LINKS

/api/admin/listlinks - GET - List all files uploaded

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration

Body

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • links - An array of the filenames of all uploaded files

/api/admin/url - POST - Upload a file with a custom name

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • Auth - The API key for the uploaded file
  • url - The long URL to shortern

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • FileLink - The link to the uploaded file

/api/admin/deletelink - DELETE - Deletes an uploaded file

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • Auth - The API key for authorization
  • id - The link ID to delete

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)

/api/admin/renamelink - PUT - Rename an uploaded file

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • Auth - The API key for authorization
  • oldid - The current ID of the link to be renamed
  • newid - The new ID of the redirect ID

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • NewLink - The new link for the redirect

API KEYS

/api/admin/newkey - GET - Generate an API key for use

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • name - The name to associate with the API key

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)
  • newkey - The freshly generated API key

/api/admin/revokekey - DELETE - Revokes an API key

Headers

  • username - The username for admin authentication set in configuration
  • password - The password for admin authentication set in configuration
  • key - The name to associate with the API key

Body ()

  • N/A

Response (JSON)

  • Status - The response HTTP status (INT)
  • Message - Further information about Status (STR)