Downloading user lists - Amazon Chime

You must be an Amazon Chime system administrator to complete the steps in this guide. If you need help with the Amazon Chime desktop client, web app, or mobile app, see Getting support in the Amazon Chime User Guide.

Downloading user lists

The following example shows how to download a list of users associated with your Amazon Chime administrative account in .csv format.

BufferedWriter writer = Files.newBufferedWriter(Paths.get("/path/to/csv")); CSVPrinter printer = new CSVPrinter(writer, CSVFormat.DEFAULT.withHeader("userId", "email")); ListUsersRequest listUsersRequest = new ListUsersRequest() .withAccountId(accountId) .withMaxResults(1); boolean done = false; while (!done) { ListUsersResult listUsersResult = chime.listUsers(listUsersRequest); for (User user: listUsersResult.getUsers()) { printer.printRecord(user.getUserId(), user.getPrimaryEmail()); } if (listUsersResult.getNextToken() == null) { done = true; } listUsersRequest = new ListUsersRequest() .withAccountId(accountId) .withNextToken(listUsersResult.getNextToken()); } printer.close();