I have tried both
CAML query and
REST API to retrieve data from the Discussions List in the community site but I am unable to accesss the
How to access this column and sort data?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
To get the list of replies
_api/lists/getByTitle('listname')/items?$filter=ContentType eq 'Message'
/_api/lists/getByTitle('listname')/items?$filter=FSObjType eq 0
To get the list of Discussions with the replies count:
/_api/lists/getByTitle('listname')/items?$select=ID,Title,Body,Folder/ItemCount &$expand=Folder/ItemCount &$filter=ContentType eq 'Discussion'