-
Notifications
You must be signed in to change notification settings - Fork 11
Session
The Pipejump::Session instance represents an active Session with the Base API
Any access to the Base API requires authentication, which means you need to initialize a Pipejump::Session instance before calling any other methods
To authenticate, simply call Pipejump::Session.new with a argument hash with the following keys:
-
email - your Base user account email
-
password - your Base user account password
-
endpoint - (optional) Default is sales.futuresimple.com, however you can override it (for example for development)
You can perform later actions either on a instance returned by the canstructor or within a supplied block
@session = Pipejump::Session.new(:email => EMAIL, :password => PASSWORD)
@session.account
or
Pipejump::Session.new(:email => EMAIL, :password => PASSWORD) do |session|
session.account
end
As of version 0.1.1 you can use the token which is fetched when authenticating using the email and password. So once you get the token, you can use it for future initialization of the Session and not send the username and password, which is a more secure.
@session = Pipejump::Session.new(:token => 'your_token')
To access the Account instance, call the account method
@session.account # => #<Pipejump::Account name: "myaccount", id: "1", currency_name: "$">
You can access your deals by calling
@session.deals
With Deals you get access to Notes, Reminders and Deal Contacts.
For more information, consult the Deals page.
You can access your clients by calling
@session.clients
For more information, consult the Clients page.
You can access your contacts by calling
@session.contacts
For more information, consult the Contacts page.
You can access your sources by calling
@session.sources
For more information, consult the Sources page.