active-campaign-simple 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/active-campaign-simple/api_error.rb +11 -0
- data/lib/active-campaign-simple/request.rb +2 -0
- data/lib/active-campaign-simple/version.rb +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e11e679f32384e64051c27b84b761840e99c412c67af13d5c7a48815097689
|
4
|
+
data.tar.gz: 954d8b69e0e49291aa229348bf644e81be3d937a64f7fa7fed16acbd8b0b944b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ee9eeeded8c7cfd774cfac05ef69b23464b94d7b7a1668534e98434a13dde533fb95d326904be87c1cc8c7270b3fbe03fd3f1047c1a17fbbc9bc28ed757d633
|
7
|
+
data.tar.gz: f33762ac2f49b09846f53dffeb7c703987e09c8c947b77fbd8e2d6178a52781298059bb7f8595be61b32dac25adb0dc1337daaf1f93e2a2d84818f76801b1515
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Simple Ruby REST wrapper for the Active Campaign API
|
|
3
3
|
|
4
4
|
|
5
5
|
## <a name="info">Info</a>
|
6
|
-
This is a very simple wrapper around the REST ActiveCampaign API. You will still need to provide the path and the payload for each request. Eventually I will grow this out to be more convenient. Right now this just provides some conveniences and an easy way to configure the API and not much more... hence the name active-campaign-simple :)
|
6
|
+
This is a very simple wrapper around the REST ActiveCampaign API. You will still need to provide the path and the payload for each request. Eventually I will grow this out to be more convenient, if needed. Right now, this just provides some conveniences and an easy way to configure the API and not much more... hence the name active-campaign-simple :)
|
7
7
|
|
8
8
|
Use the public API as a guide for paths (urls) and payload info: https://developers.activecampaign.com/
|
9
9
|
|
@@ -31,7 +31,7 @@ end
|
|
31
31
|
ActiveCampaign.get('/contacts')
|
32
32
|
|
33
33
|
# Get a contact
|
34
|
-
ActiveCampaign.get('/contacts' + id)
|
34
|
+
ActiveCampaign.get('/contacts/' + id)
|
35
35
|
|
36
36
|
# Create a new contact
|
37
37
|
# https://developers.activecampaign.com/reference#create-a-contact-new
|
@@ -67,10 +67,10 @@ payload = {
|
|
67
67
|
},
|
68
68
|
}
|
69
69
|
}
|
70
|
-
ActiveCampaign.post('/contacts' + id, payload: payload)
|
70
|
+
ActiveCampaign.post('/contacts/' + id, payload: payload)
|
71
71
|
|
72
72
|
# Delete a contact
|
73
|
-
ActiveCampaign.delete('/contacts' + id)
|
73
|
+
ActiveCampaign.delete('/contacts/' + id)
|
74
74
|
```
|
75
75
|
|
76
76
|
## <a name="contributing">Contributing</a>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rest-client'
|
2
|
+
require 'active-campaign-simple/api_error'
|
2
3
|
|
3
4
|
module ActiveCampaign
|
4
5
|
module Request
|
@@ -46,6 +47,7 @@ module ActiveCampaign
|
|
46
47
|
resp = RestClient::Request.execute(opts)
|
47
48
|
rescue RestClient::ExceptionWithResponse => err
|
48
49
|
# log error?
|
50
|
+
raise APIError, err
|
49
51
|
else
|
50
52
|
return JSON.parse(resp.body) if resp.body # Some calls respond w nothing
|
51
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-campaign-simple
|
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
|
- Nathan Leavitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- README.md
|
52
52
|
- active-campaign-simple.gemspec
|
53
53
|
- lib/active-campaign-simple.rb
|
54
|
+
- lib/active-campaign-simple/api_error.rb
|
54
55
|
- lib/active-campaign-simple/client.rb
|
55
56
|
- lib/active-campaign-simple/config.rb
|
56
57
|
- lib/active-campaign-simple/logger.rb
|
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
76
|
- !ruby/object:Gem::Version
|
76
77
|
version: 3.0.0
|
77
78
|
requirements: []
|
78
|
-
rubygems_version: 3.2.
|
79
|
+
rubygems_version: 3.2.22
|
79
80
|
signing_key:
|
80
81
|
specification_version: 4
|
81
82
|
summary: Simple Ruby REST wrapper for the ActiveCampaign API
|