0

My organization has a SharePoint Online tenancy.

I created a Test Site collection as a Subsite of the main Site Collection. I'm able to submit the following REST call through a chrome browser, and I receive an XML response.

The Test site collection has a URL of:

tenancy.sharepoint.com/sites/Test

REST API Call: tenancy.sharepoint.com/Test/_api/search/query?querytext=%27focusing%27

Response: I get a properly formatted XML response.

I then created a Site Collection, that was not a subsite of the main Site Collection. This was intended to be for our production environment.

statistics URL: tenancy.sharepoint.com/sites/statistics

REST API Call: tenancy.sharepoint.com/statistics/_api/search/query?querytext=%27focusing%27

Response: NOTHING. The browser's screen goes white, but never loads anything. Completely white. I leave it for 30 minutes, it stays white. It doesn't give any indication of an error, timeout, or it trying to still do something. It just doesn't do anything.

Questions: Is the Search REST API only available to the main site collection and its subsites??

Is there something that needs to be enabled on a Site Collection to allow the REST API to even work? We didn't appear to need to make any such configuration setting for the main Site Collection, it just worked when we first started exploring its capabilities.

Please help. We're new to SharePoint and are constantly running into roadblocks.

  • How are you running these REST calls? Browser? JavaScript? C#? – wjervis Jun 24 '16 at 17:19
  • Through a browser. I'm using a Chrome browser. – JamesA Jun 24 '16 at 17:34
2

Look at your URL, it is created under the sites managed path,tenancy.sharepoint.com/sites/statistics

So your REST call would be tenancy.sharepoint.com/sites/statistics/_api/search/query?querytext=%27focusing%27. tenancy.sharepoint.com/statistics isn't valid.

  • Using sites/statistics does return a response, however all the documents returned are from the sites/Test site collection, none from the site/statistics site collection are returned. – JamesA Jun 24 '16 at 17:56
  • It's possible the search services have not crawled your content yet. – Eric Alexander Jun 24 '16 at 18:00
  • The content has been up on the site for over a week. I have also verified that under the Site Collection's - Site Settings > Search and Offline Availability that the "Allow this site to appear in search results?" is set to yes. – JamesA Jun 24 '16 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.