I’m hoping that I’m missing something simple here, but was hoping to get some help.
I’m attempting to connect to the management API like this:
public async void GetUsers()
{
using (var managementApi = GetManagementApi())
{
var users = await managementApi.Users.GetUsersByEmailAsync("a-valid-email@example.com");
Console.WriteLine(users);
}
}
private ManagementApiClient GetManagementApi()
{
var authToken = GetManagementAuthToken();
return new ManagementApiClient(authToken, new Uri($"https://{Domain}/api/v2/"));
}
(I can provide my GetManagementAuthToken
function if needed, but suffice it to say, I’m getting an auth token).
When I attempt to hit the GetUsersByEmailAsync
function, I get the following error:
System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'System.Net.Http.HttpRequestMessage'.'
I’m using the ManagementApi at version 7.0.0. Please let me know if you need anything else.