SharePoint REST API to get Discussion List Questions and Replies separately


To get the list of questions from a SP 2013+ Distribution list using OOTB REST API:

_api/lists/getByTitle(‘listname‘)/items?$filter=ContentType eq ‘Discussion’

or

/_api/lists/getByTitle(‘listname‘)/items?$filter=FSObjType eq 1

To get the list of replies from a SP 2013+ Distribution list, using OOTB REST API:

_api/lists/getByTitle(‘listname‘)/items?$filter=ContentType eq ‘Message’

or

/_api/lists/getByTitle(‘listname‘)/items?$filter=FSObjType eq 0

To get the list of Discussions with the replies count from a SP 2013+ Distribution list, using OOTB REST API:

/_api/lists/getByTitle(‘listname‘)/items?$select=ID,Title,Body,Folder/ItemCount &$expand=Folder/ItemCount &$filter=ContentType eq ‘Discussion’

Feel free to leave a reply here...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s