send_sonar 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -8
- data/README.md +113 -37
- data/RELEASE.md +18 -11
- data/lib/send_sonar.rb +39 -5
- data/lib/send_sonar/client.rb +32 -18
- data/lib/send_sonar/configuration.rb +5 -1
- data/lib/send_sonar/endpoints.yml +16 -0
- data/lib/send_sonar/exceptions.rb +5 -2
- data/lib/send_sonar/version.rb +1 -1
- data/send_sonar.gemspec +7 -7
- data/spec/integrations/simple_desk_spec.rb +308 -41
- data/spec/vcr_cassettes/add_update_customer.yml +58 -0
- data/spec/vcr_cassettes/available_phone_number.yml +54 -0
- data/spec/vcr_cassettes/available_phone_number_bad_publishable_key.yml +52 -0
- data/spec/vcr_cassettes/close_customer.yml +58 -0
- data/spec/vcr_cassettes/close_customer_bad_token.yml +56 -0
- data/spec/vcr_cassettes/delete_customer_property_bad_token.yml +56 -0
- data/spec/vcr_cassettes/delete_customer_property_with_email.yml +58 -0
- data/spec/vcr_cassettes/delete_customer_property_with_phone_number.yml +58 -0
- data/spec/vcr_cassettes/get_customer.yml +50 -0
- data/spec/vcr_cassettes/get_customer_bad_token.yml +48 -0
- data/spec/vcr_cassettes/send_campaign.yml +56 -0
- data/spec/vcr_cassettes/send_campaign_bad_token.yml +56 -0
- metadata +67 -20
- data/Gemfile.ruby-18 +0 -6
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers?phone_number=%2B13105551111&token=99siwE4WRn6bg_B_ktm6h2w6Kez0JYLL
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (darwin15.5.0 x86_64) ruby/2.3.1p112
|
16
|
+
Host:
|
17
|
+
- sandbox.sendsonar.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- Cowboy
|
25
|
+
Date:
|
26
|
+
- Thu, 05 Oct 2017 00:28:15 GMT
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Etag:
|
32
|
+
- W/"71a571a694ae6de84e1a624b1c0c16a5"
|
33
|
+
Cache-Control:
|
34
|
+
- max-age=0, private, must-revalidate
|
35
|
+
X-Request-Id:
|
36
|
+
- c3251968-445b-4790-a387-e68afd67a5a6
|
37
|
+
X-Runtime:
|
38
|
+
- '0.996012'
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=31536000
|
41
|
+
Content-Length:
|
42
|
+
- '260'
|
43
|
+
Via:
|
44
|
+
- 1.1 vegur
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: '{"phone_number":"+13105551111","first_name":"One","last_name":"Example","email":"one@example.com","assigned_phone_number":"+17573780424","subscribed":true,"unsubscribed_at":null,"properties":{"great_customer":"true","first_customer":"true"},"external_id":null}'
|
48
|
+
http_version:
|
49
|
+
recorded_at: Thu, 05 Oct 2017 00:28:16 GMT
|
50
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers?phone_number=%2B13105551111&token=FAKE_TOKEN
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (darwin15.5.0 x86_64) ruby/2.3.1p112
|
16
|
+
Host:
|
17
|
+
- sandbox.sendsonar.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 401
|
21
|
+
message: Unauthorized
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- Cowboy
|
25
|
+
Date:
|
26
|
+
- Thu, 05 Oct 2017 22:35:08 GMT
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Cache-Control:
|
32
|
+
- no-cache
|
33
|
+
X-Request-Id:
|
34
|
+
- a924d9c5-70bf-4a43-b68f-b17c763fa8db
|
35
|
+
X-Runtime:
|
36
|
+
- '0.012344'
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=31536000
|
39
|
+
Content-Length:
|
40
|
+
- '46'
|
41
|
+
Via:
|
42
|
+
- 1.1 vegur
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: '{"error":"Token or publishable_key not found"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Thu, 05 Oct 2017 22:35:08 GMT
|
48
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/campaigns
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: to=%2B13105551111&campaign_id=test_d0Bu23
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (darwin15.5.0 x86_64) ruby/2.3.1p112
|
16
|
+
Token:
|
17
|
+
- 99siwE4WRn6bg_B_ktm6h2w6Kez0JYLL
|
18
|
+
Client:
|
19
|
+
- rubygem 1.1.0
|
20
|
+
Content-Length:
|
21
|
+
- '41'
|
22
|
+
Content-Type:
|
23
|
+
- application/x-www-form-urlencoded
|
24
|
+
Host:
|
25
|
+
- sandbox.sendsonar.com
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 202
|
29
|
+
message: Accepted
|
30
|
+
headers:
|
31
|
+
Server:
|
32
|
+
- Cowboy
|
33
|
+
Date:
|
34
|
+
- Tue, 03 Oct 2017 23:44:37 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Cache-Control:
|
40
|
+
- no-cache
|
41
|
+
X-Request-Id:
|
42
|
+
- e46f09a7-e31a-463e-a3b3-ad1fd23a1742
|
43
|
+
X-Runtime:
|
44
|
+
- '0.074346'
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=31536000
|
47
|
+
Content-Length:
|
48
|
+
- '53'
|
49
|
+
Via:
|
50
|
+
- 1.1 vegur
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"to":"+13105551111","text":"sent","status":"queued"}'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Tue, 03 Oct 2017 23:44:37 GMT
|
56
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/campaigns
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: to=%2B13105551111&campaign_id=test_d0Bu23
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (darwin15.5.0 x86_64) ruby/2.3.1p112
|
16
|
+
Client:
|
17
|
+
- rubygem 1.1.0
|
18
|
+
Token:
|
19
|
+
- FAKE_TOKEN
|
20
|
+
Content-Length:
|
21
|
+
- '41'
|
22
|
+
Content-Type:
|
23
|
+
- application/x-www-form-urlencoded
|
24
|
+
Host:
|
25
|
+
- sandbox.sendsonar.com
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 401
|
29
|
+
message: Unauthorized
|
30
|
+
headers:
|
31
|
+
Server:
|
32
|
+
- Cowboy
|
33
|
+
Date:
|
34
|
+
- Thu, 05 Oct 2017 21:54:14 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Cache-Control:
|
40
|
+
- no-cache
|
41
|
+
X-Request-Id:
|
42
|
+
- 7f083299-78ba-47b3-9bdc-996b2689f6d9
|
43
|
+
X-Runtime:
|
44
|
+
- '0.011235'
|
45
|
+
Strict-Transport-Security:
|
46
|
+
- max-age=31536000
|
47
|
+
Content-Length:
|
48
|
+
- '46'
|
49
|
+
Via:
|
50
|
+
- 1.1 vegur
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"error":"Token or publishable_key not found"}'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Thu, 05 Oct 2017 21:54:15 GMT
|
56
|
+
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: send_sonar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Berman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,98 +16,122 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.15'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.15.4
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
29
|
+
version: '1.15'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.15.4
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '12.1'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '12.1'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rspec
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
53
|
+
version: '3.6'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
60
|
+
version: '3.6'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: vcr
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
67
|
+
version: '3.0'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 3.0.3
|
62
71
|
type: :development
|
63
72
|
prerelease: false
|
64
73
|
version_requirements: !ruby/object:Gem::Requirement
|
65
74
|
requirements:
|
66
75
|
- - "~>"
|
67
76
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
77
|
+
version: '3.0'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 3.0.3
|
69
81
|
- !ruby/object:Gem::Dependency
|
70
82
|
name: webmock
|
71
83
|
requirement: !ruby/object:Gem::Requirement
|
72
84
|
requirements:
|
73
85
|
- - "~>"
|
74
86
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
87
|
+
version: '3.0'
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 3.0.1
|
76
91
|
type: :development
|
77
92
|
prerelease: false
|
78
93
|
version_requirements: !ruby/object:Gem::Requirement
|
79
94
|
requirements:
|
80
95
|
- - "~>"
|
81
96
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
97
|
+
version: '3.0'
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 3.0.1
|
83
101
|
- !ruby/object:Gem::Dependency
|
84
102
|
name: json
|
85
103
|
requirement: !ruby/object:Gem::Requirement
|
86
104
|
requirements:
|
87
|
-
- - "
|
105
|
+
- - "~>"
|
88
106
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
107
|
+
version: '2.1'
|
90
108
|
type: :development
|
91
109
|
prerelease: false
|
92
110
|
version_requirements: !ruby/object:Gem::Requirement
|
93
111
|
requirements:
|
94
|
-
- - "
|
112
|
+
- - "~>"
|
95
113
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
114
|
+
version: '2.1'
|
97
115
|
- !ruby/object:Gem::Dependency
|
98
116
|
name: rest-client
|
99
117
|
requirement: !ruby/object:Gem::Requirement
|
100
118
|
requirements:
|
101
119
|
- - "~>"
|
102
120
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
121
|
+
version: '2.0'
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.0.2
|
104
125
|
type: :runtime
|
105
126
|
prerelease: false
|
106
127
|
version_requirements: !ruby/object:Gem::Requirement
|
107
128
|
requirements:
|
108
129
|
- - "~>"
|
109
130
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
131
|
+
version: '2.0'
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: 2.0.2
|
111
135
|
description: ''
|
112
136
|
email:
|
113
137
|
- matt@sendsonar.com
|
@@ -118,7 +142,6 @@ files:
|
|
118
142
|
- ".gitignore"
|
119
143
|
- ".travis.yml"
|
120
144
|
- Gemfile
|
121
|
-
- Gemfile.ruby-18
|
122
145
|
- LICENSE.txt
|
123
146
|
- README.md
|
124
147
|
- RELEASE.md
|
@@ -138,12 +161,24 @@ files:
|
|
138
161
|
- spec/vcr_cassettes/add_customer_bad_token.yml
|
139
162
|
- spec/vcr_cassettes/add_customer_invalid_phone_number.yml
|
140
163
|
- spec/vcr_cassettes/add_customer_no_subscription.yml
|
164
|
+
- spec/vcr_cassettes/add_update_customer.yml
|
165
|
+
- spec/vcr_cassettes/available_phone_number.yml
|
166
|
+
- spec/vcr_cassettes/available_phone_number_bad_publishable_key.yml
|
167
|
+
- spec/vcr_cassettes/close_customer.yml
|
168
|
+
- spec/vcr_cassettes/close_customer_bad_token.yml
|
169
|
+
- spec/vcr_cassettes/delete_customer_property_bad_token.yml
|
170
|
+
- spec/vcr_cassettes/delete_customer_property_with_email.yml
|
171
|
+
- spec/vcr_cassettes/delete_customer_property_with_phone_number.yml
|
172
|
+
- spec/vcr_cassettes/get_customer.yml
|
173
|
+
- spec/vcr_cassettes/get_customer_bad_token.yml
|
141
174
|
- spec/vcr_cassettes/message_customer.yml
|
142
175
|
- spec/vcr_cassettes/message_customer_api_disabled.yml
|
143
176
|
- spec/vcr_cassettes/message_customer_bad_params.yml
|
144
177
|
- spec/vcr_cassettes/message_customer_bad_token.yml
|
145
178
|
- spec/vcr_cassettes/message_customer_invalid_phone_number.yml
|
146
179
|
- spec/vcr_cassettes/message_customer_no_subscription.yml
|
180
|
+
- spec/vcr_cassettes/send_campaign.yml
|
181
|
+
- spec/vcr_cassettes/send_campaign_bad_token.yml
|
147
182
|
homepage: http://github.com/sendsonar/send_sonar_gem
|
148
183
|
licenses:
|
149
184
|
- MIT
|
@@ -164,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
199
|
version: '0'
|
165
200
|
requirements: []
|
166
201
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.6.12
|
168
203
|
signing_key:
|
169
204
|
specification_version: 4
|
170
205
|
summary: Provides a clean and simple gem to connect to Sonar
|
@@ -177,9 +212,21 @@ test_files:
|
|
177
212
|
- spec/vcr_cassettes/add_customer_bad_token.yml
|
178
213
|
- spec/vcr_cassettes/add_customer_invalid_phone_number.yml
|
179
214
|
- spec/vcr_cassettes/add_customer_no_subscription.yml
|
215
|
+
- spec/vcr_cassettes/add_update_customer.yml
|
216
|
+
- spec/vcr_cassettes/available_phone_number.yml
|
217
|
+
- spec/vcr_cassettes/available_phone_number_bad_publishable_key.yml
|
218
|
+
- spec/vcr_cassettes/close_customer.yml
|
219
|
+
- spec/vcr_cassettes/close_customer_bad_token.yml
|
220
|
+
- spec/vcr_cassettes/delete_customer_property_bad_token.yml
|
221
|
+
- spec/vcr_cassettes/delete_customer_property_with_email.yml
|
222
|
+
- spec/vcr_cassettes/delete_customer_property_with_phone_number.yml
|
223
|
+
- spec/vcr_cassettes/get_customer.yml
|
224
|
+
- spec/vcr_cassettes/get_customer_bad_token.yml
|
180
225
|
- spec/vcr_cassettes/message_customer.yml
|
181
226
|
- spec/vcr_cassettes/message_customer_api_disabled.yml
|
182
227
|
- spec/vcr_cassettes/message_customer_bad_params.yml
|
183
228
|
- spec/vcr_cassettes/message_customer_bad_token.yml
|
184
229
|
- spec/vcr_cassettes/message_customer_invalid_phone_number.yml
|
185
230
|
- spec/vcr_cassettes/message_customer_no_subscription.yml
|
231
|
+
- spec/vcr_cassettes/send_campaign.yml
|
232
|
+
- spec/vcr_cassettes/send_campaign_bad_token.yml
|