List users API call returning OK with null Body (Reopen)

I am having the exact same issue as this Post but the solution was not posted and the email address for developersupport@zoom.us returns “This email address is no longer used by our Developer Relations team. We instead suggest using the Developer Support site or check out our Developer Forum”.

Does anyone know the solution?

Here is the content from the original post that is now closed:

Description
List users API call returns nothing in Body, with 200 (OK) status.

Error
When sending GET “users”, response has status 200 (OK) but Body is null. Account has 7,884 users. Expected JSON data in Body with information for 30 of those users (because page_size has Default of 30).

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

Which Endpoint/s?
GET /users

How To Reproduce (If applicable)
Steps to reproduce the behavior:

  1. Send an HTTP GET request to roles with appropriate Authorization header
  2. Get response with status 200 (OK) and JSON data in Body showing roles. This confirms I am sending the right Authorization header and otherwise using the API correctly.
  3. Send an HTTP GET request to users with the same Authorization header as in step 1
  4. Get response with status 200 (OK) and null Body that should have had JSON data with user information.

@sbressette ,

Welcome to the Developer Forum – happy to help. Just tested the Get users endpoint with JWT and can confirm all users were returned. Here is how the request was configured :

Can you share a screenshot of how you are making your request?

Best,
Donte

Hi Donte,

I recreated the same code from prior post in a C# console app. I can send it to you or you can review it from the prior post.

I definitely get an access token but the returned body is null. I wished I could tell you more, but that is all the information I have.

My assumption is that the issue was resolved for the prior post, we just need to know what that solution was. Is there any chance you can research what happened there?

Thanks,
Scott

@sbressette ,

Are you saying the request is working as expected? Can you share a snippet of how you are making the request?

NO. IT IS NOT WORKING. I am referring the post that I linked from your forum that has the exact issue without a solution. If you would just look at it and find out what the solution was and post it here, you could help me an anyone else that has this issue in the future.

Here is the code from the prior post.

using Microsoft.IdentityModel.Tokens;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.IO;
using System.Net;
using System.Text;

namespace ZoomUsers
{ // ZoomUsers

class Program
{ // Program

static void GetData(string path)
{ // GetData

  const string apiKey = "REDACTED";
  const string apiSecret = "REDACTED";

  string apiUrl = "https://api.zoom.us/v2/" + path;

  Console.WriteLine("Url: " + apiUrl);

  DateTime ZoomApiAuthorizationTokenExpiration = DateTime.UtcNow.AddSeconds(30);

  JwtSecurityTokenHandler tokenHandler = new JwtSecurityTokenHandler();

  string zoomApiAuthorizationToken =
    tokenHandler.WriteToken(
      tokenHandler.CreateToken(
        new SecurityTokenDescriptor
        {
            Issuer = apiKey
          , Expires = ZoomApiAuthorizationTokenExpiration
          , SigningCredentials = new SigningCredentials(
                new SymmetricSecurityKey(Encoding.ASCII.GetBytes(apiSecret))
              , SecurityAlgorithms.HmacSha256
            )
        }));

    HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(apiUrl);

    webRequest.Method = "GET";
    webRequest.Headers.Add("Authorization", "Bearer " + zoomApiAuthorizationToken);

    IAsyncResult asyncResult = webRequest.BeginGetResponse(null, null);

    asyncResult.AsyncWaitHandle.WaitOne();

      using (HttpWebResponse webResponse = (HttpWebResponse)(webRequest.EndGetResponse(asyncResult)))
      { // using webResponse

        Console.WriteLine("StatusCode: " + webResponse.StatusCode.ToString());
        Console.WriteLine("ContentLength: " + webResponse.ContentLength.ToString());

        if (webResponse.ContentLength > 0)
        { // get response body

          using (StreamReader reader = new StreamReader(webResponse.GetResponseStream()))
          { // using reader
  
            Console.WriteLine("Response: " + reader.ReadToEnd());
  
          } // using reader

        } // get response body

      } // using webResponse

      Console.WriteLine();

} // GetData

static void Main(string[] args)
{ // Main

  GetData("roles");
  GetData("users");

} // Main

} // Program

} // ZoomUsers

I figured it out. There is a limit to how much data it will return. We have over 500 users and that appears too be too large. Instead of getting an error code back, you’ll get a success code but a null response.

Hopefully this helps the next person this happens too.

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