landslider 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -4
- data/VERSION.yml +1 -1
- data/landslider.gemspec +2 -2
- data/lib/landslider.rb +29 -29
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -4,7 +4,7 @@ Ruby interface to Landslide's SOAP based API
|
|
4
4
|
|
5
5
|
== Pre-requisites
|
6
6
|
|
7
|
-
An account with Landslide that has the API enabled. (www.landslide.com)
|
7
|
+
An account with Landslide that has the API enabled. (www.landslide.com) Contact support@landslide.com to have the API enabled.
|
8
8
|
|
9
9
|
== Resources
|
10
10
|
|
@@ -23,15 +23,15 @@ This gem requires the following gems:
|
|
23
23
|
|
24
24
|
== Usage
|
25
25
|
|
26
|
+
|
26
27
|
Configuration:
|
27
28
|
|
28
29
|
# constants to be set by rails environment config files
|
29
30
|
|
30
31
|
LS_INSTANCE_NAME = 'jaytest'
|
31
32
|
LS_API_USERNAME = 'jayp@landslide.com'
|
32
|
-
|
33
|
-
#
|
34
|
-
# see bin/generate_api_key.rb for an example
|
33
|
+
|
34
|
+
# see bin/generate_api_key.rb for details on how to generate this key
|
35
35
|
LS_API_KEY = '53308ccbdcb7f23fbd81a0b2ebcf12a4'
|
36
36
|
|
37
37
|
require 'landslider'
|
data/VERSION.yml
CHANGED
data/landslider.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{landslider}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jay Prall"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-03}
|
13
13
|
s.default_executable = %q{generate_api_key.rb}
|
14
14
|
s.description = %q{Landslider is a ruby interface to the Landslide SOAP-based API}
|
15
15
|
s.email = %q{jay@j4y.net}
|
data/lib/landslider.rb
CHANGED
@@ -21,7 +21,7 @@ class Landslider < Handsoap::Service
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def on_after_create_http_request(http_request)
|
24
|
-
http_request.headers.merge!({'user-agent' => [
|
24
|
+
http_request.headers.merge!({'user-agent' => ['landslider-ruby-gem-version-0.4.6']})
|
25
25
|
|
26
26
|
# TODO: use cookies to maintain session state
|
27
27
|
# http_request.headers.merge!({'cookie' => ["JSESSIONID=#{self.session_id}"]})
|
@@ -34,7 +34,7 @@ class Landslider < Handsoap::Service
|
|
34
34
|
def login(session_id)
|
35
35
|
self.session_id = session_id
|
36
36
|
|
37
|
-
response = invoke(
|
37
|
+
response = invoke('login', :soap_action => :none) do |message|
|
38
38
|
message.add('wsUser') { |u|
|
39
39
|
u.add 'username', ::LS_API_USERNAME
|
40
40
|
u.add 'password', ::LS_API_KEY
|
@@ -48,7 +48,7 @@ class Landslider < Handsoap::Service
|
|
48
48
|
def get_api_version(session_id)
|
49
49
|
self.session_id = session_id
|
50
50
|
|
51
|
-
response = invoke(
|
51
|
+
response = invoke('getApiVersion', :soap_action => :none)
|
52
52
|
|
53
53
|
node = response.document.xpath('//ns:getApiVersionResponse', ns)
|
54
54
|
parse_api_version_result(node)
|
@@ -56,7 +56,7 @@ class Landslider < Handsoap::Service
|
|
56
56
|
|
57
57
|
def get_accounts(session_id, first_result_position=1, total_results_requested=25)
|
58
58
|
self.session_id = session_id
|
59
|
-
response = invoke(
|
59
|
+
response = invoke('getAccounts', :soap_action => :none) do |message|
|
60
60
|
message.add('accountsRequest') { |ar|
|
61
61
|
ar.add 'firstResultPosition', first_result_position
|
62
62
|
ar.add 'totalResultsRequested', total_results_requested
|
@@ -76,7 +76,7 @@ class Landslider < Handsoap::Service
|
|
76
76
|
def get_account_by_id(session_id, account_id)
|
77
77
|
self.session_id = session_id
|
78
78
|
|
79
|
-
response = invoke(
|
79
|
+
response = invoke('getAccountById', :soap_action => :none) do |message|
|
80
80
|
message.add 'accountId', account_id
|
81
81
|
end
|
82
82
|
|
@@ -86,7 +86,7 @@ class Landslider < Handsoap::Service
|
|
86
86
|
|
87
87
|
def get_account_contacts(session_id, account_id, is_primary=false)
|
88
88
|
self.session_id = session_id
|
89
|
-
response = invoke(
|
89
|
+
response = invoke('getAccountContacts', :soap_action => :none) do |message|
|
90
90
|
message.add 'accountId', account_id
|
91
91
|
message.add 'isPrimary', is_primary
|
92
92
|
end
|
@@ -96,7 +96,7 @@ class Landslider < Handsoap::Service
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def get_account_custom_fields(session_id)
|
99
|
-
response = invoke(
|
99
|
+
response = invoke('getAccountCustomFields')
|
100
100
|
node = response.document.xpath('//ns:getAccountCustomFieldsResponse', ns)
|
101
101
|
parse_get_entity_custom_fields_result(node)
|
102
102
|
end
|
@@ -104,7 +104,7 @@ class Landslider < Handsoap::Service
|
|
104
104
|
def get_account_notes(session_id, account_id, first_result_position=1, total_results_requested=25)
|
105
105
|
self.session_id = session_id
|
106
106
|
|
107
|
-
response = invoke(
|
107
|
+
response = invoke('getAccountNotes', :soap_action => :none) do |message|
|
108
108
|
message.add('accountNoteSearch') { |ans|
|
109
109
|
|
110
110
|
ans.add 'accountId', account_id
|
@@ -125,7 +125,7 @@ class Landslider < Handsoap::Service
|
|
125
125
|
|
126
126
|
def get_account_opportunities(session_id, account_id)
|
127
127
|
self.session_id = session_id
|
128
|
-
response = invoke(
|
128
|
+
response = invoke('getAccountOpportunities', :soap_action => :none) do |message|
|
129
129
|
message.add 'accountId', account_id
|
130
130
|
end
|
131
131
|
|
@@ -136,7 +136,7 @@ class Landslider < Handsoap::Service
|
|
136
136
|
def get_contacts(session_id, first_result_position=1, total_results_requested=25)
|
137
137
|
self.session_id = session_id
|
138
138
|
|
139
|
-
response = invoke(
|
139
|
+
response = invoke('getContacts', :soap_action => :none) do |message|
|
140
140
|
message.add('contactsRequest') { |c|
|
141
141
|
c.add 'firstResultPosition', first_result_position
|
142
142
|
c.add 'totalResultsRequested', total_results_requested
|
@@ -149,7 +149,7 @@ class Landslider < Handsoap::Service
|
|
149
149
|
def get_contact_custom_fields(session_id)
|
150
150
|
self.session_id = session_id
|
151
151
|
|
152
|
-
response = invoke(
|
152
|
+
response = invoke('getContactCustomFields')
|
153
153
|
node = response.document.xpath('//ns:getContactCustomFieldsResponse', ns)
|
154
154
|
parse_get_entity_custom_fields_result(node)
|
155
155
|
end
|
@@ -157,7 +157,7 @@ class Landslider < Handsoap::Service
|
|
157
157
|
def get_contact_notes(session_id, contact_id, first_result_position=1, total_results_requested=25)
|
158
158
|
self.session_id = session_id
|
159
159
|
|
160
|
-
response = invoke(
|
160
|
+
response = invoke('getContactNotes', :soap_action => :none) do |message|
|
161
161
|
message.add('contactNote') { |ans|
|
162
162
|
ans.add 'contactId', contact_id
|
163
163
|
ans.add 'firstResultPosition', first_result_position
|
@@ -172,7 +172,7 @@ class Landslider < Handsoap::Service
|
|
172
172
|
def get_instance_information(session_id, user_id)
|
173
173
|
self.session_id = session_id
|
174
174
|
|
175
|
-
response = invoke(
|
175
|
+
response = invoke('getInstanceInformation', :soap_action => :none) do |message|
|
176
176
|
message.add 'userId', user_id
|
177
177
|
end
|
178
178
|
node = response.document.xpath('//ns:getInstanceInformationResponse', ns)
|
@@ -182,9 +182,8 @@ class Landslider < Handsoap::Service
|
|
182
182
|
def get_leads(session_id, account_id, first_result_position=1, total_results_requested=25)
|
183
183
|
self.session_id = session_id
|
184
184
|
|
185
|
-
response = invoke(
|
185
|
+
response = invoke('getLeads', :soap_action => :none) do |message|
|
186
186
|
message.add('leadRequest') { |lr|
|
187
|
-
|
188
187
|
lr.add 'firstResultPosition', first_result_position
|
189
188
|
lr.add 'totalResultsRequested', total_results_requested
|
190
189
|
}
|
@@ -195,7 +194,7 @@ class Landslider < Handsoap::Service
|
|
195
194
|
end
|
196
195
|
|
197
196
|
def get_lead_custom_fields(session_id)
|
198
|
-
response = invoke(
|
197
|
+
response = invoke('getLeadCustomFields')
|
199
198
|
node = response.document.xpath('//ns:getLeadCustomFieldsResponse', ns)
|
200
199
|
parse_get_entity_custom_fields_result(node)
|
201
200
|
end
|
@@ -203,9 +202,8 @@ class Landslider < Handsoap::Service
|
|
203
202
|
def get_lead_notes(session_id, lead_id, first_result_position=1, total_results_requested=25)
|
204
203
|
self.session_id = session_id
|
205
204
|
|
206
|
-
response = invoke(
|
205
|
+
response = invoke('getLeadNotes', :soap_action => :none) do |message|
|
207
206
|
message.add('leadNote') { |ans|
|
208
|
-
|
209
207
|
ans.add 'leadId', lead_id
|
210
208
|
ans.add 'firstResultPosition', first_result_position
|
211
209
|
ans.add 'totalResultsRequested', total_results_requested
|
@@ -218,7 +216,7 @@ class Landslider < Handsoap::Service
|
|
218
216
|
def get_opportunities(session_id, first_result_position=1, total_results_requested=25)
|
219
217
|
self.session_id = session_id
|
220
218
|
|
221
|
-
response = invoke(
|
219
|
+
response = invoke('getOpportunities', :soap_action => :none) do |message|
|
222
220
|
message.add('opportunityRequest') { |req|
|
223
221
|
req.add 'firstResultPosition', first_result_position
|
224
222
|
req.add 'totalResultsRequested', total_results_requested
|
@@ -231,7 +229,7 @@ class Landslider < Handsoap::Service
|
|
231
229
|
def get_opportunity_custom_fields(session_id)
|
232
230
|
self.session_id = session_id
|
233
231
|
|
234
|
-
response = invoke(
|
232
|
+
response = invoke('getOpportunityCustomFields')
|
235
233
|
node = response.document.xpath('//ns:getOpportunityCustomFieldsResponse', ns)
|
236
234
|
parse_get_entity_custom_fields_result(node)
|
237
235
|
end
|
@@ -239,7 +237,7 @@ class Landslider < Handsoap::Service
|
|
239
237
|
def get_opportunity_notes(session_id, opportunity_id, first_result_position=1, total_results_requested=25)
|
240
238
|
self.session_id = session_id
|
241
239
|
|
242
|
-
response = invoke(
|
240
|
+
response = invoke('getOpportunityNotes', :soap_action => :none) do |message|
|
243
241
|
message.add('opportunityNote') { |ans|
|
244
242
|
|
245
243
|
ans.add 'opportunityId', opportunity_id
|
@@ -254,7 +252,7 @@ class Landslider < Handsoap::Service
|
|
254
252
|
def get_user_information(session_id, user_id)
|
255
253
|
|
256
254
|
self.session_id = session_id
|
257
|
-
response = invoke(
|
255
|
+
response = invoke('getUserInformation', :soap_action => :none) do |message|
|
258
256
|
message.add 'userId', user_id
|
259
257
|
end
|
260
258
|
node = response.document.xpath('//ns:getUserInformationResponse', ns)
|
@@ -264,7 +262,7 @@ class Landslider < Handsoap::Service
|
|
264
262
|
def get_user_information_by_id(session_id, user_id)
|
265
263
|
self.session_id = session_id
|
266
264
|
|
267
|
-
response = invoke(
|
265
|
+
response = invoke('getUserInformationById', :soap_action => :none) do |message|
|
268
266
|
message.add 'userId', user_id
|
269
267
|
end
|
270
268
|
node = response.document.xpath('//ns:getUserInformationByIdResponse', ns)
|
@@ -413,14 +411,16 @@ class Landslider < Handsoap::Service
|
|
413
411
|
end
|
414
412
|
|
415
413
|
def parse_get_lead_notes_result(node)
|
414
|
+
|
415
|
+
puts node.inspect
|
416
416
|
notes = parse_notes(node)
|
417
417
|
{
|
418
|
-
:error => xml_to_bool(node, '
|
419
|
-
:error_code => xml_to_int(node, '
|
420
|
-
:result_msg => xml_to_str(node, '
|
421
|
-
:status_code => xml_to_int(node, '
|
422
|
-
:results_returned => xml_to_int(node, '
|
423
|
-
:total_results_available => xml_to_int(node, '
|
418
|
+
:error => xml_to_bool(node, './Notes/error/text()'),
|
419
|
+
:error_code => xml_to_int(node, './Notes/errorCode/text()'),
|
420
|
+
:result_msg => xml_to_str(node, './Notes/resultMsg/text()'),
|
421
|
+
:status_code => xml_to_int(node, './Notes/statusCode/text()'),
|
422
|
+
:results_returned => xml_to_int(node, './Notes/resultsReturned/text()'),
|
423
|
+
:total_results_available => xml_to_int(node, './Notes/totalResultsAvailable/text()')
|
424
424
|
}.merge(notes)
|
425
425
|
end
|
426
426
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: landslider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jay Prall
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-03 00:00:00 -04:00
|
14
14
|
default_executable: generate_api_key.rb
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|