Partager via


Search for Items within a Folder

 

Applies To: Windows Server 2012 Essentials

Retrieves the metadata information for search results. The metadata includes basic information such as the creation time, item type, modification time, name, path, and size. The search occurs across all share folders that users have access to.

URI Template

GET services/builtin/FileOperationService.svc/items/index/{index}/count/{count}/search?query={query}

{index}
The numerical position of the first item to be retrieved.

{count}
The number of items to be retrieved.

{query}
The start string to search for within the names of the files and folders. The asterisk (*) and question mark (?) wildcard characters are supported.

Sample Request

GET https://www.contoso.com/services/builtin/FileOperationService.svc/items/index/0/count/100/search?query=abc HTTP/1.1  
Accept: application/xml  
Cookie: ASP.NET_SessionId=********************  
Canary: *********************  
Host: domainname  

Sample Response

HTTP/1.1 200 OK  
<ItemList  
    xmlns="http://contracts.microsoft.com/WindowsServerEssentials/2011/09/WebApi"  
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Items>  
    <ItemInfo>  
      <AccessPermission>2</AccessPermission>  
      <CreateTime>2011-10-18T01:08:01.3153356-07:00</CreateTime>  
      <IsDirectory>true</IsDirectory>  
      <ModifiedTime>2011-10-18T01:08:01.3153356-07:00</ModifiedTime>  
      <Name>aa</Name>  
      <Path>\\SERVERNAME\Users</Path>  
      <Size>0</Size>  
    </ItemInfo>  
    <ItemInfo>  
      <AccessPermission>2</AccessPermission>  
      <CreateTime>2011-10-12T23:24:59.3006647-07:00</CreateTime>  
      <IsDirectory>true</IsDirectory>  
      <ModifiedTime>2011-10-18T19:49:06.1585762-07:00</ModifiedTime>  
      <Name>AuroraStdUser</Name>  
      <Path>\\SERVERNAME\Users</Path>  
      <Size>0</Size>  
    </ItemInfo>  
    <ItemInfo>  
      <AccessPermission>2</AccessPermission>  
      <CreateTime>2011-10-12T23:24:58.3945353-07:00</CreateTime>  
      <IsDirectory>true</IsDirectory>  
      <ModifiedTime>2011-10-16T20:03:33.9386717-07:00</ModifiedTime>  
      <Name>AuroraUser</Name>  
      <Path>\\SERVERNAME\Users</Path>  
      <Size>0</Size>  
    </ItemInfo>  
    <ItemInfo>  
      <AccessPermission>2</AccessPermission>  
      <CreateTime>2011-10-18T01:12:36.9315201-07:00</CreateTime>  
      <IsDirectory>true</IsDirectory>  
      <ModifiedTime>2011-10-18T01:12:36.9315201-07:00</ModifiedTime>  
      <Name>Sallyh</Name>  
      <Path>\\SERVERNAME\Users</Path>  
      <Size>0</Size>  
    </ItemInfo>  
  </Items>  
  <TotalCount>4</TotalCount>  
</ItemList>  

Error Codes

Error Code Error Message
400 One or more parameters are not valid.
401 Access is denied to the requested resource.

Remarks

The AccessPermission element in the response can contain one of the following enumeration values:

Enumeration Value Name Value Meaning
None 0 No access.
ReadOnly 1 Read-only access.
Full 2 Read/write access.
Other 3 Unknown or unspecified access.

See Also

Web Service Methods