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
Field | Description |
---|---|
file | This field should contain the file you want to upload. |
Example Requests:
- NodeJS
- cURL
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);
});
curl --location 'https://api.arttribute.io/v1/file/upload' \
--form 'file=@"Bf6oIsJsk/photo.png"'
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