active-campaign-rails 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -7
- data/lib/active-campaign-rails.rb +4 -1
- data/lib/active-campaign-rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e5e7a01a49e887744994ec3b462221930689e7
|
4
|
+
data.tar.gz: 69f93abd48b2faa52f3fb6f65d17bbee133c1830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d3620beb5e7631f47ceccbc099af3cbf37448be2b64dfca6dd11ffd0fdc156961e867959777ba900094f5014f3b97c873b877d32d60e6a03d588350d85b3c07
|
7
|
+
data.tar.gz: 0945349e98e61dd532020df98ec59ce699d575cc2cfacebfe645ef952cc49667d79f53c0fb848fcdeddecd4fa33ba8f5ada86404b148491393ea74693cb9eb78
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ActiveCampaignRails
|
2
2
|
|
3
|
-
Simple
|
3
|
+
Simple gem for ActiveCampaign API wrapper
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
Read their [API documentation](http://www.activecampaign.com/api/overview.php)for how to use this gem.
|
23
|
+
Read their [API documentation](http://www.activecampaign.com/api/overview.php) for how to use this gem.
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
# To setup the active_campaign
|
@@ -28,21 +28,29 @@ active_campaign = ActiveCampaign.new(
|
|
28
28
|
api_endpoint: 'YOUR-ENDPOINT', # e.g. 'https://yourendpoint.api-us1.com'
|
29
29
|
api_key: 'YOUR-API-KEY') # e.g. 'a4e60a1ba200595d5cc37ede5732545184165e'
|
30
30
|
|
31
|
-
# After connected, you can call
|
31
|
+
# After connected, you can call ActiveCampaign API like this:
|
32
32
|
|
33
|
-
# To fetch your
|
33
|
+
# To fetch your ActiveCampaign account data
|
34
34
|
active_campaign.account_view
|
35
35
|
|
36
36
|
# To fetch all lists
|
37
37
|
active_campaign.list_list ids: 'all'
|
38
38
|
|
39
|
-
#
|
40
|
-
|
39
|
+
# To add new contact
|
40
|
+
active_campaign.contact_add(
|
41
|
+
email: 'john_doe@example.com',
|
42
|
+
first_name: 'John',
|
43
|
+
last_name: 'Doe',
|
44
|
+
phone: '+6287712314132')
|
45
|
+
|
46
|
+
|
41
47
|
```
|
42
48
|
|
49
|
+
To view all available API please visit http://www.activecampaign.com/api/overview.php
|
50
|
+
|
43
51
|
## Response
|
44
52
|
|
45
|
-
Here's an example JSON response for `active_campaign.list_list ids: 'all'`
|
53
|
+
Here's an example JSON response for `active_campaign.list_list ids: 'all'`
|
46
54
|
|
47
55
|
```ruby
|
48
56
|
{
|
@@ -29,14 +29,17 @@ class ActiveCampaign
|
|
29
29
|
url_params = (args.present?) ? args.first.map{|k,v| "#{k}=#{v}"}.join('su&') : nil
|
30
30
|
api_url = (url_params.present?) ? "#{api_url}&#{url_params}" : api_url
|
31
31
|
response = Net::HTTP.get(URI.parse("#{api_url}"))
|
32
|
+
|
33
|
+
return response
|
32
34
|
|
33
35
|
when 'post'
|
34
36
|
|
35
37
|
response = Net::HTTP.post_form(URI.parse("#{api_url}"), args.first)
|
36
38
|
|
39
|
+
return response.body
|
40
|
+
|
37
41
|
end
|
38
42
|
|
39
|
-
return response
|
40
43
|
|
41
44
|
end
|
42
45
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-campaign-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eky Fauzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|