Scaleway Object Storage

Connect with Scaleway Object Storage without any backend coding.

Overview

Scaleway Object Storage is an Object Storage service based on the S3 protocol. It allows you to store any kind of objects (documents, images, videos, etc.). Object Storage service is a cloud product which means that your objects are always available from anywhere in the world.

Objects in Object storage are accessible via the REST API. Therefore, SlashApi provide a simple API endpoint to connect with your Scaleway Object Storage data using API without writing any backend code.

Getting Started

After you create an account and log in to the dashboard, choose Scaleway Object Storage on the collections page. To make Scaleway Object Storage API we need these values:

  • Access Key
  • Secret Access Key
  • Region
  • Bucket Name

Get your access key

Let's start with Scaleway access keys to get your encryption key.

  1. Click on your organization name on top of the scaleway dashboard page.

  2. Choose Credentials menu.

  3. Generate new API Key if you don't have one.

    Key

API Endpoints

List All Files

List all files in your Scaleway Object Storage

GET
<team>/scaleway/<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/scaleway/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 Scaleway Object Storage

GET
<team>/scaleway/<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/scaleway/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 Scaleway Object Storage

GET
<team>/scaleway/<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/scaleway/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>/scaleway/<identifier>

Upload File to your Scaleway Object Storage.

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/scaleway/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 Scaleway Object Storage

DELETE
<team>/scaleway/<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/scaleway/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 Scaleway Object Storage

DELETE
<team>/scaleway/<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/scaleway/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);
    });