auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const shortid = require('shortid')
// A recording with a topic "Test Recording" and file type MP4 becomes "test_recording-abc123.mp4"
// We append a "short ID" to avoid collisions for recordigs with the same topic name
const meetingTopic = event.meeting_topic.replace(/[^a-zA-Z0-9]/g, '_').toLowerCase()
this.filename = `${meetingTopic}-${shortid.generate()}.${event.file_type.toLowerCase()}`
this.downloadURL = `${event.download_url}?access_token=${event.download_token}`
auths
objectThe URL of the file to upload to S3
The AWS region tied to your S3 bucket, e.g us-east-1 or us-west-2
return
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params, auths) => {
}
const AWS = require("aws-sdk")
const fetch = require('node-fetch');
const format = require('date-fns/format')
const { accessKeyId, secretAccessKey } = auths.aws
const { Bucket, downloadURL, filename, region } = params
const s3 = new AWS.S3({
accessKeyId,
secretAccessKey,
region,
})
// Stream the data from HTTP request directly to S3.
// AWS' s3.upload method below accepts a Readable stream
// as the Body, which fetch returns by default.
// See https://github.com/aws/aws-sdk-js/issues/2100
const recordingResponse = await fetch(downloadURL)
this.s3Response = await s3.upload({
Bucket,
Key: `${format(new Date(), "yyyy/MM/dd/")}${filename}`, // Store in YYYY/MM/DD/ "dirs" to avoid name collisions
Body: recordingResponse.body,
}).promise()
The meeting ID or UUID
The recording delete action. trash: Move recording to the trash. delete: Delete recording permanently
async
(params, auths) => {
}
const axios = require("axios")
// See the API docs: https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingdelete
const config = {
method: "DELETE",
url: `https://api.zoom.us/v2/meetings/${params.meetingId}/recordings`,
params: {
action: params.action,
},
headers: {
Authorization: `Bearer ${auths.zoom_admin.oauth_access_token}`,
"Content-Type": "application/json"
}
}
// A 204 response indicates the recording was successfully deleted
return await axios(config)