I was able to get this working in Google App Script:
const importMeetingIntoMoodle = (meetingId, courseId) => {
const timestamp = Date.now();
const payload = [{
meetingId: meetingId,
contextId: courseId.trim(),
domain: DOMAIN
}];
const headers = {
“X-Lti-Signature”: getLtiSignature(timestamp)
};
try{
return UrlFetchApp.fetch(`https://applications.zoom.us/api/v1/lti/rich/meeting/bulkImport?key=${ZOOM_LTI_KEY}×tamp=${timestamp}`,
{
method: ‘POST’,
contentType: ‘application/json’,
headers: headers,
payload: JSON.stringify(payload)
});
}
catch(e){}
}
const getLtiSignature = (timestamp) => {
const signatureBaseString = key=${ZOOM_LTI_KEY}×tamp=${timestamp}
const signature = Utilities.computeHmacSignature(Utilities.MacAlgorithm.HMAC_SHA_1,signatureBaseString, ZOOM_LTI_SECRET);
return encodeURIComponent(Utilities.base64Encode(signature).replace(/=+$/, ‘’));
}
As you can see, you have to encode the signature, remove the trailing equals sign (=), then encode to a URL safe string. Shoot me a reply if you have questions.