API Endpoint(s) and/or Zoom API Event(s)
Update Digital Signage library playlist content items
Description
I have a Google Apps Script (Javascript) application that’s uploading an image to Zoom and then replacing the playlist on a Zoom Room with the image.
I confirmed that both the playlist ID and content ID are correct. The URI matches what’s in the docs as well. My Server-to-server Zoom app is authorized, activated, and has the zoom_rooms:write:digital_signage_library_playlists:admin
scope enabled.
/**
* Replaces all content in a playlist with a new list of content items.
* @param {string} playlistId The ID of the playlist to update.
* @param {Array<Object>} newContents An array of content objects to set as the new playlist.
*/
function updatePlaylistContents(playlistId, newContents) {
console.log(newContents);
const accessToken = getZoomAccessToken();
const url = `https://api.zoom.us/v2/rooms/content/digital_signage/playlists/${playlistId}/contents`;
const payload = JSON.stringify({ contents: newContents });
const options = {
method: 'put',
contentType: 'application/json',
headers: { 'Authorization': `Bearer ${accessToken}` },
payload: payload,
muteHttpExceptions: true
};
const response = UrlFetchApp.fetch(url, options);
if (response.getResponseCode() >= 400) {
throw new Error(`Failed to update playlist: ${response.getContentText()}`);
}
}
Error?
The script can call other parts of the Zoom API but only on this specific endpoint will I get
Error: Failed to update playlist: {"code":2300,"message":"This API endpoint is not recognized."}
How To Reproduce
- Open an Apps Script project and add the OAuth2 library
- Create a server to server app with the scope and activate it
- Try to upload a new playlist object using existing zoom library content
1. Request URL / Headers (without credentials or sensitive info like emails, uuid, etc.) / Body
{ method: 'put',
contentType: 'application/json',
headers: { Authorization: 'Bearer xxxxxxxx' },
payload: '{"contents":[{"content_id":"fs-xxxxxxxxxxx","content_duration":30}]}',
muteHttpExceptions: true }
2. Authentication method or app type
Server-to-server app
3. Any errors
{"code":2300,"message":"This API endpoint is not recognized."}