0

I'm trying to extract list data from a site (with REST query) and its subsites based on their content type and put everything in a different list.

For example from https://mytenant.sharepoint.com/sites/siteA, https://mytenant.sharepoint.com/sites/siteA/siteB and so on.

The content type is custom made, lets call it CT1 with ID 0x011100F324658D0CFE9E46B6B8FD21A38FE5A7

I'm trying to get all list from my site A and its subsites with the ID of the content type im looking for like this:

             /_api/search/query? 
          querytext='ContentTypeId:0x011100F324658D0CFE9E46B6B8FD21A38FE5A7* 
         + path:https://mytenant/sites/siteA*'&selectproperties='Title,Path'

But this doesn't return anything at all.

1
  • Please refer to my answer, hope it helps! Commented Oct 24, 2018 at 16:35

1 Answer 1

0

Try below url:

/_api/search/query?querytext='ContentTypeId:0x011100F324658D0CFE9E46B6B8FD21A38FE5A7*+path:https://mytenant/sites/siteA/*'&selectproperties='Title,Path'

"/" was missing in the sitecollection url.

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.