The two options are to use the People API in Microsoft Graph or the List orgContacts endpoint from the Microsoft Graph Rest API Beta to differentiate between users and conference rooms. https://learn.microsoft.com/en-us/graph/people-insights-overview
Example using the People API to retrieve rooms:
GET https://graph.microsoft.com/v1.0/me/people?$filter=personType/subclass eq 'Room'
Example just retrieving people (and not rooms):
https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/people?$filter=personType/class eq 'Person' and personType/subclass eq 'OrganizationUser'
Example using the List orgContacts endpoint:
GET https://graph.microsoft.com/beta/contacts
This returns the list of organizational contacts for the organization.
If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar questions. Otherwise let us know if you have further questions.