Created
December 19, 2017 23:02
-
-
Save allenmichael/cfae80dfee5d43359da2795ed694c244 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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