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.