Method: BaseCRM::NotesService#where

Defined in:
lib/basecrm/services/notes_service.rb

#where(options = {}) ⇒ Array<Note>

Retrieve all notes

get ‘/notes’

Returns all notes available to the user, according to the parameters provided

Parameters:

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

    Search options

Options Hash (options):

  • :creator_id (Integer)

    Unique identifier of the user. Returns all notes created by the user.

  • :ids (String)

    Comma-separated list of note IDs to be returned in a request.

  • :includes (String)

    Comma-separated list of one or more resources related to the note. **Not supported at the moment**.

  • :page (Integer) — default: 1

    Page number to start from. Page numbering starts at 1, and omitting the ‘page` parameter will return the first page.

  • :per_page (Integer) — default: 25

    Number of records to return per page. The default limit is 25 and the maximum number that can be returned at one time is 100.

  • :q (String)

    A query string to search for. Performs a full text search on the ‘content` field.

  • :resource_id (Integer)

    Unique identifier of the resource to search for.

  • :resource_type (String)

    Name of the type of resource to search for.

  • :sort_by (String) — default: updated_at:asc

    A field to sort by. Default ordering is ascending. If you want to change the sort ordering to descending, append ‘:desc` to the field e.g. `sort_by=resource_type:desc`.

Returns:

  • (Array<Note>)

    The list of Notes for the first page, unless otherwise specified.



38
39
40
41
42
# File 'lib/basecrm/services/notes_service.rb', line 38

def where(options = {})
  _, _, root = @client.get("/notes", options)

  root[:items].map{ |item| Note.new(item[:data]) }
end