Mistermanu#000
01/16/2025, 12:30 AMVapi
01/16/2025, 12:31 AMVapi
01/16/2025, 12:31 AMMistermanu#000
01/16/2025, 12:33 AMVapi
01/16/2025, 12:33 AMMistermanu#000
01/16/2025, 12:35 AMVapi
01/16/2025, 12:35 AMaxios
or the native fetch
API in TypeScript.
Here's a generic example of how you might use fetch
to retrieve an audio file:
typescript
const getAudioRecording = async (audioId: string) => {
const response = await fetch(`https://api.vapi.com/audio/${audioId}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
// Other headers as required by the API
},
});
if (!response.ok) {
throw new Error(`Error fetching audio: ${response.statusText}`);
}
return await response.blob();
};
// Usage
getAudioRecording('your-audio-id')
.then(blob => {
// Handle the audio blob, such as uploading to Supabase
})
.catch(error => {
console.error('Failed to retrieve audio recording:', error);
});
Please replace 'https://api.vapi.com/audio/${audioId}'
with the actual endpoint and 'YOUR_API_TOKEN'
with your actual API token.
If you're still having trouble finding the right properties and endpoint, I recommend reaching out to VAPI support for more detailed guidance on how to use their TypeScript SDK to retrieve audio recordings.Shubham Bajaj
01/16/2025, 4:43 PMShubham Bajaj
01/16/2025, 4:44 PMMistermanu#000
01/16/2025, 6:20 PM