Class: SignRequestClient::DocumentsSearchApi

Inherits:
Object
  • Object
show all
Defined in:
lib/signrequest_client/api/documents_search_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DocumentsSearchApi

Returns a new instance of DocumentsSearchApi.



19
20
21
# File 'lib/signrequest_client/api/documents_search_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/signrequest_client/api/documents_search_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#documents_search_list(opts = {}) ⇒ InlineResponse2002

Search documents Search interface for fast (autocomplete) searching of documents. This can be useful to have your users search for a document in your interface. Document names are tokenized on whitespace, hyphens and underscores to also match partial document names. *Normal search:* - ?q={query} *Autocomplete search:* - ?autocomplete=query} *Search in document name:* - ?name={query} *Available (extra) filters:* - ?subdomain=team_subdomain } or use this endpoint with team_subdomain.signrequest.com (when not provided only personal documents are shown) - ?signer_emails[email protected] } (will filter documents that an email needed to sign/approve) - ?status=si } - ?who=mo } To include multiple values for a filter field separate the values with a pipe (|). For example to only search for completed documents use **status=se|vi** (sent and viewed). Pagination: - ?page=page_number: default 1 } - ?limit=limit results: default 10, max 100 } Format: By default json is returned, to export data as csv or xls use the format parameter. - ?format=csv - ?format=xls For csv and xls the data can also be exported with each signer on a separate row. In this mode also the signer inputs that have an external_id specified on a tag will be exported. All external_id’s found will be exported as columns. To use this mode add the signer_data parameter. - ?format=csv&signer_data=1 - ?format=xls&signer_data=1 Note that all documents are only ordered by created (newest first) when q, autocomplete or name are not used, else they are ordered by the strenght of the match.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :limit (Integer)

    Number of results to return per page.

  • :q (String)

    Normal search query

  • :autocomplete (String)

    Partial search query

  • :name (String)

    Document name

  • :subdomain (String)
  • :signer_emails (String)

    Email needed to sign/approve

  • :status (String)

    `co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired

  • :who (String)

    `m`: only me, `mo`: me and others, `o`: only others

  • :format (String)

    Export format, can be `json` (default), `csv`, or `xls`

  • :signer_data (Float)

    Set to `1` to export with each signer on a separate row

Returns:



37
38
39
40
# File 'lib/signrequest_client/api/documents_search_api.rb', line 37

def documents_search_list(opts = {})
  data, _status_code, _headers = documents_search_list_with_http_info(opts)
  data
end

#documents_search_list_with_http_info(opts = {}) ⇒ Array<(InlineResponse2002, Fixnum, Hash)>

Search documents Search interface for fast (autocomplete) searching of documents. This can be useful to have your users search for a document in your interface. Document names are tokenized on whitespace, hyphens and underscores to also match partial document names. *Normal search:* - ?q&#x3D;{query} *Autocomplete search:* - ?autocomplete&#x3D;query} *Search in document name:* - ?name&#x3D;{query} *Available (extra) filters:* - ?subdomain&#x3D;team_subdomain } or use this endpoint with team_subdomain.signrequest.com (when not provided only personal documents are shown) - ?signer_emails&#x3D;[email protected] } (will filter documents that an email needed to sign/approve) - ?status&#x3D;si } - ?who&#x3D;mo } To include multiple values for a filter field separate the values with a pipe (|). For example to only search for completed documents use **status&#x3D;se|vi** (sent and viewed). Pagination: - ?page&#x3D;page_number: default 1 } - ?limit&#x3D;limit results: default 10, max 100 } Format: By default json is returned, to export data as csv or xls use the format parameter. - ?format&#x3D;csv - ?format&#x3D;xls For csv and xls the data can also be exported with each signer on a separate row. In this mode also the signer inputs that have an external_id specified on a tag will be exported. All external_id&#39;s found will be exported as columns. To use this mode add the signer_data parameter. - ?format&#x3D;csv&amp;signer_data&#x3D;1 - ?format&#x3D;xls&amp;signer_data&#x3D;1 Note that all documents are only ordered by created (newest first) when q, autocomplete or name are not used, else they are ordered by the strenght of the match.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :limit (Integer)

    Number of results to return per page.

  • :q (String)

    Normal search query

  • :autocomplete (String)

    Partial search query

  • :name (String)

    Document name

  • :subdomain (String)
  • :signer_emails (String)

    Email needed to sign/approve

  • :status (String)

    &#x60;co&#x60;: converting, &#x60;ne&#x60;: new, &#x60;se&#x60;: sent, &#x60;vi&#x60;: viewed, &#x60;si&#x60;: signed, &#x60;do&#x60;: downloaded, &#x60;sd&#x60;: signed and downloaded, &#x60;ca&#x60;: cancelled, &#x60;de&#x60;: declined, &#x60;ec&#x60;: error converting, &#x60;es&#x60;: error sending, &#x60;xp&#x60;: expired

  • :who (String)

    &#x60;m&#x60;: only me, &#x60;mo&#x60;: me and others, &#x60;o&#x60;: only others

  • :format (String)

    Export format, can be &#x60;json&#x60; (default), &#x60;csv&#x60;, or &#x60;xls&#x60;

  • :signer_data (Float)

    Set to &#x60;1&#x60; to export with each signer on a separate row

Returns:

  • (Array<(InlineResponse2002, Fixnum, Hash)>)

    InlineResponse2002 data, response status code and response headers



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/signrequest_client/api/documents_search_api.rb', line 57

def documents_search_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DocumentsSearchApi.documents_search_list ...'
  end
  # resource path
  local_var_path = '/documents-search/'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'autocomplete'] = opts[:'autocomplete'] if !opts[:'autocomplete'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'subdomain'] = opts[:'subdomain'] if !opts[:'subdomain'].nil?
  query_params[:'signer_emails'] = opts[:'signer_emails'] if !opts[:'signer_emails'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'who'] = opts[:'who'] if !opts[:'who'].nil?
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
  query_params[:'signer_data'] = opts[:'signer_data'] if !opts[:'signer_data'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.ms-excel'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2002')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentsSearchApi#documents_search_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end