1

I want to get all lists from subsites etc. based on their content type with REST Api. For particular list ("ProjectList") this works:

 /_api/Web/lists/GetByTitle('ProjectList')/Items? 
 $select=ContentType/Name&$expand=ContentType&$filter=ContentType eq 
 'Message'`

But how will I be able to retrieve ALL lists, including subpages etc. by their content type?

I have tried:

  /_api/Web/lists/Items? 
   $select=ContentType/Name&$expand=ContentType&$filter=ContentType eq 
   'Message'`

Without luck.

1
  • You want to get the all Items with content Type "Message" from Root site and sub sites or you want to get all the lists where this content Type attached. if it is First then you should use Search Rest API to get the All items from Web with Content Type="Message" sharepoint.stackexchange.com/questions/234200/… Oct 12, 2018 at 12:33

1 Answer 1

1

If you want to get list then you don't have to append "items" to your rest url:

/_api/Web/lists?$select=ContentType/Name&$expand=ContentType&$filter=ContentType eq 'Message'
2
  • Thank you, but I dont get this to work. Both in my code, and in browser.
    – Arte2
    Oct 12, 2018 at 11:18
  • @Arte2 What error you get when you try it in browser? Oct 12, 2018 at 11:31

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.