top of page

Retrieve Delve Boards And Their Documents From Office 365 Using REST API


In this article, you will learn how to retrieve boards and documents (added to board) from Office 365 Delve, using REST API. Jquery Ajax and search APIs are used to perform the operation.

Retrieve Boards

Board is just a way to categorize the documents on the site. The operation shown below will fetch all the board names that the user has added it to his documents. Say for example, user has added board called “Cricket” to two documents and “Tennis” to one document. This means the user is following two boards. They are Cricket and Tennis (these values will be listed on Delve left pane). There can be boards added by other users as well, which will not be listed on the user's Delve page. We will see how we can retrieve these boards from Office 365 Delve.

  • The search API is used to pull the information. 

  • The necessary parameters to query the board details are the query text and properties. In the query text, we need to pass the path to get the board names available on Delve. We need to set the external content to be true in the properties, so it will retrieve all the properties related to the board.

  • Using Ajax call with get method, retrieve the board names. Set the necessary parameters in the Ajax method.

  1. var getBoardURL = "/_api/search/query?QueryText='Path:\"TAG://PUBLIC/?NAME=*\"'&Properties='IncludeExternalContent:true'";  

  2. $.ajax  ({      url: getBoardURL,      method: 'GET',      

  3. async: false,      

  4. headers:       

  5. {   "Accept": "application/json; odata=verbose"     

  6. },      

  7. success: function(response)       

  8. {  

  9. // Get the exact result set.           

  10. var resultSet = response.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results;  

  11. // Loop through result set to get the properties for each boards.  

  12. for (var i = 0; i < resultSet.length; i++)           

  13. {              

  14. console.log("Title    : " + resultSet[i].Cells.results[3].Value);              

  15. console.log("Actor ID : " + resultSet[i].Cells.results[1].Value);          

  16. }      

  17. },      

  18. error: function(data) {}  

  19. });  

From the response, we can get the board names, their corresponding actor IDs, path and other board details.

Retrieve Documents from board:

  • The board actor ID (identified in the section, above) is used to retrieve the respective board documents. 

  • To retrieve the documents, we will the use search API again to pull the information. 

  • The necessary parameters are the query text and properties. In the query text, pass * or any keyword to retrieve the documents. In the properties parameter, pass the graph query along with actor ID (identified in the section, above) of the board and action ID. (Here, action ID should be 1045 to denote the board). Here, we are passing single board actor ID to retrieve the particular board documents. You can change the logic to get multiple board's documents.

  1. var actorId = ""; 

  2. // Set the actor id of board (can be identified from above section) to see the documents.  

  3. getDocumentURL = "/_api/search/query?

  4. QueryText='*'&Properties='GraphQuery:actor(" + actorId + "\\,action\\:1045)'"

  5. $.ajax  (

  6. {      

  7. url: getDocumentURL,      

  8. method: 'GET',      

  9. async: false,      

  10. headers:      

  11. {   "Accept": "application/json; odata=verbose"     },      

  12. success: function(response)       

  13. {  

  14. // Get the exact result set.           

  15. var resultSet = response.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results;  

  16. // Loop through result set to get the documents from the board.  

  17. for (var i = 0; i < resultSet.length; i++)           

  18. {              

  19. console.log("Title    : " + resultSet[i].Cells.results[3].Value);              

  20. console.log("URL      : " + resultSet[i].Cells.results[6].Value);  

  21. // Similarly other values can be retrieved            

  22. }      

  23. },      

  24. error: function(data) {}  

  25. });  


In these cases, you can check the result values in a Browser debugger console. You can change the logic to display the results on the pages. Place these scripts on the page, using the Web parts (Content Editor / Script Editor / any custom Web part). 


Thus, you have learned how to retrieve the boards and how the documents are added to the board on Office 365, using REST API.



bottom of page