2

I'm trying to find a REST API query which shows all HTML, CSS, js ect. all type of pages and documents. I'm trying to get exact same results as SharePoint default search.

2 Answers 2

1

Try the following query url, this will give you all the records associated with document content type.

https://yourtenant.sharepoint.com/_api/search/query?querytemplate='IsDocument:true'

You can also query something like below, where you are trying to find document with specific term

https://yourtenant.sharepoint.com/_api/search/query?querytext='search_data'&querytemplate='{searchterms} IsDocument:true'

By default SP REST API display 10 records. Add row limits to query to include as many result items you desire.

You can also follow MSDN documentation to learn more on SP Search.

0

You can use below REST API

To get all Documents/ Pages from site :

/_api/search/query?querytext='IsDocument:True'

To get specific pages/files like CSS,JS,HTML etc :

/_api/search/query?querytext='FileExtension:<extension>'

Example:

/_api/search/query?querytext='FileExtension:html'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.