Generate API access token using SDK

Description
it their any way to create access token from android zoom sdk??

Which version?
V.5.0xxxxx

Hi @manjeetbrar91,

Thanks for the post. Do you mean the Zoom Access Token(ZAK)? You could retrieve that from Zoom API: https://marketplace.zoom.us/docs/api-reference/zoom-api/users/usertoken

Thanks!

this api work with oauth but i am using android SDK for login via email and password

@Carson_Chen Please Help

Hi @manjeetbrar91,

Could you elaborate on the issue you are facing? The email/password login does not work with access token.

Thanks!

@Carson_Chen
in my app android user logged in using email and password.
he can create meeting, start meeting as host.
now i want to access recording list of meeting.
in android sdk there have no option to get recording list.
but if we go with API we need access token

Hello Manjeet
I’m also implementing Zoom SDK in android. I can start and join meeting but i can’t create meeting. Could you help me regarding create meeting process.

Hi @andthinkstartpvt, thanks for the post.

Are you looking to schedule a meeting through the SDK? If so, please refer to our documentation on that topic found here. If I’m misunderstanding, feel free to clarify and I will be more than happy to assist.

Thanks!

Follow below steps to create meeting

  1. implement zoom login
  2. use preschedule api to create meeting.
    MeetingItem meetingItem = new MeetingItem();
    meetingItem.setMeetingTopic("Test Meeting");
    meetingItem.setStartTime("Meeting date and time in milliseconds ");
    meetingItem.setDurationInMinutes(30);
    meetingItem.setPassword("123456");
    PreMeetingService preMeetingService = zoomSDK.getPreMeetingService();

      preMeetingService.addListener(new PreMeetingServiceListener() {
                    @Override
                    public void onListMeeting(int i, List<Long> list) {
                         
                    }

                    @Override
                    public void onScheduleMeeting(int i, long l) {
                        // i is meeting number returned by zoom
                    }

                    @Override
                    public void onUpdateMeeting(int i, long l) {

                    }

                    @Override
                    public void onDeleteMeeting(int i) {

                    }
                });

    if(preMeetingService != null) {
      PreMeetingService.ScheduleOrEditMeetingError error = preMeetingService.scheduleMeeting(meetingItem);
    } 


3. pre-schedule api will return a meeting number you can save meeting number on server for future use

Thank you Manjeet for your help.

I’m trying to create meeting but i’m getting “OTHER_ERROR” error.
Can you share your personal email, linkedin, skype id. There i can show you my code.

Again thank you so much.

https://www.linkedin.com/in/manjeetbrar91/

@manjeetbrar91

Please check your linkedin account.

@manjeetbrar91, thank you for helping out! :blue_heart:

@andthinkstartpvt I’ve responded to your other post for that error code you’re experiencing, but will reiterate here for the sake of visibility that we’re currently investigating that behavior. See that post for more specific information.

Thanks!

i am using this code snippet to generate the ZAK @Carson_Chen
but is returning 401 error message
URL zoomTokenEndpoint = null;
try {
zoomTokenEndpoint = new URL(“https://api.zoom.us/v2/users/” + “abc@technotackle.com” + “/token?type=token&access_token=” + jwt);
} catch (MalformedURLException e) {
e.printStackTrace();
}
HttpsURLConnection connection = null;
try {
connection = (HttpsURLConnection) zoomTokenEndpoint.openConnection();
} catch (IOException e) {
e.printStackTrace();
}
connection.setRequestProperty(“Content-Type”, " application/json");
try {
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
InputStream responseBody = connection.getInputStream();
InputStreamReader responseBodyReader = new InputStreamReader(responseBody, “UTF-8”);
BufferedReader streamReader = new BufferedReader(responseBodyReader);
StringBuilder responseStrBuilder = new StringBuilder();

        //get JSON String
        String inputStr;
        while (true) {
            try {
                if (!((inputStr = streamReader.readLine()) != null)) break;
                responseStrBuilder.append(inputStr);
            } catch (IOException e) {
                e.printStackTrace();
            }

        }

        connection.disconnect();
        JSONObject jsonObject = null;
        try {
            jsonObject = new JSONObject(responseStrBuilder.toString());
            String zak = jsonObject.getString("token");
            Log.d("GetZAK", zak);
        } catch (JSONException e) {
            e.printStackTrace();
        }

    } else {
        Log.d("error in connection", "error");

    }
} catch (IOException e) {
    e.printStackTrace();
}

}

what wrong did i made to generate the token @Carson_Chen

Hi @venugopal.p, thanks for the post.

It seems that you are encountering an issue with the REST API, and not the Android SDK. For assistance with the API, please head over to #api-and-webhooks and one of my extremely knowledgeable colleagues will be happy to help. :slightly_smiling_face:

Thanks!

Thanks for the reply , issue is solved now but i have a doubt that after generating the ZAK , i am sending to the below method to start the meeting as non login user when i try to share the its saying only host can share how can i start the meeting as the host ? @jon.lieblich

public int startMeetingWithNumber(Context context, String meetingNo, String userId, String zak, String meeting_password) {
int ret = -1;
MeetingService meetingService = mZoomSDK.getMeetingService();
if(meetingService == null) {
return ret;
}

    StartMeetingOptions opts = ZoomMeetingUISettingHelper.getStartMeetingOptions();

    StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
    params.userId = userId;
    params.userType = MeetingService.USER_TYPE_API_USER;
    params.displayName = DISPLAY_NAME;
    params.zoomAccessToken = zak;
    params.meetingNo = meetingNo;
    //params
    ret = meetingService.startMeetingWithParams(context, params, opts);
    Log.i(TAG, "startMeetingWithNumber, ret=" + ret);
    return ret;
}

Hi @venugopal.p, glad to hear you’ve generated the token successfully!

Your code is correct for starting the meeting as host. If you are seeing issues, please ensure that you are using the ZAK associated with the host’s account.

Thanks!

Thanks @jon.lieblich , Now the issue is not able to start a different meetings at a same time using the ZAK associated host’s account. There are multiple staffs can create a meeting with the single host’s account. now only one can start the meeting with the ZAK associated with the host’s account , when others start the meeting by generating the new ZAK token with different EXPIRY TIME it redirects the person B to the previous meeting started by the person A . is there any solution regarding Create and start multiple meeting at a same time with the single host’s account .

@jon.lieblich using the same host login id can i start the meeting at concurrent time ?

Is there any option to hide the bottom info dialog ?