Skip to main content
1 of 2
BennKingy
  • 446
  • 1
  • 8
  • 32

Sharepoint search api to query documents by term store/set?

I have a term store which has some terms "Defender", "Forward", etc. I then have a document library which uses those terms as meta data on the documents.

I want to use the sharepoint search api to retrieve any documents that have used the "Defender" meta data, like in the images below.

I have a function to grab the documents:

  public getDocuments() {
    axios 
    .get("https://bpk.sharepoint.com/_api/SEARCH DOCUMENTS VIA TERMS FROM THE TERM STORE",
            { params:{},
              headers: { 'accept': 'application/json;odata=verbose' }
            })
    .then(response => {
      this.setState({
        documents: response.data.d.results
      });
    })
    .catch(error => {
      console.log(error);
    });
  }

Can anybody please point me in the right direction for what the search api end point should be? <3

enter image description here

enter image description here

BennKingy
  • 446
  • 1
  • 8
  • 32