Always 401 from

Description{userid}/token always return 401.

it returns ,

124 Invalid access token.

Which App Type (OAuth / Chatbot / JWT / Webhook)?

Which Endpoint/s?{userid}/token{userid}/token

When i create a jwt with credentials from developer console and try to send a get request it always returns 401 error. But with same credentials i am able to build simple app which creates and joins room.

this is my code :

private String getZoomToken() {
    try {
    URL zoomTokenEndpoint = new URL("" + "" + "/token?type=token&access_token=" + getJWT());
    HttpsURLConnection connection = (HttpsURLConnection) zoomTokenEndpoint.openConnection();
    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 ((inputStr = streamReader.readLine()) != null)

        JSONObject jsonObject = new JSONObject(responseStrBuilder.toString());
        return jsonObject.getString("token");
    } else {
        Log.d("dasdas", "error in connection");
        return null;
    } catch (MalformedURLException e) {
    } catch (UnsupportedEncodingException e) {
    } catch (IOException e) {
    } catch (JSONException e) {
    return "";

private String getJWT() {
    long time = System.currentTimeMillis()/1000  + 3600;

    String header = "{\"alg\": \"HS256\", \"typ\": \"JWT\"}";
    String payload = "{\"iss\": \"" + AppConstant.Zoom_Key + "\"" + ", \"exp\": " + String.valueOf(time) + "}";
    try {
        String headerBase64Str = Base64.encodeToString(header.getBytes("utf-8"), Base64.NO_WRAP| Base64.NO_PADDING | Base64.URL_SAFE);
        String payloadBase64Str = Base64.encodeToString(payload.getBytes("utf-8"), Base64.NO_WRAP| Base64.NO_PADDING | Base64.URL_SAFE);
        final Mac mac = Mac.getInstance("HmacSHA256");
        SecretKeySpec secretKeySpec = new SecretKeySpec(AppConstant.Zoom_Secret.getBytes(), "HmacSHA256");

        byte[] digest = mac.doFinal((headerBase64Str + "." + payloadBase64Str).getBytes());

        return headerBase64Str + "." + payloadBase64Str + "." + Base64.encodeToString(digest, Base64.NO_WRAP| Base64.NO_PADDING | Base64.URL_SAFE);
    } catch (NoSuchAlgorithmException e) {
    } catch (UnsupportedEncodingException e) {
    } catch (InvalidKeyException e) {
    return  "";

it caused most stupid mistake ever. About crentials. Now i am able to do make request. Bu it returns empty not token

Hey @bgul,

Are you still having an issue with this request? Can you share an example of the latest request where you’re getting an empty token? We’re happy to take a closer look.


Hi @will.zoom,

Thank you for your response,
Below request returns as success but has empty json response

I also called same method with id of same user instead email from below service

String url = “” + token

Hey @bgul,

Please try passing in the access token via the header instead of a query param in the request url.


"Authorization": "Basic ACCESS_TOKEN_HERE"

Docs here:


actually both of them was working. Problem was i signed in google. When i sign-up from different accout it was all fine. After that to add user and get zak i needed to upgrade my account to pro.

Hey @bgul,

Thank you for the update. I’m glad to hear that you resolved your issues! If you encounter any further issues or questions, please don’t hesitate to reach out.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.