//native
type Telnyx = {
apiKey: string
}
/**
* Fetch recordings for a conference
* Returns recordings for a conference identified by conference_sid.
*/
export async function main(auth: Telnyx, account_sid: string, conference_sid: string) {
const url = new URL(
`https://api.telnyx.com/v2/texml/Accounts/${account_sid}/Conferences/${conference_sid}/Recordings.json`
)
const response = await fetch(url, {
method: 'GET',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 428 days ago