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,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: phone_number=%2B13105555555&email=five%40example.com&first_name=Five&last_name=Example&properties[great_customer]=true
|
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
|
+
- 99siwE4WRn6bg_B_ktm6h2w6Kez0JYLL
|
20
|
+
Content-Length:
|
21
|
+
- '118'
|
22
|
+
Content-Type:
|
23
|
+
- application/x-www-form-urlencoded
|
24
|
+
Host:
|
25
|
+
- sandbox.sendsonar.com
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 201
|
29
|
+
message: Created
|
30
|
+
headers:
|
31
|
+
Server:
|
32
|
+
- Cowboy
|
33
|
+
Date:
|
34
|
+
- Tue, 10 Oct 2017 23:40:15 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Etag:
|
40
|
+
- W/"c9731e89bc35e8bf098fb635e154d319"
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, private, must-revalidate
|
43
|
+
X-Request-Id:
|
44
|
+
- ec77f356-0e86-407c-9e3d-37e515c67b3c
|
45
|
+
X-Runtime:
|
46
|
+
- '1.024614'
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=31536000
|
49
|
+
Content-Length:
|
50
|
+
- '173'
|
51
|
+
Via:
|
52
|
+
- 1.1 vegur
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"phone_number":"+13105555555","email":"five@example.com","first_name":"Five","last_name":"Example","subscribed":true,"properties":{"great_customer":"true"},"assignee":null}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Tue, 10 Oct 2017 23:40:15 GMT
|
58
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/phone_numbers/available
|
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
|
+
Client:
|
17
|
+
- rubygem 1.1.0
|
18
|
+
X-Publishable-Key:
|
19
|
+
- f77a884d-4c52-4369-90c2-22a3d5607c24
|
20
|
+
Host:
|
21
|
+
- sandbox.sendsonar.com
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- Cowboy
|
29
|
+
Date:
|
30
|
+
- Thu, 05 Oct 2017 21:06:00 GMT
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Content-Type:
|
34
|
+
- application/json
|
35
|
+
Etag:
|
36
|
+
- W/"c595b07a0c70184b0b0696babbd0aa85"
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
X-Request-Id:
|
40
|
+
- e905b3f2-8a4e-4770-b562-97496c4fbe4d
|
41
|
+
X-Runtime:
|
42
|
+
- '0.042641'
|
43
|
+
Strict-Transport-Security:
|
44
|
+
- max-age=31536000
|
45
|
+
Content-Length:
|
46
|
+
- '33'
|
47
|
+
Via:
|
48
|
+
- 1.1 vegur
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"available_number":"7573780424"}'
|
52
|
+
http_version:
|
53
|
+
recorded_at: Thu, 05 Oct 2017 21:06:01 GMT
|
54
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/phone_numbers/available
|
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
|
+
Client:
|
17
|
+
- rubygem 1.1.0
|
18
|
+
X-Publishable-Key:
|
19
|
+
- BAD_PUBLISHABLE_KEY
|
20
|
+
Host:
|
21
|
+
- sandbox.sendsonar.com
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 401
|
25
|
+
message: Unauthorized
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- Cowboy
|
29
|
+
Date:
|
30
|
+
- Thu, 05 Oct 2017 22:42:18 GMT
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Content-Type:
|
34
|
+
- application/json
|
35
|
+
Cache-Control:
|
36
|
+
- no-cache
|
37
|
+
X-Request-Id:
|
38
|
+
- 8290e400-f582-444e-ac08-523514feab24
|
39
|
+
X-Runtime:
|
40
|
+
- '0.008342'
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=31536000
|
43
|
+
Content-Length:
|
44
|
+
- '46'
|
45
|
+
Via:
|
46
|
+
- 1.1 vegur
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"error":"Token or publishable_key not found"}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Thu, 05 Oct 2017 22:42:18 GMT
|
52
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers/close
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: phone_number=%2B13105551111
|
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
|
+
- '27'
|
22
|
+
Content-Type:
|
23
|
+
- application/x-www-form-urlencoded
|
24
|
+
Host:
|
25
|
+
- sandbox.sendsonar.com
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 201
|
29
|
+
message: Created
|
30
|
+
headers:
|
31
|
+
Server:
|
32
|
+
- Cowboy
|
33
|
+
Date:
|
34
|
+
- Wed, 04 Oct 2017 00:47:31 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Etag:
|
40
|
+
- W/"7363e85fe9edee6f053a4b319588c086"
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, private, must-revalidate
|
43
|
+
X-Request-Id:
|
44
|
+
- 304480f7-ecfb-4692-817f-4f0146dfcabc
|
45
|
+
X-Runtime:
|
46
|
+
- '0.212731'
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=31536000
|
49
|
+
Content-Length:
|
50
|
+
- '16'
|
51
|
+
Via:
|
52
|
+
- 1.1 vegur
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"success":true}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Wed, 04 Oct 2017 00:47:32 GMT
|
58
|
+
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/customers/close
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: phone_number=%2B13105551111
|
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
|
+
- '27'
|
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 22:27:55 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Cache-Control:
|
40
|
+
- no-cache
|
41
|
+
X-Request-Id:
|
42
|
+
- 75869326-e905-40a8-af30-162a4f2d9bab
|
43
|
+
X-Runtime:
|
44
|
+
- '0.007258'
|
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 22:27:56 GMT
|
56
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers/properties
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: phone_number=%2B13105551111&property_name=foo
|
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
|
+
- '45'
|
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 22:44:06 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Cache-Control:
|
40
|
+
- no-cache
|
41
|
+
X-Request-Id:
|
42
|
+
- 2272f9b3-73f4-446e-a024-d30faad078d0
|
43
|
+
X-Runtime:
|
44
|
+
- '0.006786'
|
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 22:44:06 GMT
|
56
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers/properties
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: email=one%40example.com&property_name=bar
|
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: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Server:
|
32
|
+
- Cowboy
|
33
|
+
Date:
|
34
|
+
- Wed, 04 Oct 2017 20:49:50 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Etag:
|
40
|
+
- W/"87f4c9043db3464360ae570c767fe87a"
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, private, must-revalidate
|
43
|
+
X-Request-Id:
|
44
|
+
- e103a7f3-bf89-48ab-8dd4-977490b0e284
|
45
|
+
X-Runtime:
|
46
|
+
- '0.067048'
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=31536000
|
49
|
+
Content-Length:
|
50
|
+
- '117'
|
51
|
+
Via:
|
52
|
+
- 1.1 vegur
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"property_name":"bar","property_value":"baz","email":"one@example.com","phone_number":"+13105551111","deleted":true}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Wed, 04 Oct 2017 20:49:51 GMT
|
58
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://sandbox.sendsonar.com/api/v1/customers/properties
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: phone_number=%2B13105551111&property_name=foo
|
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
|
+
- '45'
|
22
|
+
Content-Type:
|
23
|
+
- application/x-www-form-urlencoded
|
24
|
+
Host:
|
25
|
+
- sandbox.sendsonar.com
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Server:
|
32
|
+
- Cowboy
|
33
|
+
Date:
|
34
|
+
- Wed, 04 Oct 2017 20:49:50 GMT
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Content-Type:
|
38
|
+
- application/json
|
39
|
+
Etag:
|
40
|
+
- W/"6aa205a7ea8c48140a61e49abdca3752"
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, private, must-revalidate
|
43
|
+
X-Request-Id:
|
44
|
+
- 02438094-95c3-4655-92f7-2104acd97538
|
45
|
+
X-Runtime:
|
46
|
+
- '0.096846'
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=31536000
|
49
|
+
Content-Length:
|
50
|
+
- '116'
|
51
|
+
Via:
|
52
|
+
- 1.1 vegur
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"property_name":"foo","property_value":"42","email":"one@example.com","phone_number":"+13105551111","deleted":true}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Wed, 04 Oct 2017 20:49:50 GMT
|
58
|
+
recorded_with: VCR 3.0.3
|