Skip to main content

File Service

Arttribute's File Service is a powerful tool that allows you to upload files and receive a base64 data URL in return. This service simplifies the process of adding files to your Arttribute items.

The service is available through the endpoint POST /v1/file/upoload and accepts Content-Type: multipart/form-data

Request Body

FieldDescription
fileThis field should contain the file you want to upload.

Example Requests:

Making a Node JS request with axios
const axios = require("axios");
const FormData = require("form-data");

let data = new FormData();
data.append("file", your_file);

axios
.request({
method: "post",
maxBodyLength: Infinity,
url: "https://api.arttribute.io/v1/file/upload",
headers: {
...data.getHeaders(),
},
data: data,
})
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

Upon successful file upload, the response will be a base64 data URL in the following format:

data:[<mediatype>][;base64],<data>

The base64 data URL you receive can be seamlessly used when adding an item to Arttribute, simplifying the process of associating files with your art items. By leveraging the File Service, you can efficiently upload files and integrate them with your Arttribute items, ensuring a smooth and streamlined experience for managing your creative assets