api wrapper
$ npm install --save gofile-apiwrapper
const gofileApiwrapper = require('gofile-apiwrapper');
const api = new gofileApiwrapper.apiGofile("email","token");
// e.g.
api.getBestServer((err,body)=>{
//body contain data
//err is null until https get request give error
});
api wrapper class for Gofile rest api
string
function
Callback for getting response from https call
api wrapper class for Gofile rest api
Kind: global class
string
string
Param | Type | Default | Description |
---|---|---|---|
[email] | string |
"\"\"" |
your email |
[token] | string |
"\"\"" |
your apikey on profile page |
Kind: instance property of apiGofile
Properties
Name | Description |
---|---|
your account email |
Kind: instance property of apiGofile
Properties
Name | Description |
---|---|
token | your account apikey |
setter of email
Kind: instance property of apiGofile
Param | Type |
---|---|
string |
string
getter of email
Kind: instance property of apiGofile
Returns: string
- email
setter of token
Kind: instance property of apiGofile
Param | Type |
---|---|
token | string |
string
getter of token
Kind: instance property of apiGofile
Returns: string
- token
The server chosen with this function will have better connection quality.
Kind: instance method of apiGofile
Param | Type | Description |
---|---|---|
callback | httpsResponse |
handles the https request result |
Data returned are : email, account type (e.g. donor, standar), file count, file size.
Kind: instance method of apiGofile
Param | Type | Default | Description |
---|---|---|---|
[token] | string |
null |
someone's token (if null it will use the token setted in the class) |
callback | httpsResponse |
handles the https request result |
Data returned are all upload with all data of file uploaded.
Kind: instance method of apiGofile
Param | Type | Default | Description |
---|---|---|---|
[token] | string |
null |
someone's token (if null it will use the token setted in the class) |
callback | httpsResponse |
handles the https request result |
It delete all upload containing the file name.
Kind: instance method of apiGofile
Param | Type | Default | Description |
---|---|---|---|
[name] | string |
null |
name of the file (if null it delete all upload) |
[code] | srting |
|
code of specific upload (if null it delete all upload with the file inside) |
[token] | string |
null |
someone's token (if null it will use the token setted in the class) |
callback | httpsResponse |
handles the https request result |
It delete all file in an upload or all upload if code of upload is not specified, if the upload have only 1 file use delete upload
Kind: instance method of apiGofile
Param | Type | Default | Description |
---|---|---|---|
name | string |
name of the file | |
[code] | srting |
|
code of specific upload |
[token] | string |
null |
someone's token (if null it will use the token setted in the class) |
callback | httpsResponse |
handles the https request result |
If you specify the adminCode of an existing upload, then the file will be added to this upload.
Kind: instance method of apiGofile
Param | Type | Default | Description |
---|---|---|---|
file | file |
Must contain one file. | |
[ac] | string |
"\"\"" |
The admin code of an upload. If you specify it, the file will be added to this upload. |
[email] | string |
"\"\"" |
Must contain email adress syntax. The upload will be stored on this account. if is null it take the email assigned to the class in the consrtuctor or using setter |
[description] | string |
"\"\"" |
Must contain description of the upload |
[password] | string |
"\"\"" |
Must contain password of the upload(min 6 char) |
[tags] | string |
"\"\"" |
Must contain tags of the upload. If multiple tags, seperate them with comma (example : tags1,tags2) |
[expire] | string |
"\"\"" |
Must contain expiration date of the upload in the form of timestamp. |
server | string |
the server to upload the file in | |
callback | httpsResponse |
handles the https request result |
string
Kind: global constant
Default: "https://apiv2.gofile.io/"
function
Callback for getting response from https call
Kind: global typedef
Param | Type | Description |
---|---|---|
err | Error |
error of https request |
body | string | * |
body of https response |
MIT © BDream