[Vuejs]-Retrieving Metadata from Term Store using SharePoint Search REST API

-1👍

Filip Huhta
To retrieve metadata from termbases associated with documents in SharePoint search results, you need to make a separate request for each document to retrieve the metadata. The SharePoint Search REST API does not provide a direct way to perform these lookups in the initial GET request query.

Here is a general approach you can follow

Use the SharePoint Search REST API to retrieve documents based on your search criteria. Here’s the GET request you mentioned:
Process the search results in a Vue.js application and extract the necessary metadata fields, such as the document ID or any other identifier associated with the metadata.

For each document, a separate request is made to retrieve the associated metadata from the termbase. You can use the SharePoint REST API or the Microsoft Graph API to extract metadata based on the identifier obtained in the previous step.

The specific API endpoint and request syntax for retrieving metadata depends on your SharePoint configuration and termbase structure. You may need to consult the SharePoint API documentation or refer to specific API endpoints provided by SharePoint settings.

Combines document information retrieved from search results with associated metadata obtained in a separate request to obtain complete information for each document.

Note that making separate requests for each document may impact performance, especially when processing large numbers of documents. You can consider implementing a caching mechanism or optimizing the process according to your specific requirements and performance considerations.

Also, be aware of any authentication and authorization requirements when making requests to the SharePoint API, and make sure to grant the necessary permissions to access termbases and retrieve metadata.

Leave a comment