How can I use the Graph API to search sharepoint contact information?

Dave Nicodemus 1 Reputation point
2021-08-16T23:41:08.077+00:00

For example, if a user has listed the term Cooking in their 'About Me->Interests and Hobbies' I want to be able to find their profile using the term cooking. I have tried :
POST https://graph.microsoft.com/beta/search/query

{
    "requests": [
        {
            "entityTypes": [
                "person"
            ],
            "query": {
                "queryString": "Cooking"
            }
        }
    ]
}

But no results, however when I use the sharepoint search box from the share point web interface, I get the profile I'm looking for.

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,810 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,026 Reputation points
    2021-08-17T06:15:34.61+00:00

    Hi @Dave Nicodemus ,

    Currently, you cannot use Graph API to achieve this. According to the documentation, when we use graph api to search person, the source is Exchange Online not SharePoint. So you would not get results.

    123804-image.png

    You could submit the feature request here: https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform