Search a folder for a file
Search for files in a folder in the team portal logged in to. Specify at least one character in the search. For example, searching for a file containing the string “IM” within “my files” folder will return all the files that contain this string, such as initial_image.png, impact_analasis.doc, etc.
API
ServicesPortal/api
URI
http://portal_url/ServicesPortal/api where portal_url is the URL of the team portal.
HTTP Method
POST
Request Content-Type
application/xml
Request body example
<obj >
  <att id="name">
    <val>fetchResources</val>
  </att>
  <att id="param">
    <obj class="FetchResourcesParam">
      <att id="root">
        <val>/ServicesPortal/webdav/myfiles</val>
      </att>
        <att id="depth">
        <val>Infinity</val>
      </att>
      <att id="cloudFolderType">
        <list>
          <val>Personal</val>
        </list>
      </att>
      <att id="includeDeleted">
        <val>false</val>
      </att>
      <att id="includeFoldersOnly"/>
      <att id="passphrase"/>
      <att id="userPassword"/>
      <att id="searchCriteria">
        <val>IM</val>
      </att>
      <att id="quickNavigationPane"/>
      <att id="start">
        <val>0</val>
      </att>
        att id="limit">
        <val>5000</val>
      </att>
      <att id="sort">
        <list>
          <obj class="Sort">
            <att id="field">
              <val>name</val>
            </att>
            <att id="ascending">
              <val>true</val>
            </att>
          </obj>
        </list>
      </att>
    </obj>
  </att>
</obj>
Expected Response status
200 OK
If a response such as 403 Forbidden is returned, check the user name and password provided.
The request body:
root – Mandatory: The Starting point in the folder hierarchy to start retrieving files and folders.
depth – Mandatory: The number of nested levels of folders to retrieve.
CloudFolderType – The type of folders to retrieve. Valid values: Personal, Backup
IncludeDeleted – True or false: Retrieve both existing and deleted folders.
IncludeFoldersOnly – True or false: Only retrieve folders and not the files within them.
passphrase – The passphrase for the user. The passphrase is not encrypted.
userPassword – The password for the user. The password is not encrypted
searchCriteria – The characters on which to perform the search.
quickNavigationPane – Used in the Web interface only and can be ignored in the API.
start – The starting number of the first file to retrieve in the list of files after the list is sorted. The number is zero-based.
sort – The sort criteria to use on the retrieved files and folders.
field – The name of the field to sort.
ascending – True or false: True if the sort is ascending. False if the sort is descending.
Response body
Example JSON type response with files that match the search criteria.
{"$class":"FetchResourcesResult",
 "hasMore": false,
 "items": [{
   "$class":"ResourceInfo",
   "actionsAllowed": {
      "$class":"AllowedActions",
      "_delete": true,
      "allowChangePassphrase": false,
      "allowShowDeleted": true,
      "copy": true,
      "createFile": false,
      "createFolder": false,
      "createPublicLink": true,
      "download": true,
      "invitePermissions": {
         "$class":"PublicSharePermissions",
         "allowedAccess": "ReadOnly",
         "invitationSettings": {
            "$class":"PortalInvitationSettings",
            "allowCollaboratorsToReshareContent": true,
            "allowedFrequentContactsTime": 120,
            "defaultProtectionLevels": "publicLink",
            "inviteLifetime": 30,
            "protectionLevels": ["publicLink","email","textMessage"]
         }
      },
      "manageSharing": true,
      "move": true,
      "previewStatus": {
         "$class":"PreviewStatus",
         "failure": "None",
         "preview": true
      },
      "restoreFromBackup": false,
      "seedingExport": false,
      "undelete": false,
      "versioning": true
   },
   "cloudFolderInfo": {
      "$class":"CloudFolderInfo",
      "groupUid": 21296,
      "isShared": false,
      "name": "myfiles",
      "ownerFriendlyName": "admin admin",
      "ownerUid": 21362,
      "passphraseProtected": false,
      "type": "Personal","uid": 21363
   },
   "extension": "PNG",
   "hasLinks": false,
   "href": "\/ServicesPortal\/webdav\/myfiles\/IMG_0002.PNG",
   "isAttachmentsFolder": false,
   "isCompleted": true,
   "isDeleted": false,
   "isFolder": false,
   "isShared": false,
   "lastActionBy": {
      "$class":"ResourceRevision",
      "action": "Create",
      "user": "admin admin"
   },
   "lastmodified": "2016-06-19T17:35:43",
   "name": "IMG_0002.PNG",
   "permission": "ReadWrite",
   "scope": "InsideCloudFolder",
   "size": 130661}],
   "root": {
      "$class":"ResourceInfo",
      "actionsAllowed": {
         "$class":"AllowedActions",
         "_delete": false,
         "allowChangePassphrase": false,
         "allowShowDeleted": true,
         "copy": false,
         "createFile": false,
         "createFolder": false,
         "createPublicLink": false,
         "download": false,
         "manageSharing": false,
         "move": false,
         "restoreFromBackup": false,
         "seedingExport": false,
         "undelete": false,
         "versioning": false
      },
      "cloudFolderInfo": {
         "$class":"CloudFolderInfo",
         "groupUid": 21296,
         "isShared": false,
         "name": "myfiles",
         "ownerFriendlyName": "admin admin",
         "ownerUid": 21362,
         "passphraseProtected": false,
         "type": "Personal",
         "uid": 21363
      },
      "hasLinks": true,
      "href": "\/ServicesPortal\/webdav\/myfiles",
      "isAttachmentsFolder": false,
      "isCompleted": true,
      "isDeleted": false,
      "isFolder": true,
      "isShared": false,
      "name": "myfiles",
      "permission": "ReadWrite",
      "scope": "Personal",
      "size": 0
   }
}