Module: RdInsightly::ApiInsightly

Defined in:
lib/rd_insightly/insightly/api_insightly.rb

Constant Summary collapse

AUTHORIZED =
true
UNAUTHORIZED =
false

Class Method Summary collapse

Class Method Details

.authenticationObject



6
7
8
9
10
11
# File 'lib/rd_insightly/insightly/api_insightly.rb', line 6

def self.authentication
  RestClient.get('https://api.insight.ly/v2.1/contacts', Authorization: authorization_string)
  AUTHORIZED
rescue
  UNAUTHORIZED
end

.authorization_stringObject



19
20
21
# File 'lib/rd_insightly/insightly/api_insightly.rb', line 19

def self.authorization_string
  "Basic #{Base64.encode64(RdInsightly.api_token)}"
end

.leadsObject



13
14
15
16
17
# File 'lib/rd_insightly/insightly/api_insightly.rb', line 13

def self.leads
  RestClient.get('https://api.insight.ly/v2.1/contacts', Authorization: authorization_string)
rescue
  nil
end