Classes
- Doodstream
- Doodstream
- DoodstreamError ⇐
Error
- Unauthorized ⇐
DoodstreamError
- NotFound ⇐
DoodstreamError
- UnsupportedMediaType ⇐
DoodstreamError
- Request
Doodstream
Kind: global class
new Doodstream()
A class for interacting with the Doodstream API.
This class includes methods for performing actions related to account info,
file uploads, folder management, and other operations provided by the Doodstream API.
new Doodstream(apiKey)
Creates an instance of the Doodstream class with the provided API key.
The API key will be used for authenticating requests to the Doodstream API.
Param | Type | Description |
---|
apiKey | string | The API key to authenticate with the Doodstream API. |
doodstream.accountInfo() ⇒ Promise.<Object>
Get basic information about the account associated with the provided API key.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the account information.
Throws:
doodstream.accountReports([options]) ⇒ Promise.<Object>
Get reports of your account (default last 7 days).
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the account report data.
Throws:
Param | Type | Default | Description |
---|
[options] | Object | {} | The options for retrieving the account reports. |
[options.last] | number | | The number of days of reports to retrieve (optional, default is last 7 days). |
[options.fromDate] | string | | The start date for the report in YYYY-MM-DD format (optional). |
[options.toDate] | string | | The end date for the report in YYYY-MM-DD format (optional). |
doodstream.dmcaList([options]) ⇒ Promise.<Object>
Get a list of DMCA reported files (500 results per page).
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the DMCA reported files list.
Throws:
Param | Type | Default | Description |
---|
[options] | Object | {} | The options for retrieving the DMCA reported files list. |
[options.perPage] | number | | The number of results per page (optional, default is 500). |
[options.page] | number | | The page number for pagination (optional). |
doodstream.uploadUrl() ⇒ Promise.<Object>
Get the URL for uploading local files.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the upload URL for local files.
Throws:
doodstream.localUpload(filePath) ⇒ Promise.<Object>
Upload local files to the server using the API.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the file upload.
Throws:
Param | Type | Description |
---|
filePath | string | The file path of the local file to upload. |
doodstream.cloneVideo(fileCode, [options]) ⇒ Promise.<Object>
Copy or clone your own or another user's file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the clone operation.
Throws:
Param | Type | Default | Description |
---|
fileCode | string | | The file code of the file to clone. |
[options] | Object | {} | Optional parameters for the cloning process. |
[options.folderId] | string | | The folder ID where the file will be copied to (optional). |
doodstream.remoteAdd(url, [options]) ⇒ Promise.<Object>
Upload files using direct links.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the upload operation.
Throws:
Param | Type | Default | Description |
---|
url | string | | The URL of the file to upload. |
[options] | Object | {} | Optional parameters for the upload. |
[options.folderId] | string | | The folder ID where the file will be uploaded to (optional). |
[options.newTitle] | string | | The new title to set for the uploaded file (optional). |
doodstream.remoteList() ⇒ Promise.<Object>
Get the list of remote uploads and their status.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the list of remote uploads and their status.
Throws:
doodstream.remoteStatus(fileCode) ⇒ Promise.<Object>
Get the status of a remote upload.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the status of the remote upload.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to check the status for. |
doodstream.remoteSlots() ⇒ Promise.<Object>
Get the total and used remote upload slots.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the total and used remote upload slots.
Throws:
doodstream.remoteActions(restartErrors, [options]) ⇒ Promise.<Object>
Perform various actions on remote uploads.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the remote upload action.
Throws:
Param | Type | Default | Description |
---|
restartErrors | boolean | | Whether to restart all errors (required). |
[options] | Object | {} | Optional parameters for performing actions. |
[options.clearErrors] | boolean | | Whether to clear all errors (optional). |
[options.clearAll] | boolean | | Whether to clear all (optional). |
[options.deleteCode] | string | | The file code to delete a transfer (optional). |
doodstream.createFolder(name, [options]) ⇒ Promise.<Object>
Create a new folder.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the folder creation.
Throws:
Param | Type | Default | Description |
---|
name | string | | The name of the folder to create (required). |
[options] | Object | {} | Optional parameters for the folder creation. |
[options.parentId] | string | | The ID of the parent folder where the new folder will be created (optional). |
doodstream.renameFolder(folderId, name) ⇒ Promise.<Object>
Rename an existing folder.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the folder renaming operation.
Throws:
Param | Type | Description |
---|
folderId | string | The ID of the folder to rename (required). |
name | string | The new name for the folder (required). |
doodstream.listFolder(folderId, [options]) ⇒ Promise.<Object>
List all folders within a specified folder.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the list of folders.
Throws:
Param | Type | Default | Description |
---|
folderId | string | | The ID of the folder whose contents (subfolders) will be listed (required). |
[options] | Object | {} | Optional parameters for listing the folders. |
[options.onlyFolders] | boolean | | Whether to list only folders (optional). |
doodstream.listFiles([options]) ⇒ Promise.<Object>
List all files with optional filters.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the list of files.
Throws:
Param | Type | Default | Description |
---|
[options] | Object | {} | Optional parameters for listing the files. |
[options.page] | number | | The page number for pagination (optional). |
[options.perPage] | number | | The maximum number of videos per page (maximum 200, optional). |
[options.folderId] | string | | The ID of the folder to list files from (optional). |
[options.created] | string | | Show files uploaded after a specified timestamp or within X minutes ago (optional). |
doodstream.fileStatus(fileCode) ⇒ Promise.<Object>
Check the status of a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the status of the file.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to check the status for (required). |
doodstream.fileInfo(fileCode) ⇒ Promise.<Object>
Get detailed information about a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the file information.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to retrieve information for (required). |
doodstream.fileImage(fileCode) ⇒ Promise.<Object>
Get the splash, single, or thumbnail image of a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the file's image data.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to retrieve the image for (required). |
doodstream.renameFile(fileCode, title) ⇒ Promise.<Object>
Rename a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the file renaming operation.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to rename (required). |
title | string | The new name for the file (required). |
doodstream.moveFile(fileCode, folderId) ⇒ Promise.<Object>
Move a file from one folder to another.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the file move operation.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to move (required). |
folderId | string | The ID of the folder to move the file to (required). Use 0 to move to the root directory. |
doodstream.searchFile(searchTerm) ⇒ Promise.<Object>
Search for files using a specified search term.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the search results.
Throws:
Param | Type | Description |
---|
searchTerm | string | The term to search for in the files (required). |
Doodstream
Kind: global class
new Doodstream()
A class for interacting with the Doodstream API.
This class includes methods for performing actions related to account info,
file uploads, folder management, and other operations provided by the Doodstream API.
new Doodstream(apiKey)
Creates an instance of the Doodstream class with the provided API key.
The API key will be used for authenticating requests to the Doodstream API.
Param | Type | Description |
---|
apiKey | string | The API key to authenticate with the Doodstream API. |
doodstream.accountInfo() ⇒ Promise.<Object>
Get basic information about the account associated with the provided API key.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the account information.
Throws:
doodstream.accountReports([options]) ⇒ Promise.<Object>
Get reports of your account (default last 7 days).
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the account report data.
Throws:
Param | Type | Default | Description |
---|
[options] | Object | {} | The options for retrieving the account reports. |
[options.last] | number | | The number of days of reports to retrieve (optional, default is last 7 days). |
[options.fromDate] | string | | The start date for the report in YYYY-MM-DD format (optional). |
[options.toDate] | string | | The end date for the report in YYYY-MM-DD format (optional). |
doodstream.dmcaList([options]) ⇒ Promise.<Object>
Get a list of DMCA reported files (500 results per page).
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the DMCA reported files list.
Throws:
Param | Type | Default | Description |
---|
[options] | Object | {} | The options for retrieving the DMCA reported files list. |
[options.perPage] | number | | The number of results per page (optional, default is 500). |
[options.page] | number | | The page number for pagination (optional). |
doodstream.uploadUrl() ⇒ Promise.<Object>
Get the URL for uploading local files.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the upload URL for local files.
Throws:
doodstream.localUpload(filePath) ⇒ Promise.<Object>
Upload local files to the server using the API.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the file upload.
Throws:
Param | Type | Description |
---|
filePath | string | The file path of the local file to upload. |
doodstream.cloneVideo(fileCode, [options]) ⇒ Promise.<Object>
Copy or clone your own or another user's file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the clone operation.
Throws:
Param | Type | Default | Description |
---|
fileCode | string | | The file code of the file to clone. |
[options] | Object | {} | Optional parameters for the cloning process. |
[options.folderId] | string | | The folder ID where the file will be copied to (optional). |
doodstream.remoteAdd(url, [options]) ⇒ Promise.<Object>
Upload files using direct links.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the upload operation.
Throws:
Param | Type | Default | Description |
---|
url | string | | The URL of the file to upload. |
[options] | Object | {} | Optional parameters for the upload. |
[options.folderId] | string | | The folder ID where the file will be uploaded to (optional). |
[options.newTitle] | string | | The new title to set for the uploaded file (optional). |
doodstream.remoteList() ⇒ Promise.<Object>
Get the list of remote uploads and their status.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the list of remote uploads and their status.
Throws:
doodstream.remoteStatus(fileCode) ⇒ Promise.<Object>
Get the status of a remote upload.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the status of the remote upload.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to check the status for. |
doodstream.remoteSlots() ⇒ Promise.<Object>
Get the total and used remote upload slots.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the total and used remote upload slots.
Throws:
doodstream.remoteActions(restartErrors, [options]) ⇒ Promise.<Object>
Perform various actions on remote uploads.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the remote upload action.
Throws:
Param | Type | Default | Description |
---|
restartErrors | boolean | | Whether to restart all errors (required). |
[options] | Object | {} | Optional parameters for performing actions. |
[options.clearErrors] | boolean | | Whether to clear all errors (optional). |
[options.clearAll] | boolean | | Whether to clear all (optional). |
[options.deleteCode] | string | | The file code to delete a transfer (optional). |
doodstream.createFolder(name, [options]) ⇒ Promise.<Object>
Create a new folder.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the folder creation.
Throws:
Param | Type | Default | Description |
---|
name | string | | The name of the folder to create (required). |
[options] | Object | {} | Optional parameters for the folder creation. |
[options.parentId] | string | | The ID of the parent folder where the new folder will be created (optional). |
doodstream.renameFolder(folderId, name) ⇒ Promise.<Object>
Rename an existing folder.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the folder renaming operation.
Throws:
Param | Type | Description |
---|
folderId | string | The ID of the folder to rename (required). |
name | string | The new name for the folder (required). |
doodstream.listFolder(folderId, [options]) ⇒ Promise.<Object>
List all folders within a specified folder.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the list of folders.
Throws:
Param | Type | Default | Description |
---|
folderId | string | | The ID of the folder whose contents (subfolders) will be listed (required). |
[options] | Object | {} | Optional parameters for listing the folders. |
[options.onlyFolders] | boolean | | Whether to list only folders (optional). |
doodstream.listFiles([options]) ⇒ Promise.<Object>
List all files with optional filters.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the list of files.
Throws:
Param | Type | Default | Description |
---|
[options] | Object | {} | Optional parameters for listing the files. |
[options.page] | number | | The page number for pagination (optional). |
[options.perPage] | number | | The maximum number of videos per page (maximum 200, optional). |
[options.folderId] | string | | The ID of the folder to list files from (optional). |
[options.created] | string | | Show files uploaded after a specified timestamp or within X minutes ago (optional). |
doodstream.fileStatus(fileCode) ⇒ Promise.<Object>
Check the status of a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the status of the file.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to check the status for (required). |
doodstream.fileInfo(fileCode) ⇒ Promise.<Object>
Get detailed information about a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the file information.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to retrieve information for (required). |
doodstream.fileImage(fileCode) ⇒ Promise.<Object>
Get the splash, single, or thumbnail image of a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the file's image data.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to retrieve the image for (required). |
doodstream.renameFile(fileCode, title) ⇒ Promise.<Object>
Rename a specific file.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the file renaming operation.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to rename (required). |
title | string | The new name for the file (required). |
doodstream.moveFile(fileCode, folderId) ⇒ Promise.<Object>
Move a file from one folder to another.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the result of the file move operation.
Throws:
Param | Type | Description |
---|
fileCode | string | The file code of the file to move (required). |
folderId | string | The ID of the folder to move the file to (required). Use 0 to move to the root directory. |
doodstream.searchFile(searchTerm) ⇒ Promise.<Object>
Search for files using a specified search term.
Kind: instance method of Doodstream
Returns: Promise.<Object>
- - A promise that resolves to the search results.
Throws:
Param | Type | Description |
---|
searchTerm | string | The term to search for in the files (required). |
DoodstreamError ⇐ Error
Kind: global class
Extends: Error
new DoodstreamError(code, message)
Custom error class that extends the built-in Error class.
Represents a general error for the Doodstream application.
Param | Type | Description |
---|
code | string | The error code associated with the error. |
message | string | The error message describing the error. |
Kind: global class
Extends: DoodstreamError
new Unauthorized(code, message)
Custom error class for unauthorized access, extends DoodstreamError.
Represents an error when the user is not authorized to perform a given action.
Param | Type | Description |
---|
code | string | The error code associated with the unauthorized error. |
message | string | The error message describing the unauthorized access. |
Kind: global class
Extends: DoodstreamError
new NotFound(code, message)
Custom error class for not found errors, extends DoodstreamError.
Represents an error when the requested resource cannot be found.
Param | Type | Description |
---|
code | string | The error code associated with the not found error. |
message | string | The error message describing the missing resource. |
Kind: global class
Extends: DoodstreamError
new UnsupportedMediaType(code, message)
Custom error class for unsupported media type errors, extends DoodstreamError.
Represents an error when the media type of the request is unsupported by the server.
Param | Type | Description |
---|
code | string | The error code associated with the unsupported media type error. |
message | string | The error message describing the unsupported media type. |
Request
Kind: global class
new Request()
A class that provides utility methods for making HTTP requests
using Axios. It includes methods for sending GET and POST requests,
with handling for API key validation errors.
Request.get(url) ⇒ Promise.<Object>
Makes a GET request to the specified URL using Axios.
If the response contains a specific error message related to the API key,
an Unauthorized error is thrown.
Kind: static method of Request
Returns: Promise.<Object>
- - The data returned from the GET request.
Throws:
Unauthorized
- If no API key is provided or if the API key is invalid.
Param | Type | Description |
---|
url | string | The URL to send the GET request to. |
Makes a POST request to the specified URL using Axios.
If the response contains a specific error message related to the API key,
an Unauthorized error is thrown.
Kind: static method of Request
Returns: Promise.<Object>
- - The data returned from the POST request.
Throws:
Unauthorized
- If no API key is provided or if the API key is invalid.
Param | Type | Default | Description |
---|
url | string | | The URL to send the POST request to. |
[data] | Object | {} | The data to send in the body of the POST request (optional). |
[headers] | Object | {} | The headers to include with the POST request (optional). |