I have created server to server oath app in zoom marketplace.every time when i create the meeting it take my email id when i give diff email id it says email is not assosiate with plateform. If i buy zoom business can we create meeting with diff diff host

Can you please tell me how i achieve create meeting with diff diff host. One way is create user using /user api. If i buy business plan then also we need to use /user api.

2.i am using server to server oath apps. I call the api through restTemplate there is no setting is available in zoomMeetingRequest class. How i will active the auto_recording because it is showing default value of auto_recording.

3.in server to server oath can i get paricipants list and recording video of meeting

1 Like

hi @kajal.kumari
Thanks for reaching out to the Zoom Developer forum and welcome to our community!

For you to be able to create meetings on behalf of other users, using a Server to Server Oauth app, those users must be part of your same account. So if they are not associated with your account, it is expected that you can not create meetings for them.

For your second question, when you create a meeting using the Post meeting endpoint you should be able to enable auto_recording in your request body (with the value of local or cloud)

And for your last question, yes you should be able to get a list of participants if you have the proper scopes added in your app and the recording as well.

Cheers,
Elisa

@elisa.zoom Thanks for your reply. when i am creating a meeting using /meetings/{meetingId} after that i am change the host through schedule_for = otherEmailId
it gives me
org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: “{“code”:300,“message”:“The value that you entered for the schedule_for field is invalid. Enter a valid value and try again.”}”

Hi @kajal.kumari
Could you share with me the entire request body you are sending when updating the meeting?

sure.
create the meeting
public Map<String, String> createMeeting(String meetingName, String userId, String meetingTime, Long meetingDuration, String timezone)
throws Exception {
log.debug(“Creating zoom meeting link : {}”);

    String accessToken = getAccessToken();
    List<MediaType> medias = new ArrayList<>();
    medias.add(MediaType.APPLICATION_JSON);
    RestTemplate restTemplate = new RestTemplate();
    HttpHeaders headers = new HttpHeaders();
    headers.setBearerAuth(accessToken);
    headers.setContentType(MediaType.APPLICATION_JSON);
    headers.setAccept(medias);

    ZoomMeetingRequest zoomMeetingRequest = new ZoomMeetingRequest();
    zoomMeetingRequest.agenda = "zyz";
    zoomMeetingRequest.topic = meetingName;
    zoomMeetingRequest.start_time = meetingTime;
    zoomMeetingRequest.timezone = timezone;
    zoomMeetingRequest.duration = meetingDuration.intValue();
    // zoomMeetingRequest.schedule_for= userId;(The value that you entered for the schedule_for field is invalid. Enter a valid value and try again.)

    Settings setting = new Settings();
    // setting.registrants_email_notification = true;
    setting.join_before_host = true;
    setting.audio_recording = "cloud";
    //setting.alternative_hosts=userId; (at this it said you cannot set alternative_host at this time)
    setting.host_video = true;
    setting.participant_video = true;
    zoomMeetingRequest.settings = setting;

    String request = objectMapper.writeValueAsString(zoomMeetingRequest);

    HttpEntity<String> entity = new HttpEntity<>(request, headers);
    ResponseEntity<String> response = restTemplate.exchange(meetingUrl, HttpMethod.POST, entity, String.class);
    Map<String, Object> jsonMap = objectMapper.readValue(response.getBody(), new TypeReference<Map<String, Object>>() {});

  
    return jsonMap;
}

update the meeting-patch api
public Map<String, Object> updateMeeting(String userId, String meetingId) throws Exception {
String accessToken = getAccessToken();
List medias = new ArrayList<>();
medias.add(MediaType.APPLICATION_JSON);
RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory());
HttpHeaders headers = new HttpHeaders();
headers.setBearerAuth(accessToken);
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setAccept(medias);
String transferRequest = getMeetingUrl.replace(“{meetingId}”, meetingId);
ZoomMeetingRequest zoomMeeting = new ZoomMeetingRequest();

    Settings setting = new Settings();
    setting.alternative_hosts = userId;
    zoomMeeting.settings = setting;
    String requestBody = objectMapper.writeValueAsString(zoomMeeting);
    HttpEntity<String> transferEntity = new HttpEntity<>(requestBody, headers);
    ResponseEntity<String> responseObject = restTemplate.exchange(transferRequest, HttpMethod.PATCH, transferEntity, String.class);
    Map<String, Object> jsonMap = objectMapper.readValue(responseObject.getBody(), new TypeReference<Map<String, Object>>() {});
    return jsonMap;
}
1 Like

Thanks @kajal.kumari
I see, please make sure that you are passing a valid email address for the field “schedule_for”

Also, make sure that the user that is trying to schedule meetings on behalf of someone else has the right privileges:

1 Like

But what about alternative host why it said that you cannot assign alternative host at this time?

1 Like

Hi @kajal.kumari
Please make sure that the alternative host that you are trying to assign, belongs to your account and that it is also a licensed user.
Cheers,
Elisa