Dropbox

Connect with Dropbox API without any backend coding.

Overview

Dropbox is a cloud storage service, which means you can copy your files to the cloud and access them later, even if you’re using a different device.

SlashApi provide a simple API endpoint to connect with your Dropbox files using API without writing any backend code.

Getting Started

After you create an account and log in to the dashboard, choose Dropbox on the collections page. To make Dropbox API you have to Authenticate your Dropbox Account by click on the "Authenticate Account" at the top of the Dropbox form.

After authenticating you will be redirected back to the SlashApi with a Dropbox Form. In this form, you just need to provide a name for your API, click on the Submit button and your Dropbox API is ready.

API Endpoints

List All Files

List all files in your Dropbox server

GET
<team>/dropbox/<identifier>/files

Parameters

Parameter Description
recursive Operating on a directory and its contents, including the contents of any subdirectories
directory Directory root

Example

var axios = require('axios');

var config = {
    method: 'get',
    url: 'http://v1.slashapi.com/slashapi/dropbox/u2nyrJqa0f/files?directory=your-directory'
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

List All Directories

List all directories in your Dropbox server

GET
<team>/dropbox/<identifier>/directories

Parameters

Parameter Description
recursive Operating on a directory and its contents, including the contents of any subdirectories
directory Directory root

Example

var axios = require('axios');

var config = {
    method: 'get',
    url: 'http://v1.slashapi.com/slashapi/dropbox/u2nyrJqa0f/directories?directory=your-directory'
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Download File

Download File from your Dropbox server

GET
<team>/dropbox/<identifier>/download

Parameters

Parameter Description
path [required] Path to file

Example

var axios = require('axios');

var config = {
    method: 'get',
    url: 'http://v1.slashapi.com/slashapi/dropbox/u2nyrJqa0f/download?path=path-to-file'
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Upload File

POST
<team>/dropbox/<identifier>

Upload File to your Dropbox server.

Request Body

Body Description
file [required] File to upload
directory Destination directory for your uploaded file

Example

var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('file', fs.createReadStream('/path/to/file'));
data.append('directory', 'target-directory');

var config = {
    method: 'post',
    url: 'http://v1.slashapi.com/slashapi/dropbox/u2nyrJqa0f',
    headers: {
        ...data.getHeaders()
    },
    data : data
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Delete Files

Delete Files in your Dropbox server

DELETE
<team>/dropbox/<identifier>

Request Body

Body Description
files [required] Path to files. To delete multiple files, you can pass an array

Example

var axios = require('axios');
var data = JSON.stringify({
    "files": [
        "Directory/your-file.jpeg"
    ]
});

var config = {
    method: 'delete',
    url: 'http://v1.slashapi.com/slashapi/dropbox/u2nyrJqa0f',
    headers: {
        'Content-Type': 'application/json'
    },
    data : data
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });

Delete Directory

Delete directory in your Dropbox server

DELETE
<team>/dropbox/<identifier>

Request Body

Body Description
directory [required] Target directory

Example

var axios = require('axios');
var data = JSON.stringify({
    "directory": "target-directory"
});

var config = {
    method: 'delete',
    url: 'http://v1.slashapi.com/slashapi/dropbox/u2nyrJqa0f',
    headers: {
        'Content-Type': 'application/json'
    },
    data : data
};

axios(config)
    .then(function (response) {
        console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
        console.log(error);
    });