class BaseCRM::Client
Attributes
Public Class Methods
Instantiate a new BaseCRM
API V2 client
@param options [Hash] Client
options @option options [String] :access_token Personal access token @option options [String] :base_url (api.getbase.com) Base url for the api @option options [String] :use_agent (BaseCRM/v2 Ruby/{Version}) Client
user agent @option options [Integer] :timeout (30) Request timeout @option options [Boolean] :verbose (false) Verbose/debug mode @option options [Logger] :logger (STDOUT) Logged used in verbose mode
@raise [ConfigurationError] if no access token provided @raise [ConfigurationError] if provided access token is invalid - contains disallowed characters @raise [ConfigurationError] if provided access token is invalid - has invalid length @raise [ConfigurationError] if provided base url is invalid
@return [Client] New client
# File lib/basecrm.rb, line 96 def initialize(options={}) @config = Configuration.new(options) @config.validate! @http_client = HttpClient.new(@config) end
Public Instance Methods
Access all Accounts related actions. @see AccountsService
@see Account
@return [AccountsService] Service object for resources.
# File lib/basecrm.rb, line 108 def accounts @accounts ||= AccountsService.new(@http_client) end
Access all AssociatedContacts related actions. @see AssociatedContactsService
@see AssociatedContact
@return [AssociatedContactsService] Service object for resources.
# File lib/basecrm.rb, line 117 def associated_contacts @associated_contacts ||= AssociatedContactsService.new(@http_client) end
Access all CallOutcomes related actions. @see CallOutcomesService
@see CallOutcome
@return [CallOutcomesService] Service object for resources.
# File lib/basecrm.rb, line 135 def call_outcomes @call_outcomes ||= CallOutcomesService.new(@http_client) end
Access all Calls related actions. @see CallsService
@see Call
@return [CallsService] Service object for resources.
# File lib/basecrm.rb, line 126 def calls @calls ||= CallsService.new(@http_client) end
Access all Contacts related actions. @see ContactsService
@see Contact
@return [ContactsService] Service object for resources.
# File lib/basecrm.rb, line 144 def contacts @contacts ||= ContactsService.new(@http_client) end
Access all DealSources related actions. @see DealSourcesService
@see DealSource
@return [DealSourcesService] Service object for resources.
# File lib/basecrm.rb, line 162 def deal_sources @deal_sources ||= DealSourcesService.new(@http_client) end
Access all DealUnqualifiedReasons related actions. @see DealUnqualifiedReasonsService
@see DealUnqualifiedReason
@return [DealUnqualifiedReasonsService] Service object for resources.
# File lib/basecrm.rb, line 171 def deal_unqualified_reasons @deal_unqualified_reasons ||= DealUnqualifiedReasonsService.new(@http_client) end
Access all Deals related actions. @see DealsService
@see Deal
@return [DealsService] Service object for resources.
# File lib/basecrm.rb, line 153 def deals @deals ||= DealsService.new(@http_client) end
Access all LeadSources related actions. @see LeadSourcesService
@see LeadSource
@return [LeadSourcesService] Service object for resources.
# File lib/basecrm.rb, line 189 def lead_sources @lead_sources ||= LeadSourcesService.new(@http_client) end
Access all LeadUnqualifiedReasons related actions. @see LeadUnqualifiedReasonsService
@see LeadUnqualifiedReason
@return [LeadUnqualifiedReasonsService] Service object for resources.
# File lib/basecrm.rb, line 198 def lead_unqualified_reasons @lead_unqualified_reasons ||= LeadUnqualifiedReasonsService.new(@http_client) end
Access all Leads related actions. @see LeadsService
@see Lead
@return [LeadsService] Service object for resources.
# File lib/basecrm.rb, line 180 def leads @leads ||= LeadsService.new(@http_client) end
Access all LineItems related actions. @see LineItemsService
@see LineItem
@return [LineItemsService] Service object for resources.
# File lib/basecrm.rb, line 207 def line_items @line_items ||= LineItemsService.new(@http_client) end
Access all LossReasons related actions. @see LossReasonsService
@see LossReason
@return [LossReasonsService] Service object for resources.
# File lib/basecrm.rb, line 216 def loss_reasons @loss_reasons ||= LossReasonsService.new(@http_client) end
Access all Notes related actions. @see NotesService
@see Note
@return [NotesService] Service object for resources.
# File lib/basecrm.rb, line 225 def notes @notes ||= NotesService.new(@http_client) end
Access all Orders related actions. @see OrdersService
@see Order
@return [OrdersService] Service object for resources.
# File lib/basecrm.rb, line 234 def orders @orders ||= OrdersService.new(@http_client) end
Access all Pipelines related actions. @see PipelinesService
@see Pipeline
@return [PipelinesService] Service object for resources.
# File lib/basecrm.rb, line 243 def pipelines @pipelines ||= PipelinesService.new(@http_client) end
Access all Products related actions. @see ProductsService
@see Product
@return [ProductsService] Service object for resources.
# File lib/basecrm.rb, line 252 def products @products ||= ProductsService.new(@http_client) end
Access all Sources related actions. @see SourcesService
@see Source
@return [SourcesService] Service object for resources.
# File lib/basecrm.rb, line 261 def sources @sources ||= SourcesService.new(@http_client) end
Access all Stages related actions. @see StagesService
@see Stage
@return [StagesService] Service object for resources.
# File lib/basecrm.rb, line 270 def stages @stages ||= StagesService.new(@http_client) end
Access Sync
API related low-level actions. @see SyncService
@return [SyncService] Service object for Sync
API.
# File lib/basecrm.rb, line 332 def sync @sync ||= SyncService.new(@http_client) end
Access all Tasks related actions. @see TasksService
@see Task
@return [TasksService] Service object for resources.
# File lib/basecrm.rb, line 288 def tasks @tasks ||= TasksService.new(@http_client) end
Access all TextMessages related actions. @see TextMessagesService
@see TextMessage
@return [TextMessagesService] Service object for resources.
# File lib/basecrm.rb, line 297 def text_messages @text_messages ||= TextMessagesService.new(@http_client) end
Access all Users related actions. @see UsersService
@see User
@return [UsersService] Service object for resources.
# File lib/basecrm.rb, line 306 def users @users ||= UsersService.new(@http_client) end
Access all VisitOutcomes related actions. @see VisitOutcomesService
@see VisitOutcome
@return [VisitOutcomesService] Service object for resources.
# File lib/basecrm.rb, line 324 def visit_outcomes @visit_outcomes ||= VisitOutcomesService.new(@http_client) end
Access all Visits related actions. @see VisitsService
@see Visit
@return [VisitsService] Service object for resources.
# File lib/basecrm.rb, line 315 def visits @visits ||= VisitsService.new(@http_client) end