Missing Graph Java SDK Search API support for Person Entity

Syed Meesum Ali Jafri 21 Reputation points
2022-12-07T11:28:51.9+00:00

Hi,

I wish to use the Microsoft Graph Java SDK to search for people in my organization. I was able to invoke Search API using the Graph explorer but the Java SDK currently doesn't support searching People as the class "com.microsoft.graph.models.EntityType" is missing the "PERSON" type. I checked the latest SDK jar available on maven repository (https://search.maven.org/artifact/com.microsoft.graph/microsoft-graph) and found that the aforementioned class still doesn't support 'Person' entity.

Class Source code:

package com.microsoft.graph.models;  

/**  
 * The Enum Entity Type.  
*/  
public enum EntityType  
{  
    /**  
    * event  
    */  
    EVENT,  
    /**  
    * message  
    */  
    MESSAGE,  
    /**  
    * drive Item  
    */  
    DRIVE_ITEM,  
    /**  
    * external Item  
    */  
    EXTERNAL_ITEM,  
    /**  
    * site  
    */  
    SITE,  
    /**  
    * list  
    */  
    LIST,  
    /**  
    * list Item  
    */  
    LIST_ITEM,  
    /**  
    * drive  
    */  
    DRIVE,  
    /**  
    * unknown Future Value  
    */  
    UNKNOWN_FUTURE_VALUE,  
    /**  
    * For EntityType values that were not expected from the service  
    */  
    UNEXPECTED_VALUE  
}  

I would appreciate it if you can share a (tentative) date by which the Java SDK will start supporting Search (People) API.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Vicky Kumar (Mindtree Consulting PVT LTD) 1,161 Reputation points Microsoft Employee
    2022-12-14T08:27:12.997+00:00

    Sorry, currently there is no ETA for that, have you check the doc, is this help you to get the people details - https://learn.microsoft.com/en-us/graph/api/user-list-people?view=graph-rest-1.0&tabs=java

    As per the doc - We recommended that users call the /search endpoint instead of the /people endpoint. Going forward, all future investments will only be available in the /search endpoint; the /people endpoint is in maintenance mode.

    you can use search query - https://learn.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0
    270466-image.png

    Hope this helps.

    Thanks

    ----------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Syed Meesum Ali Jafri 21 Reputation points
    2022-12-28T09:30:41.11+00:00

    Thanks for the reply!

    As recommended, I've been exploring the MS Graph Search API (and other similar APIs) to query People (user) data using the Graph Explorer.

    But the Code snippet available for the Java Client library incorrectly uses the 'EntityType.EVENT'. Please refer to the screenshot below.
    274521-java-sdk-sample-code-issue.jpg

    The correct type should be 'EntityType.PERSON'.

    As requested in my original message, the Java client library needs to support the "PERSON" type so that it can be used to invoke the Search API to query "People" data.

    Note: The same issue is there with 'CSharp' code snippet as well.


  2. Syed Meesum Ali Jafri 21 Reputation points
    2023-04-05T03:41:51.4866667+00:00

    As the support for EntityType ("Person") has been added to the SDK, we can close this ticket.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.