I have transcript in cloud transcripts but when I try to fetch with api’s it shows me error this recording or transcript does not exists
const zoomAudioTranscribe = async (meetingId) => {
try {
const token = await getAccessToken();
// First, check if the meeting exists
const meetingUrl = `https://api.zoom.us/v2/meetings/${meetingId}`;
const meetingResponse = await axios.get(meetingUrl, {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
});
if (meetingResponse.status === 200) {
console.log('Meeting exists, proceeding to fetch recordings.');
// Now fetch the recordings
const recordingUrl = `https://api.zoom.us/v2/meetings/${meetingId}/recordings`;
const recordingResponse = await axios.get(recordingUrl, {
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
});
const recordingFiles = recordingResponse.data.recording_files;
const transcript = recordingFiles.find(file => file.file_type === 'TRANSCRIPT');
if (transcript) {
console.log(`Transcription URL: ${transcript.download_url}`);
return transcript.download_url;
} else {
console.log('Transcription not found.');
return 'Transcription not found.';
}
}
} catch (error) {
if (error.response && error.response.data.code === 3301) {
console.error('Error: This recording or transcript does not exist.');
return 'Meeting exists, but no recording or transcript found.';
} else {
console.error(`Error: ${error.message}`);
return `Error: ${error.message}`;
}
}
};