eloquant 1.0.0 → 2.0.0
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 +1 -1
- data/README.md +145 -10
- data/lib/eloquant/concerns/activities.rb +1 -6
- data/lib/eloquant/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: 9be01050edfaa7699d98c2bd6badb3a3e552aa36
|
4
|
+
data.tar.gz: d16c760546f02c76dd96c5d61f9567ef98327f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afbaa37d04ca159876e2f3926f7ddb5733d893d231656191eea22d0470811ba0ed022b738be6b367ecbf2b35dc76e99e5cbb3580ad7883048762ba2ab475b65f
|
7
|
+
data.tar.gz: 8e29967797a07893f6f360b8a7caa44c9c96181544b32911b6b47ae09f62c2277b1dbe3d7a44c7ab023afd89cd09641b82b9e187ac0e2eedc56f19ac4a5a6f0b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -35,12 +35,16 @@ ELOQUA_PASSWORD='password'
|
|
35
35
|
|
36
36
|
---------
|
37
37
|
|
38
|
-
|
38
|
+
## Available Endpoints
|
39
|
+
|
40
|
+
### [Application API](https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/RESTAPI/REST-API.htm) (Rest API)
|
39
41
|
|
40
42
|
#### Accounts
|
41
43
|
|
42
44
|
- `describe_accounts` - Return the list of fields for an Account
|
43
45
|
- `describe_accounts_csv` - Return the list of fields for an Account as a CSV formatted string
|
46
|
+
- `number_of_accounts` - Return the number of Accounts in the Eloqua database
|
47
|
+
- `get_account(eloqua_external_id)` - Query for a single Account given an Account's External ID (`CompanyIDExt`)
|
44
48
|
|
45
49
|
#### Activities
|
46
50
|
|
@@ -56,28 +60,159 @@ ELOQUA_PASSWORD='password'
|
|
56
60
|
|
57
61
|
- `describe_campaigns` - Return the list of fields for a Campaign
|
58
62
|
- `describe_campaigns_csv` - Return the list of fields for a Campaign as a CSV formatted string
|
63
|
+
- `number_of_campaigns` - Return the number of Campaigns in the Eloqua database
|
64
|
+
- `get_campaigns(page:, depth:, count:)` - Return Campaigns given the parameters
|
59
65
|
|
60
66
|
#### Contacts
|
61
67
|
|
62
68
|
- `describe_contacts` - Return the list of fields for a Contact
|
63
69
|
- `describe_contacts_csv` - Return the list of fields for a Contact as a CSV formatted string
|
70
|
+
- `number_of_contacts` - Return the number of Contacts in the Eloqua database
|
71
|
+
- `get_contact(eloqua_external_id)` - Query for a single Contact given a Contact's External ID (`ContactIDExt`)
|
72
|
+
|
73
|
+
#### Opportunities
|
64
74
|
|
65
|
-
|
75
|
+
- `describe_opportunities` - Return the list of fields for an Opportunity
|
76
|
+
- `describe_opportunities_csv` - Return the list of fields for an Opportunity as a CSV formatted string
|
66
77
|
|
67
|
-
|
78
|
+
### [Bulk API](https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/BulkAPI/bulk-API.htm)
|
68
79
|
|
69
|
-
|
80
|
+
The Bulk API works a little differently than the REST API. [This post](https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/BulkAPI/Tutorials/Export.htm)
|
81
|
+
does a fantastic job of explaining it.
|
70
82
|
|
71
|
-
|
83
|
+
First, it works by creating an "export" in Eloqua given a set of parameters.
|
84
|
+
The parameters are as follows:
|
72
85
|
|
73
|
-
|
86
|
+
- `name` (required) - The name of your export
|
87
|
+
- `fields` (required) - A hash containing the field mappings from a custom name to an Eloqua attribute
|
88
|
+
- Ex:
|
89
|
+
```ruby
|
90
|
+
fields = {
|
91
|
+
# Custom Name => "Name in Eloqua"
|
92
|
+
:contact_id => "{{Contact.Id}}",
|
93
|
+
:contact_first_name => "{{Contact.FirstName}}",
|
94
|
+
:contact_last_name => "{{Contact.LastName}}",
|
95
|
+
:contact_created_at => "{{Contact.CreatedAt}}",
|
96
|
+
}
|
97
|
+
```
|
98
|
+
- `filter` (optional for most, required for Activities) - The [filters](https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/BulkAPI/Tutorials/Filtering.htm?cshid=BulkFiltering) are used to narrow down your result
|
99
|
+
- Ex: Activities require a filter based on the Activity Type.
|
100
|
+
```ruby
|
101
|
+
# All Web Visit Activities
|
102
|
+
filter = "'{{Activity.Type}}' = 'WebVisit'"
|
103
|
+
# All Email Send Activities after Jan 1, 2018
|
104
|
+
filter = "'{{Activity.Type}}' = 'EmailSend' AND '{{Activity.CreatedAt}}' >= '2018-01-01'"
|
105
|
+
```
|
74
106
|
|
75
|
-
|
107
|
+
Each of the Bulk API endpoints take these three named parameters.
|
76
108
|
|
77
|
-
|
109
|
+
After creating a bulk export, the URI of the sync from Eloqua is returned. You
|
110
|
+
can use this URI to query for the data.
|
78
111
|
|
79
|
-
|
80
|
-
|
112
|
+
```ruby
|
113
|
+
# Example 1: Get all of the Form Submit activities in a given time frame
|
114
|
+
client.create_bulk_activity_export(
|
115
|
+
name: "Eloquant Bulk Activity Export Example",
|
116
|
+
filter: "'{{Activity.Type}}' = 'FormSubmit'",
|
117
|
+
fields: {
|
118
|
+
id: "{{Activity.Id}}",
|
119
|
+
activity_date: "{{Activity.CreatedAt}}",
|
120
|
+
contact_id: "{{Activity.Contact.Id}}",
|
121
|
+
},
|
122
|
+
)
|
123
|
+
#=> "/syncs/2010234"
|
124
|
+
sync_uri = "/syncs/2010234"
|
125
|
+
|
126
|
+
client.get_export_data(sync_uri)
|
127
|
+
#=> {
|
128
|
+
# :totalResults => 49997,
|
129
|
+
# :limit => 1000,
|
130
|
+
# :offset => 0,
|
131
|
+
# :count => 1000,
|
132
|
+
# :hasMore => true,
|
133
|
+
# :items => [
|
134
|
+
# {
|
135
|
+
# :id => "1",
|
136
|
+
# :activity_date => "2018-11-02 13:25:26.203",
|
137
|
+
# :contact_id => "438294"
|
138
|
+
# },
|
139
|
+
# {
|
140
|
+
# :id => "2",
|
141
|
+
# :activity_date => "2018-11-02 13:25:26.203",
|
142
|
+
# :contact_id => "982340"
|
143
|
+
# },
|
144
|
+
# ...
|
145
|
+
# ]
|
146
|
+
# }
|
147
|
+
|
148
|
+
# To get the next 1,000 results
|
149
|
+
client.get_export_data(sync_uri, offset: 1000)
|
150
|
+
#=> {
|
151
|
+
# :totalResults => 49997,
|
152
|
+
# :limit => 1000,
|
153
|
+
# :offset => 1000,
|
154
|
+
# :count => 1000,
|
155
|
+
# :hasMore => true,
|
156
|
+
# :items => [
|
157
|
+
# {
|
158
|
+
# :id => "1001",
|
159
|
+
# :activity_date => "2018-11-02 1:22:34.213",
|
160
|
+
# :contact_id => "138573"
|
161
|
+
# },
|
162
|
+
# {
|
163
|
+
# :id => "1002",
|
164
|
+
# :activity_date => "2018-11-02 15.24.12.323",
|
165
|
+
# :contact_id => "943209"
|
166
|
+
# },
|
167
|
+
# ...
|
168
|
+
# ]
|
169
|
+
# }
|
170
|
+
|
171
|
+
# To get the last of the results. Note the `count` and `hasMore` keys in response
|
172
|
+
client.get_export_data(sync_uri, offset: 49000)
|
173
|
+
#=> {
|
174
|
+
# :totalResults => 49997,
|
175
|
+
# :limit => 1000,
|
176
|
+
# :offset => 49000,
|
177
|
+
# :count => 997,
|
178
|
+
# :hasMore => false,
|
179
|
+
# :items => [
|
180
|
+
# ...
|
181
|
+
# {
|
182
|
+
# :id => "49996",
|
183
|
+
# :activity_date => "2018-11-02 13:25:26.203",
|
184
|
+
# :contact_id => "123456"
|
185
|
+
# },
|
186
|
+
# {
|
187
|
+
# :id => "49997",
|
188
|
+
# :activity_date => "2018-11-02 13:25:26.203",
|
189
|
+
# :contact_id => "098439"
|
190
|
+
# }
|
191
|
+
# ]
|
192
|
+
# }
|
193
|
+
```
|
194
|
+
- `totalResults` shows how many items in the database matched your query
|
195
|
+
- `limit` shows the number of items this response is limited to return
|
196
|
+
- `offset` shows the offset in which items in the query are paged through
|
197
|
+
- An offset of 0 would return results 1 - 1,000. An offset of 1,000 would
|
198
|
+
return results 1,001 - 2000
|
199
|
+
- `count` shows the number of items returned in this response
|
200
|
+
- `hasMore` is a boolean denoting if there are more results to page through
|
201
|
+
|
202
|
+
#### Accounts
|
203
|
+
|
204
|
+
- `create_bulk_account_export(params)` - Create a bulk Account export with the input parameters defined above
|
205
|
+
- `list_account_exports` - List the created Account exports from Eloqua
|
206
|
+
|
207
|
+
#### Activities
|
208
|
+
|
209
|
+
- `create_bulk_activity_export(params)` - Create a bulk Activity export with the input parameters defined above
|
210
|
+
- `list_activity_exports` - List the created Activity exports from Eloqua
|
211
|
+
|
212
|
+
#### Contacts
|
213
|
+
|
214
|
+
- `create_bulk_contact_export(params)` - Create a bulk Contact export with the input parameters defined above
|
215
|
+
- `list_contact_exports` - List the created Contact exports from Eloqua
|
81
216
|
|
82
217
|
-----------
|
83
218
|
|
@@ -9,12 +9,7 @@ module Eloquant
|
|
9
9
|
end
|
10
10
|
|
11
11
|
# Filter is the name of the activity type
|
12
|
-
def create_bulk_activity_export(
|
13
|
-
params = {
|
14
|
-
fields: fields,
|
15
|
-
filter: filter,
|
16
|
-
}
|
17
|
-
|
12
|
+
def create_bulk_activity_export(params = {})
|
18
13
|
create_bulk_export(activities, params)
|
19
14
|
end
|
20
15
|
|
data/lib/eloquant/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eloquant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Stumbaugh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday_middleware
|