How to rename a participant using the Zoom Apps SDK?

My app has various AI agents participating. I want to be transparent and display the name of the agent currently active on the host computer. How can I do this? Any particluar scope/API I need to activate? FYI: callZoomApi(‘rename’) returns error 10009 (API not supported)

I figured it out. Posting the solution (simplified with minimum error checking) here in case some else runs into the same problem:

async function renameParticipant(expertName) {
// Check if we’re in a meeting
if (!isAuthenticated || runningContext !== ‘inMeeting’ || !meetingContext) {
return;
}

// Check if API is available
if (!zoomSdk || !zoomSdk.setParticipantScreenName) {
console.error(‘setParticipantScreenName API not available’);
return;
}

// Get participantUUID from userContext or fetch from participants
let participantUUID = userContext?.participantUUID;

if (!participantUUID && zoomSdk.getMeetingParticipants) {
const { participants } = await zoomSdk.getMeetingParticipants();
const currentUser = participants?.find(p =>
p.screenName === userContext?.screenName ||
p.participantUUID === userContext?.participantUUID
);
if (currentUser) {
participantUUID = currentUser.participantUUID;
}
}

if (!participantUUID) {
console.error(‘participantUUID not available’);
return;
}

// Call the API
try {
const result = await zoomSdk.setParticipantScreenName({
participantUUID: participantUUID,
screenName: expertName
});
console.log(‘Participant renamed successfully:’, result);
} catch (error) {
console.error(‘Failed to rename participant:’, error);
}
}

2 Likes

hi @Ernst ,

Yes the key here is ParticipantScreenName.

Glad to see you found the answer. And have recognised that if the participant is in the waiting room or a breakout room, they will not be on the participant list to be seen.

All the best

John

1 Like