I need to display 2 dropdowns to user, first populated with all subsites in a site collection that have at least one discussion list; and second dropdown with all the discussion lists available in a given subsite. The discussion lists may or may not have items in it. Can we get such a list of lists by REST API query?.

I have already tried using search API to filter based on discussion content type, this does return all discussion items and I can get a list of subsites that contain these items. But if any subsite contains empty discussion list it wont be traceable.

search APi query i am using currently:

/_api/search/query?querytext='ContentType:Discussion+path:<subsite path>

Please note that i am working in SharePoint online environment so kindly suggest solution accordingly.

1 Answer 1


finally found a solution to this problem. I used below REST API query to fetch list of discussion lists:

https://YourSiteUrl/_api/web/lists?$select=Title&$filter=BaseTemplate eq 108

Hope this helps others with same problem.

108 here refers to the ListTemplate ID for discussion list. Using this ID to filter out only lists of Type Discussion list from my site collection. You can check this link for different template IDs for other list templates.

  • Hi, what is this BaseTemplate and 108, please add explanation for both of the terms. I am having hard luck in getting list names having particular content type
    – Sanuj
    Jul 16, 2019 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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