When building custom solutions with the Office Graph you might want to show boards and their documents. Find out how to get the list of documents from a specific board using the Office Graph API.
In my previous article we discussed how to programmatically retrieve the list of all boards from Office Delve. In this article let’s take a look at how to retrieve documents from a particular board.
In order to retrieve all documents that belong to a particular board we have to issue the following Office Graph query:
actor(<board id>, action:1045)
1045 is a new action that represents documents belonging to a board. As discussed in my previous article the ID of the board can be retrieved using a regular search query:
Office Delve boards are stored in the search index and they can be retrieved by querying the Path Managed Property for a string following the format: TAG://PUBLIC/?NAME=<board name>. The ID of the board is then returned in the DocId Managed Property.
Having retrieved the ID of the board, we can now retrieve all documents that belong to that board:
This is the most basic Office Graph query that will return the list of documents that belong to our board.
In this example, as pointed out in the screenshot above, the query returned two results of which the first is the Marketing Campaign Effectiveness document – exactly what we see in the Reports board in Delve:
Similarly to other Office Graph queries, the query retrieving documents from a particular board can be extended with additional properties allowing to filter the documents on their type, date range, sorting them in a specific way and perform other operations that would be relevant for your scenario.
When building custom solutions with the Office Graph you might want to show boards and their documents. Using the Office Graph API you can build a query that will allow you to retrieve all documents that belong to a specific board. This query can optionally be expanded with additional operations relevant to your application.