relateiq_client 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -4
- data/README.md +81 -4
- data/lib/relateiq/version.rb +1 -1
- data/relateiq.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90da560ced1f38046deb4d991fceeb7a16e24382
|
4
|
+
data.tar.gz: b86006dd57fb30beace2392a0b4c231b2faba68e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4500954c70b5d1f25205e8c640bb4552b007d1842db4afd008ee6ae8099b8742afafd7353e4edb8de8d6598774ad9729b7cc5bcc7ee8e3a96c40d74893f596d3
|
7
|
+
data.tar.gz: 64e071527776e866801654e41114926f58f84e9178ef268d088b0e9813e71d0517a94620d140c3882d36472d8a6ee51a1202d15007cfe2b89887b01861c65b63
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
relateiq_client (0.1.0)
|
5
|
-
rest-client (~> 1.
|
5
|
+
rest-client (~> 1.8)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -25,15 +25,19 @@ GEM
|
|
25
25
|
safe_yaml (~> 1.0.0)
|
26
26
|
debug_inspector (0.0.2)
|
27
27
|
diff-lcs (1.2.5)
|
28
|
+
domain_name (0.5.24)
|
29
|
+
unf (>= 0.0.5, < 1.0.0)
|
30
|
+
http-cookie (1.0.2)
|
31
|
+
domain_name (~> 0.5)
|
28
32
|
httparty (0.13.5)
|
29
33
|
json (~> 1.8)
|
30
34
|
multi_xml (>= 0.5.2)
|
31
35
|
json (1.8.2)
|
32
36
|
method_source (0.8.2)
|
33
|
-
mime-types (2.6.
|
37
|
+
mime-types (2.6.2)
|
34
38
|
multi_json (1.10.1)
|
35
39
|
multi_xml (0.5.5)
|
36
|
-
netrc (0.
|
40
|
+
netrc (0.10.3)
|
37
41
|
parser (2.2.2.0)
|
38
42
|
ast (>= 1.1, < 3.0)
|
39
43
|
powerpack (0.1.0)
|
@@ -46,7 +50,8 @@ GEM
|
|
46
50
|
pry (>= 0.9.11)
|
47
51
|
rainbow (2.0.0)
|
48
52
|
rake (10.4.2)
|
49
|
-
rest-client (1.
|
53
|
+
rest-client (1.8.0)
|
54
|
+
http-cookie (>= 1.0.2, < 2.0)
|
50
55
|
mime-types (>= 1.16, < 3.0)
|
51
56
|
netrc (~> 0.7)
|
52
57
|
rspec (3.1.0)
|
@@ -80,6 +85,9 @@ GEM
|
|
80
85
|
terminal-table (1.4.5)
|
81
86
|
thor (0.19.1)
|
82
87
|
tilt (2.0.1)
|
88
|
+
unf (0.1.4)
|
89
|
+
unf_ext
|
90
|
+
unf_ext (0.0.7.1)
|
83
91
|
valise (1.1.4)
|
84
92
|
webmock (1.21.0)
|
85
93
|
addressable (>= 2.3.6)
|
data/README.md
CHANGED
@@ -20,17 +20,94 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
### Configuration
|
24
|
+
|
25
|
+
To use this gem you must generate an API access token from the RelateIQ settings
|
26
|
+
screen and allow it access to the lists you want to work with. Once you have
|
27
|
+
your API credentials, you can configure them like so:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
RelateIq.configure do |config|
|
31
|
+
config.baseurl = 'https://api.relateiq.com/v2' # (default)
|
32
|
+
config.username = 'xxx'
|
33
|
+
config.password = 'xxx'
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
### Lists
|
38
|
+
|
39
|
+
#### Find a list by title
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
RelateIq::List.find_by_title('leads')
|
43
|
+
```
|
44
|
+
|
45
|
+
*Note:* case insensitive
|
46
|
+
|
47
|
+
|
48
|
+
#### Find a list by id
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
RelateIq::List.find('xxxYYYaaaa')
|
52
|
+
```
|
53
|
+
|
54
|
+
#### Get all lists
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
RelateIq::List.all
|
58
|
+
```
|
59
|
+
|
60
|
+
*Note:* this gets stored in cache every time it is called (or when any find
|
61
|
+
command is called) to clear the cache use the following
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
RelateIq::List.clean_cache
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Find all list items for a contact
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
list = RelateIq::List.find_by_title('leads')
|
71
|
+
list.items_by_contact_id('somecontactid')
|
72
|
+
```
|
73
|
+
|
74
|
+
#### Upsert Item
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
list = RelateIq::List.find_by_title('leads')
|
78
|
+
list_item_hash = {
|
79
|
+
name: 'Carl Sagan',
|
80
|
+
field_values: {
|
81
|
+
'website': 'https://cosmos.com',
|
82
|
+
'title': 'Astronomer, science educator'
|
83
|
+
}
|
84
|
+
}
|
85
|
+
list.upsert_item(list_item_hash)
|
86
|
+
```
|
87
|
+
|
88
|
+
*Note:* this is where the magic happens with this gem: using the list information
|
89
|
+
pulled from the List.all endpoint that we cached before we can now automatically
|
90
|
+
map field names to values - this is all done for you behind the scenes so you
|
91
|
+
can avoid storing ids for fields.
|
92
|
+
|
93
|
+
Another great benefit for this approach is that it allows you to have a staging
|
94
|
+
list that you can use to test integration and build out new features.
|
24
95
|
|
25
96
|
## Development
|
26
97
|
|
27
|
-
After checking out the repo, run `
|
98
|
+
After checking out the repo, run `bundle install` to install dependencies. Then,
|
99
|
+
run `rspec spec` to run the tests. You can also run `bundle console` for an interactive prompt that will allow you to experiment.
|
28
100
|
|
29
|
-
To install this gem onto your local machine,
|
101
|
+
To install this gem onto your local machine, first build it using `gem build
|
102
|
+
relateiq.gemspec`. When the gem is built you can install it directly using `gem
|
103
|
+
install ./relateiq-0.1.0.gem`.
|
30
104
|
|
31
105
|
## Contributing
|
32
106
|
|
33
|
-
Bug reports and pull requests are welcome on GitHub at
|
107
|
+
Bug reports and pull requests are welcome on GitHub at
|
108
|
+
https://github.com/dkarter/RelateIQClient.
|
109
|
+
|
110
|
+
All pull requests are expected to have specs and be well tested.
|
34
111
|
|
35
112
|
|
36
113
|
## License
|
data/lib/relateiq/version.rb
CHANGED
data/relateiq.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
s.require_paths = [ 'lib' ]
|
22
22
|
|
23
|
-
s.add_dependency 'rest-client', '~> 1.
|
23
|
+
s.add_dependency 'rest-client', '~> 1.8'
|
24
24
|
|
25
25
|
s.add_development_dependency 'bundler', '~> 1.7'
|
26
26
|
s.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relateiq_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Karter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,3 +276,4 @@ test_files:
|
|
276
276
|
- spec/lib/relateiq/utils/field_value_encoder_spec.rb
|
277
277
|
- spec/relate_iq_spec.rb
|
278
278
|
- spec/spec_helper.rb
|
279
|
+
has_rdoc:
|