๐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
The result after uploading an image should return something like this:
Last updated