Requests

Some basics about sending requests to our upload server.

Our upload server is used to send POST requests containing files uploaded through sharex to our website, database and bucket/cdn. You can interact with it outside of sharex so long as you have basic knowledge regarding using a restful api!


Base URL

https://cordx.lol/api/upload/sharex


Required headers

PropTypeDefault
userid
STRING
-
secret
STRING
-

Basic Usage

Before you get started please make sure you:

  1. Prepare your file for upload: The file you want to upload should be included in the body of the POST request.
    • The maximum file size is currently 500 MB for all users.
  2. Set the necessary headers: Include the following headers in your request:
    • secret: This should be the secret associated with your user account.
    • userid: This should be your Discord User ID/Snowflake.
  3. Send the POST request: You can use any HTTP client to achieve this.
NOTE
  • custom domains can interact with this api using the /api/upload/sharex endpoint!
  • Your userid and secret can be obtained in your /me/config page or by using the /profile command in our discord bot!

Curl Example

curl -X POST -H "secret: your-secret" -H "userid: your-userid" -F "file=@path-to-your-file" https://cordx.lol/api/upload/sharex

Fetch Example

NOTE
  • Both fetch and formData are built in libraries/API's.
  • This code should serve only as a template and may not work.
  • sharex is a File object representing the file to upload
const formData = new FormData();
 
formData.append('sharex', file);
 
const response = await fetch('https://cordx.lol/api/upload/sharex', {
  method: 'POST',
  headers: {
    'secret': 'your-secret',
    'userid': 'your-userid'
  },
  body: formData
});
 
if (response.ok) {
  const data = await response.json();
  console.log(data);
} else {
  console.error('Upload failed');
}

Last updated on