Skip to content

Instantly share code, notes, and snippets.

@allenmichael
Created December 19, 2017 23:02
Show Gist options
  • Select an option

  • Save allenmichael/cfae80dfee5d43359da2795ed694c244 to your computer and use it in GitHub Desktop.

Select an option

Save allenmichael/cfae80dfee5d43359da2795ed694c244 to your computer and use it in GitHub Desktop.
using System;
using System.IO;
using System.Threading.Tasks;
using Box.V2.Config;
using Box.V2.JWTAuth;
namespace BoxGetAllUsers
{
class Program
{
static void Main(string[] args)
{
ExecuteMainAsync().Wait();
}
private static async Task ExecuteMainAsync()
{
using (FileStream fs = new FileStream($"./config.json", FileMode.Open))
{
var session = new BoxJWTAuth(BoxConfig.CreateFromJsonFile(fs));
var serviceAccountClient = session.AdminClient(session.AdminToken());
var users = await serviceAccountClient.UsersManager.GetEnterpriseUsersAsync(autoPaginate: true);
System.Console.WriteLine(users.TotalCount == users.Entries.Count);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment