📌Fetch Types
Here you will learn the basic types of requests of the CDN, in how to get a file, download it, delete it and upload it;
/FILE (FETCH FILE)
To fetch an existing file you will need its ID and Extension parsed into the URL. FILEID = Id of the file EXTENSION = Extension of the stored file (.png, .jpg, .gif)
GET https://cdn.nextfur.net/v1/file/<FILEID><FILE EXTENSION>let version = "v1"
let fileID = "<STRING>"
let extension = ".png||.jpg||.gif"
//Example image 151564006826.png
let response = await fetch(`https://cdn.nextfur.net/${version}/file/${fileID}${extension}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
action: "get"
})
})
let data = response.json() //Get the FILE as an rendered IMAGETo get an image, or a file you don't need authorization from the API, only if that information requires an Authorization, and if so, it should be parsed by body as a token;
/UPLOAD
To upload a file to the CDN for distribution; UPLOAD TYPE = (Not mandatory) TYPES: * file = Any filetype * avatar = A image that will change the user's avatar * banner = A image that will change the user's banner
POST https://cdn.nextfur.net/v1/upload?type=<UPLOADTYPE>let version = "v1"
let type = "file||avatar||banner"
let token = "<USERS API TOKEN>"
const form = document.getElementbyId('yourhtmlform')
let formData = new FormData(form)//NEEDS TO PROVIDE AN INPUT FOR IMAGE
formData.append('authorization', token);
let response = await fetch(`https://cdn.nextfur.net/${version}/upload?type=${type}`, {
method: 'POST',
body: formData
})
let data = response.json() //get the image ID and information if successfully uploadedThe result after uploading an image should return something like this:
{
"originalName": "429321829158.webp",
"fileID": "081083974133",
"extension": ".webp",
"mimetype": "image/webp",
"size": 30346,
"uploadedAt": "2025-10-13T02:58:23.133Z",
"uploader": "127.0.0.1",
"urls": {
"view": "http://cdn.nextfur.net/v1/file/081083974133.webp",
"download": "http://cdn.nextfur.net/v1/download/081083974133.webp"
}
}Last updated