Uploading audio
Getting started
In order to send audio to the Audio API, you can do so by sending a POST request to the https://api.fivemanage.com/api/audio (opens in a new tab) endpoint.
To upload audio, simply submit a form with a form field called file
with your audio as value.
A lot like images, audio uploads also allow for metadata through the metadata
form field.
Examples
const axios = require('axios');
const fs = require('fs');
const apiKey = 'YOUR_API_TOKEN';
const url = 'https://api.fivemanage.com/api/audio';
const formData = new FormData();
formData.append('file', yourAudioBlob);
// Optional metadata field (JSON string)
formData.append("metadata", JSON.stringify({
name: 'My audio',
description: 'This is a recording of something cool",
// or any other field
}));
axios.post(url, formData, {
headers: {
Authorization: apiKey,
}
}).then(res => {
console.log(res.data.url);
}).catch(err => {
console.error(err);
});