GoFile.io Unofficial API Wrapper

Unofficial API Wrapper for GoFile.io for easy API Calls that uses Axios and fs module.
Functions Params (required and optional)
getServer()
No Required Params
getServer()
getAccountDetails()
Required Params [usertoken]
getAccountDetails([usertoken])
deleteContent()
Required Params [contentsId, usertoken]
deleteContent([contentsId, usertoken])
deleteContent([contentsId, usertoken])
copyContent()
Required Params [contentsId, usertoken, folderIdDestination]
copyContent([contentsId, usertoken, folderIdDestination])
createFolder()
Required Params [parentFolderID, usertoken, folderName]
createFolder([parentFolderID, usertoken, folderName])
getContent()
Required Params [contentsId, usertoken]
getContent([contentsId, usertoken])
setFolderOptions()
Required Params [contentsId, usertoken, folderOptions, value]
setFolderOptions([contentsId, usertoken, folderOptions, value])
uploadFile()
Required Params [server, fileToUpload]
Optional Params [usertoken, folderID]
uploadFile([server, fileToUpload])
uploadFile([server, fileToUpload, usertoken])
uploadFile([server, fileToUpload, usertoken, folderID])
All Params
usertoken | string | The access token of an account you can get via loging in here. Can be retrieved from the profile page. | "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM" |
contentsId | string | It can be a folderId or fileId, Comma separated contentId to delete (files or folders) | "affdaa7c-134b-4397-a76f-e87970401d6d" |
folderIdDestination | string | Its the destination folderId of any folder | "affdaa7c-134b-4397-a76f-e87970401d6d" |
folderName | string | your folder name | "Testing" |
parentFolderID | string | Its the folderId of any folder | "affdaa7c-134b-4397-a76f-e87970401d6d" |
folderIdDestination | string | Its the folderId | "affdaa7c-134b-4397-a76f-e87970401d6d" |
fileToUpload | stream or buffer | the file to be uploaded on the server | fs.createReadStream("testUpload.png") |
folderID | string | Its the folderId | "affdaa7c-134b-4397-a76f-e87970401d6d" |
server | string | Can be Obtain via calling getServer() | "store1" |
folderIdDestination | string | It the folderId | "affdaa7c-134b-4397-a76f-e87970401d6d" |
folderOptions | string | Can be "public", "password", "description", "expire" or "tags" | "public" |
value | string | The value of the option to be defined. For "public", can be "true" or "false". For "password", must be the password. For "description", must be the description. For "expire", must be the expiration date in the form of unix timestamp. For "tags", must be a comma seperated list of tags. | "true , yes or on " and "false , no or off " |
FOR MORE INFO ABOUT API
Visit https://gofile.io/api
USAGES
Use require to Import
const { getAcountDetails, deleteContent, copyContent, createFolder, getContent, getServer, uploadFile, setFolderOptions } = require('./GoFileUpload.js');
const { uploadFile } = require('./GoFileUpload.js');
API Wrapper Functions
getServer()
Get the best server to recieve incoming files.
getServer().then((res)=>{
console.log(res)
})
let res = await getServer()
console.log(res)
uploadFile()
Upload one file on a specific server.
let {data} = await getServer()
let server = data.server
let fileToUpload = fs.createReadStream("testUpload.png")
uploadFile(server, fileToUpload).then((res)=>{
console.log(res)
})
let res = await uploadFile(server, fileToUpload)
console.log(res)
getAccountDetails()
Retrieving specific account information.
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
getAccountDetails(usertoken).then((res)=>{
console.log(res)
})
let res = await getAccountDetails(usertoken)
console.log(res)
deleteContent()
Delete one or multiple files/folders.
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";
deleteContent(contentsId, usertoken).then((res)=>{
console.log(res)
})
let res = await deleteContent(contentsId, usertoken)
console.log(res)
copyContent()
Available only for Premium/Subscribed Users.
Copy one or multiple contents to another folder.
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";
let folderIdDestination = "Ifgaj4c-76h9-3680-x341-e50631705d6d";
copyContent(contentsId, usertoken, folderIdDestination).then((res)=>{
console.log(res)
})
let res = await copyContent(contentsId, usertoken, folderIdDestination)
console.log(res)
createFolder()
Creates a new folder.
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let parentFolderID = "affdaa7c-134b-4397-a76f-e87970401d6d";
let folderName = "My Folder";
createFolder(parentFolderID, usertoken, folderName).then((res)=>{
console.log(res)
})
let res = await createFolder(parentFolderID, usertoken, folderName)
console.log(res)
getContent()
Available only for Premium/Subscribed Users.
Get a specific content details.
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";
getContent(contentsId, usertoken).then((res)=>{
console.log(res)
})
let res = await getContent(contentsId, usertoken)
console.log(res)
setFolderOptions()
Get a specific content details.
let usertoken = "PNxrcDBrUeAQNxdYLgWOafMtfxpXghM";
let contentsId = "affdaa7c-134b-4397-a76f-e87970401d6d";
let folderOptions = "public";
let value = "yes";
setFolderOptions(contentsId, usertoken, folderOptions, value).then((res)=>{
console.log(res)
})
let res = await setFolderOptions(contentsId, usertoken, folderOptions, value)
console.log(res)