Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JGraph
>
Tutorial
> Get rooms
The following example shows how to get all the room objects in the tenant.
import com.independentsoft.graph.GraphClient; import com.independentsoft.graph.GraphException; import com.independentsoft.graph.calendars.Room; public class Console { public static void main(String[] args) { try { GraphClient client = new GraphClient(); client.setClientId("63333333-209e-454e-b7bd-55a4d201270f"); client.setTenant("independentsoft.onmicrosoft.com"); client.setUsername("info@independentsoft.onmicrosoft.com"); client.setPassword("password"); java.util.List
rooms = client.getRooms(); for (Room room : rooms) { System.out.println(room.getId()); System.out.println(room.getDisplayName()); System.out.println(room.getEmailAddress()); System.out.println(room.getCapacity()); System.out.println(room.getBuilding()); System.out.println(room.getFloorNumber()); System.out.println(room.getFloorLabel()); if (room.getAddress() != null) { System.out.println(room.getAddress().getStreet()); System.out.println(room.getAddress().getPostalCode()); System.out.println(room.getAddress().getCity()); System.out.println(room.getAddress().getCountry()); } } } catch (GraphException e) { System.out.println(e.getCode()); System.out.println(e.getMessage()); } catch (Exception e) { System.out.println(e.getMessage()); } } }
Need help? Ask our developers:
Name*
Email*
Message*