infusionsoft 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/infusionsoft/client/search.rb +57 -55
- data/lib/infusionsoft/version.rb +1 -1
- metadata +3 -3
@@ -1,64 +1,66 @@
|
|
1
1
|
module Infusionsoft
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
class Client
|
3
|
+
# The SearchService allows you to retrieve the results of saved searches and reports that
|
4
|
+
# have been saved within Infusionsoft. Saved searches/reports are tied to the User that
|
5
|
+
# created them. This service also allows you to utilize the quick search function found in
|
6
|
+
# the upper right hand corner of your Infusionsoft application.
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
8
|
+
# @note In order to retrieve the id number for saved searches you will need to utilize
|
9
|
+
# the data_query method and query the table called SavedFilter based on the user_id
|
10
|
+
# you are looking for the saved search Id for. Also note that UserId field on the
|
11
|
+
# SavedFilter table can contain multiple userId’s separated by a comma, so if you are
|
12
|
+
# querying for a report created by userId 6, I recommend appending the wildcard to the
|
13
|
+
# end of the userId. Something like $query = array( ‘UserId’ => ’6%’ );
|
14
|
+
module Search
|
15
|
+
# Gets all possible fields/columns available for return on a saved search/report.
|
16
|
+
#
|
17
|
+
# @param [Integer] saved_search_id
|
18
|
+
# @param [Integer] user_id the user id who the saved search is assigned to
|
19
|
+
# @return [Hash]
|
20
|
+
def search_get_all_report_columns(saved_search_id, user_id)
|
21
|
+
response = get('SearchService.getAllReportColumns', saved_search_id, user_id)
|
22
|
+
end
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
# Runs a saved search/report and returns all possible fields.
|
25
|
+
#
|
26
|
+
# @param [Integer] saved_search_id
|
27
|
+
# @param [Integer] user_id the user id who the saved search is assigned to
|
28
|
+
# @param [Integer] page_number
|
29
|
+
# @return [Hash]
|
30
|
+
def search_get_saved_search_results(saved_search_id, user_id, page_number)
|
31
|
+
response = get('SearchService.getSavedSearchResultsAllFields', saved_search_id,
|
32
|
+
user_id, page_number)
|
33
|
+
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
# This is used to find what possible quick searches the given user has access to.
|
36
|
+
#
|
37
|
+
# @param [Integer] user_id
|
38
|
+
# @return [Array]
|
39
|
+
def search_get_available_quick_searches(user_id)
|
40
|
+
response = get('SearchService.getAvailableQuickSearches', user_id)
|
41
|
+
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
43
|
+
# This allows you to run a quick search via the API. The quick search is the
|
44
|
+
# search bar in the upper right hand corner of the Infusionsoft application
|
45
|
+
#
|
46
|
+
# @param [String] search_type the type of search (Person, Order, Opportunity, Company, Task,
|
47
|
+
# Subscription, or Affiliate)
|
48
|
+
# @param [Integer] user_id
|
49
|
+
# @param [String] search_data
|
50
|
+
# @param [Integer] page
|
51
|
+
# @param [Integer] limit max is 1000
|
52
|
+
# @return [Array<Hash>]
|
53
|
+
def search_quick_search(search_type, user_id, search_data, page, limit)
|
54
|
+
response = get('SearchService.quickSearch', search_type, user_id, search_data, page, limit)
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
# Retrieves the quick search type that the given users has set as their default.
|
58
|
+
#
|
59
|
+
# @param [Integer] user_id
|
60
|
+
# @return [String] the quick search type that the given user selected as their default
|
61
|
+
def search_get_default_search_type(user_id)
|
62
|
+
response = get('SearchService.getDefaultQuickSearch', user_id)
|
63
|
+
end
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
data/lib/infusionsoft/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infusionsoft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 6
|
10
|
+
version: 1.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Leavitt
|