About Search

About Search

Contents

Introduction

For all the API calls, you must first obtain an access token. The access token is used to create an instance of the SDK which allows you to access the SDk methods.

Code Sample

SdkClient.new(session[:access_token])

Examples

search performs search for files or folders that match specified criteria.

Required Parameters

  • query – Contains the text to be searched for and supports a number of query fields that allow clients to restrict the search to particular parts of a file’s or folder’s metadata.
  • virtualfolder – Folder that represents various client types at the root level and contains their respective data.
  • sort – Specifies the sort order for a response. Syntax is :{field} + {asc|desc}. Valid values for the field parameter are:
    • name
    • versionCreated
    • size
    • extension
    • album
    • artist
    • captureDate
    • compilation
    • contentType
    • creationDate
    • favorite
    • genre
    • height
    • modificationDate
    • priority
    • source
    • tags
    • title
    • timelineDate
  • start – Page number to return, for paginated responses. Default is 1.
  • count - Maximum items to include in a paginated response, for folder requests. Required if start is specified.

Code Sample

begin
    
    entry = client.search(query,virtualfolder,sort,start,count)
  rescue SdkAuthError => e
    session.delete(:access_token)  # An auth error means the access token is probably bad
    logger.info "Sdk auth error: #{e}"
    return html_page "Sdk auth error"
  rescue SdkError => e
    if e.http_response.code == '404'
      return html_page "Path not found: #{h path}"
    else
      logger.info "Sdk API error: #{e}"
      return html_page "Sdk API error  #{e}"
    end
  end

Example Return Response

{
	"count": 0,
	"file": [{
		"name": "string",
		"parentPath": "string",
		"checksum": "string",
		"contentAccessible": true,
		"contentToken": "string",
		"deleted": true,
		"extension": "string",
		"size": 0,
		"systemAttributes": {},
		"version": 0,
		"versionCreated": "string",
		"viewUid": [{
			"type": "string",
			"viewType": "string",
			"uid": "string"
		}],
		"uri": "string",
		"shareAssociation": [{
			"uid": "string",
			"visibility": "string",
			"name": "string",
			"type": "string"
		}]
	}],
	"folder": [{
		"name": "string",
		"parentPath": "string",
		"size": 0,
		"version": 0,
		"versionCreated": "string",
		"count": 0,
		"deleted": true,
		"viewUid": [null],
		"uri": "string",
		"shareAssociation": [null]
	}]
}

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.