Search() public method

Searches all Sheets that the User can access, for the specified text.

It mirrors To the following Smartsheet REST API method: GET /search

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public Search ( string query ) : Api.Models.SearchResult
query string (required): Text with which to perform the search.
return Api.Models.SearchResult
Example #1
0
        public virtual void TestSearch()
        {
            server.setResponseBody("../../../TestSDK/resources/search.json");

            SearchResult result = searchResources.Search("brett");

            Assert.NotNull(result.Results);
            IList <SearchResultItem> results = result.Results;

            Assert.NotNull(results);
            Assert.AreEqual(50, results.Count);
            Assert.AreEqual(50, (int)result.TotalCount);
            Assert.AreEqual("Brett Task Sheet", results[0].Text);
            Assert.IsTrue(SearchObjectType.SHEET == results[0].ObjectType);
            Assert.AreEqual(714377448974212L, (long)results[0].ObjectId);
            Assert.AreEqual("Platform / Team", results[0].ContextData[0]);
        }