In this post, we’ll walk through a scenario for surfacing Microsoft Graph connector items via the Search APIs on Microsoft Graph and then using values in the response to retrieve the full content of item using the Graph connector APIs on Microsoft Graph.

Scenario
This week, a customer asked the following question:
“Once we index files using Graph connectors, how can we retrieve the full content of those items to be used in additional experiences like a custom search solution for our employees? The Search APIs (on Microsoft Graph) appear to only retrieve a snippet of the matching results.”
As the customer noticed, when you use the Microsoft Search API to search Microsoft Graph connectors, you can list which fields (properties from Graph connector defined schema) to return, but you can’t return the full content that was ingested. This is by design as search is intended to retrieve snippets of results for displaying in a custom search experience, for example.
Solution
Let’s look at querying for Graph connector items using the /search/query endpoint (documentation):
Note: replace “ServiceNowKB1” with the id of your connection.
POST: https://graph.microsoft.com/v1.0/search/query
REQUEST BODY:
{
"requests": [
{
"entityTypes": [
"externalItem"
],
"contentSources": [
"/external/connections/ServiceNowKB1"
],
"query": {
"queryString": "*"
},
"from": 0,
"size": 3
}
]
}
Sample response from Search API:
Notice the “substrateContentDomainId” value in response. You can parse the value and take the substring after the comma (,) such as highlighted above. This is the itemId of the Graph connector item.
Next, query the Graph connector ingestion API (documentation) on Microsoft Graph for the items in the Graph connector (externalConnection). Again, replace “ServiceNowKB1” with the connection id as well as replacing the itemId.
GET: https://graph.microsoft.com/v1.0/external/connections/ServiceNowKB1/items/c487857187032100deddb882a2e3ec4f
Sample response from Graph connector API:

With the ingestion API we are now able to retrieve the full content of the ingested item. Note that this is for a single item at a time. If you have multiple items, you will need to iterate through them.
Conclusion
Graph connectors power discovery of non-Microsoft 365 data in multiple native Microsoft 365 experiences. If you have a need to display Graph connector items in an alternate location (line of business application, custom search portal, etc.) hopefully you found this post helpful. Feel free to leave comments or questions if you have additional needs.
-Frog Out
Resources















