sfmc-fuelsdk-ruby 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +28 -28
  3. data/Gemfile +3 -3
  4. data/Gemfile.lock +92 -90
  5. data/Guardfile +8 -8
  6. data/LICENSE.md +13 -13
  7. data/README.md +166 -143
  8. data/Rakefile +1 -1
  9. data/lib/marketingcloudsdk.rb +74 -74
  10. data/lib/marketingcloudsdk/client.rb +348 -296
  11. data/lib/marketingcloudsdk/http_request.rb +118 -118
  12. data/lib/marketingcloudsdk/objects.rb +757 -757
  13. data/lib/marketingcloudsdk/rest.rb +118 -118
  14. data/lib/marketingcloudsdk/soap.rb +296 -282
  15. data/lib/marketingcloudsdk/targeting.rb +99 -99
  16. data/lib/marketingcloudsdk/utils.rb +47 -47
  17. data/lib/marketingcloudsdk/version.rb +39 -39
  18. data/lib/new.rb +1240 -1240
  19. data/marketingcloudsdk.gemspec +30 -30
  20. data/samples/sample-AddSubscriberToList.rb +56 -56
  21. data/samples/sample-CreateAndStartDataExtensionImport.rb +29 -29
  22. data/samples/sample-CreateAndStartListImport.rb +27 -27
  23. data/samples/sample-CreateContentAreas.rb +48 -48
  24. data/samples/sample-CreateDataExtensions.rb +54 -54
  25. data/samples/sample-CreateProfileAttributes.rb +48 -48
  26. data/samples/sample-SendEmailToDataExtension.rb +23 -23
  27. data/samples/sample-SendEmailToList.rb +23 -23
  28. data/samples/sample-SendTriggeredSends.rb +30 -30
  29. data/samples/sample-bounceevent.rb +70 -70
  30. data/samples/sample-campaign.rb +211 -211
  31. data/samples/sample-clickevent.rb +71 -71
  32. data/samples/sample-contentarea.rb +122 -122
  33. data/samples/sample-dataextension.rb +209 -209
  34. data/samples/sample-directverb.rb +54 -54
  35. data/samples/sample-email.rb +122 -122
  36. data/samples/sample-email.senddefinition.rb +134 -134
  37. data/samples/sample-folder.rb +143 -143
  38. data/samples/sample-import.rb +103 -103
  39. data/samples/sample-list.rb +105 -105
  40. data/samples/sample-list.subscriber.rb +97 -97
  41. data/samples/sample-openevent.rb +70 -70
  42. data/samples/sample-profileattribute.rb +56 -56
  43. data/samples/sample-sentevent.rb +70 -70
  44. data/samples/sample-subscriber.rb +135 -135
  45. data/samples/sample-triggeredsend.rb +129 -129
  46. data/samples/sample-unsubevent.rb +72 -72
  47. data/samples/sample_helper.rb.template +10 -10
  48. data/spec/client_spec.rb +218 -218
  49. data/spec/default_values_fallback_spec.rb +30 -30
  50. data/spec/helper_funcs_spec.rb +11 -11
  51. data/spec/http_request_spec.rb +61 -61
  52. data/spec/objects_helper_spec.rb +32 -32
  53. data/spec/objects_spec.rb +484 -484
  54. data/spec/rest_spec.rb +48 -48
  55. data/spec/soap_spec.rb +140 -140
  56. data/spec/spec_helper.rb +14 -14
  57. data/spec/targeting_spec.rb +44 -44
  58. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3079faef2d297a9fb708fc9bb3bcc71f9bce3db371359a96ec621bb716e281c
4
- data.tar.gz: 957550337f783b15637f431fa0f3b07567c2f85ca2473213b06ca917f55f2ee6
3
+ metadata.gz: 3a05834436829d49ca8336cd49946a56bed5f003f709a512a1ecb9637cec3031
4
+ data.tar.gz: 8f00eed0dd3e176c72042cf404b0fb7e06b71820f69df8417581c51a90e68869
5
5
  SHA512:
6
- metadata.gz: c4ff5b9020c3d6b41b8caa7f69e49202fbb079b77d62a77226ce8bf96bf5f2a62f80347c2f2d4a1d7f549bf6de86bb52d0b65e2b67d434781dd8bb4f27704c45
7
- data.tar.gz: 4948aa1cb5041c2c4b80760a981ddede7d446af2208a50a2d5297d70c030207c49d374327f81c905a47742bd6f12dcee7f6f6f31453640acd34d88d18e962f7f
6
+ metadata.gz: a8ee8667e093661ebed4f9433f3de2010079117db931f917ddda8cefb5eef8e511a8857bd457731cb0cb217d46212a0f0b9b71cb41010ea6f3670aafadc50267
7
+ data.tar.gz: db4f4acc5d67666bef2a109460fdc018be30f438751968cb235d64663f73b5ec34cb1d8acc18cbd8574760ac3c5205dfe3105a819cade0030527609f51c38007
data/.gitignore CHANGED
@@ -1,28 +1,28 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- coverage
6
- InstalledFiles
7
- lib/bundler/man
8
- pkg
9
- rdoc
10
- spec/reports
11
- test/tmp
12
- test/version_tmp
13
- tmp
14
- samples/soap_cache_file.json
15
-
16
- # YARD artifacts
17
- .yardoc
18
- _yardoc
19
- doc/
20
- sample.rb
21
- ExactTargetWSDL.xml
22
- config.yaml
23
- /objsamples/config.yaml
24
- /objsamples/AllTest.bat
25
- samples/sample_helper.rb
26
- .DS_STORE
27
- gengem.bat
28
- .idea
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+ samples/soap_cache_file.json
15
+
16
+ # YARD artifacts
17
+ .yardoc
18
+ _yardoc
19
+ doc/
20
+ sample.rb
21
+ ExactTargetWSDL.xml
22
+ config.yaml
23
+ /objsamples/config.yaml
24
+ /objsamples/AllTest.bat
25
+ samples/sample_helper.rb
26
+ .DS_STORE
27
+ gengem.bat
28
+ .idea
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,90 +1,92 @@
1
- PATH
2
- remote: .
3
- specs:
4
- sfmc-fuelsdk-ruby (1.1.0)
5
- json (~> 1.8, >= 1.8.1)
6
- jwt (~> 1.0, >= 1.0.0)
7
- savon (= 2.2.0)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- akami (1.2.2)
13
- gyoku (>= 0.4.0)
14
- nokogiri
15
- builder (3.2.3)
16
- coderay (1.1.2)
17
- diff-lcs (1.3)
18
- ffi (1.9.25)
19
- ffi (1.9.25-x86-mingw32)
20
- formatador (0.2.5)
21
- guard (1.8.3)
22
- formatador (>= 0.2.4)
23
- listen (~> 1.3)
24
- lumberjack (>= 1.0.2)
25
- pry (>= 0.9.10)
26
- thor (>= 0.14.6)
27
- guard-rspec (2.6.0)
28
- guard (>= 1.8)
29
- rspec (~> 2.13)
30
- gyoku (1.0.0)
31
- builder (>= 2.1.2)
32
- httpi (2.0.2)
33
- rack
34
- json (1.8.6)
35
- jwt (1.5.6)
36
- listen (1.3.1)
37
- rb-fsevent (>= 0.9.3)
38
- rb-inotify (>= 0.9)
39
- rb-kqueue (>= 0.2)
40
- lumberjack (1.0.13)
41
- method_source (0.9.0)
42
- mini_portile2 (2.3.0)
43
- nokogiri (1.8.5)
44
- mini_portile2 (~> 2.3.0)
45
- nori (2.1.0)
46
- pry (0.11.3)
47
- coderay (~> 1.1.0)
48
- method_source (~> 0.9.0)
49
- rack (2.0.6)
50
- rake (0.9.6)
51
- rb-fsevent (0.10.3)
52
- rb-inotify (0.9.10)
53
- ffi (>= 0.5.0, < 2)
54
- rb-kqueue (0.2.5)
55
- ffi (>= 0.5.0)
56
- rspec (2.99.0)
57
- rspec-core (~> 2.99.0)
58
- rspec-expectations (~> 2.99.0)
59
- rspec-mocks (~> 2.99.0)
60
- rspec-core (2.99.2)
61
- rspec-expectations (2.99.2)
62
- diff-lcs (>= 1.1.3, < 2.0)
63
- rspec-mocks (2.99.4)
64
- savon (2.2.0)
65
- akami (~> 1.2.0)
66
- builder (>= 2.1.2)
67
- gyoku (~> 1.0.0)
68
- httpi (~> 2.0.2)
69
- nokogiri (>= 1.4.0)
70
- nori (~> 2.1.0)
71
- wasabi (~> 3.1.0)
72
- thor (0.20.0)
73
- wasabi (3.1.0)
74
- httpi (~> 2.0)
75
- nokogiri (>= 1.4.0)
76
-
77
- PLATFORMS
78
- ruby
79
- x86-mingw32
80
-
81
- DEPENDENCIES
82
- bundler (~> 1.3)
83
- guard (~> 1.1)
84
- guard-rspec (~> 2.0)
85
- rake (~> 0.9)
86
- rspec (~> 2.0)
87
- sfmc-fuelsdk-ruby!
88
-
89
- BUNDLED WITH
90
- 1.17.1
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sfmc-fuelsdk-ruby (1.2.0)
5
+ json (~> 1.8, >= 1.8.1)
6
+ jwt (~> 1.0, >= 1.0.0)
7
+ savon (= 2.2.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ akami (1.2.2)
13
+ gyoku (>= 0.4.0)
14
+ nokogiri
15
+ builder (3.2.3)
16
+ coderay (1.1.2)
17
+ diff-lcs (1.3)
18
+ ffi (1.9.25)
19
+ ffi (1.9.25-x64-mingw32)
20
+ ffi (1.9.25-x86-mingw32)
21
+ formatador (0.2.5)
22
+ guard (1.8.3)
23
+ formatador (>= 0.2.4)
24
+ listen (~> 1.3)
25
+ lumberjack (>= 1.0.2)
26
+ pry (>= 0.9.10)
27
+ thor (>= 0.14.6)
28
+ guard-rspec (2.6.0)
29
+ guard (>= 1.8)
30
+ rspec (~> 2.13)
31
+ gyoku (1.0.0)
32
+ builder (>= 2.1.2)
33
+ httpi (2.0.2)
34
+ rack
35
+ json (1.8.6)
36
+ jwt (1.5.6)
37
+ listen (1.3.1)
38
+ rb-fsevent (>= 0.9.3)
39
+ rb-inotify (>= 0.9)
40
+ rb-kqueue (>= 0.2)
41
+ lumberjack (1.0.13)
42
+ method_source (0.9.0)
43
+ mini_portile2 (2.4.0)
44
+ nokogiri (1.10.1-x64-mingw32)
45
+ mini_portile2 (~> 2.4.0)
46
+ nori (2.1.0)
47
+ pry (0.11.3)
48
+ coderay (~> 1.1.0)
49
+ method_source (~> 0.9.0)
50
+ rack (2.0.6)
51
+ rake (0.9.6)
52
+ rb-fsevent (0.10.3)
53
+ rb-inotify (0.9.10)
54
+ ffi (>= 0.5.0, < 2)
55
+ rb-kqueue (0.2.5)
56
+ ffi (>= 0.5.0)
57
+ rspec (2.99.0)
58
+ rspec-core (~> 2.99.0)
59
+ rspec-expectations (~> 2.99.0)
60
+ rspec-mocks (~> 2.99.0)
61
+ rspec-core (2.99.2)
62
+ rspec-expectations (2.99.2)
63
+ diff-lcs (>= 1.1.3, < 2.0)
64
+ rspec-mocks (2.99.4)
65
+ savon (2.2.0)
66
+ akami (~> 1.2.0)
67
+ builder (>= 2.1.2)
68
+ gyoku (~> 1.0.0)
69
+ httpi (~> 2.0.2)
70
+ nokogiri (>= 1.4.0)
71
+ nori (~> 2.1.0)
72
+ wasabi (~> 3.1.0)
73
+ thor (0.20.0)
74
+ wasabi (3.1.0)
75
+ httpi (~> 2.0)
76
+ nokogiri (>= 1.4.0)
77
+
78
+ PLATFORMS
79
+ ruby
80
+ x64-mingw32
81
+ x86-mingw32
82
+
83
+ DEPENDENCIES
84
+ bundler (~> 1.3)
85
+ guard (~> 1.1)
86
+ guard-rspec (~> 2.0)
87
+ rake (~> 0.9)
88
+ rspec (~> 2.0)
89
+ sfmc-fuelsdk-ruby!
90
+
91
+ BUNDLED WITH
92
+ 1.17.1
data/Guardfile CHANGED
@@ -1,8 +1,8 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
- guard 'rspec' do
4
- watch('spec/spec_helper.rb') { "spec" }
5
- watch(%r{^spec/.+_spec\.rb$})
6
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
- end
8
-
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+ guard 'rspec' do
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ end
8
+
data/LICENSE.md CHANGED
@@ -1,13 +1,13 @@
1
- Copyright (c) 2013 ExactTarget, Inc.
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
-
7
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
-
9
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
-
11
- 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
-
13
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright (c) 2013 ExactTarget, Inc.
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -1,143 +1,166 @@
1
- FuelSDK-Ruby / MarketingCloudSDK-Ruby
2
- =====================================
3
-
4
- ExactTarget Fuel SDK / SalesforceMarektingCloudSDK for Ruby
5
-
6
- ## Overview ##
7
- The Fuel SDK for Ruby provides easy access to ExactTarget's Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to ExactTarget functionality via common collection types such as array/hash.
8
-
9
- ## New Features in Version 1.1.0 ##
10
- - **Added support for your tenant's endpoints - [More Details](https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/your-subdomain-tenant-specific-endpoints.htm) **
11
- - **MarketingCloudSDK gem will be available as sfmc-fuelsdk-ruby on ruby gems.
12
-
13
- ## Migrationg to version to version 1.0 ##
14
- - **FuelSDK gem has been renamed to MarketingCloudSDK and will be availbale as marketingcloudsdk on ruby gems.
15
-
16
- ## New Features in Version .9 ##
17
- - **Streamlined Folder Support**: All objects that support folders within the UI now have a standardized property called folderId.
18
- - **Interaction Support**: Now supports Import and Email::SendDefinition objects .
19
- - **Profile Attribute Support**: Added the ability to manage profile attributes through the ProfileAttribute object.
20
- - **Support for single request to Add/Update**:A single request can be made which will create the object if one doesn't already or update one if it does. This works for Subscriber, DataExtension::Row, and List objects using the Put method.
21
- - **Tracking Events Batching Support**: By default, all tracking event types will only pull new data since the last time a request was made using the same filter. If you would like to override this functionality to pull all data, simply set the GetSinceLastBatch property to false.
22
- - **Automatic Asset Organization for Hub Apps**: Applications that authenticate by providing a JWT will automatically have all created assets placed into a folder based on the HubExchange app's name.
23
- - **Greater Flexibility for Authentication**:Yaml config file is no longer required in order to define the authentication parameters. They are now required inputs when instantiating the Client class so they can be stored anywhere.
24
-
25
- ## Migrating from old version ##
26
- - MarkeitngCloudSDK is now gem, Going forward FuelSDK gem will be available as marketingcloudsdk on ruby gems.
27
- - Config.yaml is no longer used. ClientID/ClientSecret will now need to be passed when instantiating the Client class.
28
- - Previous versions of the SalesforceMarketingCloudSDK exposed objects with the prefix "ET_". For backwards compatibility you can still access objects this way.
29
- Subscriber can be accessed using MarketingCloudSDK::Subscriber or ET_Subscriber.
30
-
31
- ## Requirements ##
32
- - Ruby Version 2.2.5
33
- - Savon 2.2.0
34
-
35
- ## Getting Started ##
36
- Build the gem from the source
37
-
38
- ```ruby
39
- gem build marketingcloudsdk.gemspec
40
- ```
41
-
42
- Install the newly built gem
43
-
44
- ```ruby
45
- gem install marketingcloudsdk-1.1.0.gem
46
- ```
47
-
48
- If you have not registered your application or you need to lookup your Application Key or Application Signature values, please go to App Center at [Code@: ExactTarget's Developer Community](http://code.exacttarget.com/appcenter "Code@ App Center").
49
-
50
-
51
- ## Example Request ##
52
-
53
- Add a require statement to reference the SalesforceMarketingCloud SDK's functionality:
54
- > require 'marketingcloudsdk'
55
-
56
- Next, create an instance of the Client class:
57
- > myClient = MarketingCloudSDK::Client.new {'client' => { 'id' => CLIENTID, 'secret' => SECRET }}
58
-
59
- Create an instance of the object type we want to work with:
60
- > list = MarketingCloudSDK::List.new
61
-
62
- Associate the Client to the object using the client property:
63
- > list.client = myClient
64
-
65
- Utilize one of the List methods:
66
- > response = list.get
67
-
68
- Print out the results for viewing
69
- > p response
70
-
71
- **Example Output:**
72
-
73
- <pre>
74
- <MarketingCloudSDK::SoapResponse:0x007fb86abcf190
75
- @body= {:retrieve_response_msg=> {:overall_status=>"OK", :request_id=>"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", :results=>..}
76
- @code= 200,
77
- @message= 'OK',
78
- @request_id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
79
- @results=
80
- [{:client=>{:id=>"xxxx"},
81
- :partner_key=>nil,
82
- :created_date=>
83
- #<DateTime: 2013-05-30T23:02:00+00:00 ((2456443j,82920s,0n),+0s,2299161j)>,
84
- :id=>"xxxx",
85
- :object_id=>nil,
86
- :email_address=>"xxxx",
87
- :attributes=>
88
- [{:name=>"Full Name", :value=>"Justin Barber"},
89
- {:name=>"Gender", :value=>nil},
90
- {:name=>"Email Address", :value=>"xxx"},
91
- {:name=>"User Defined", :value=>"02/02/1982"}],
92
- :subscriber_key=>"xxxx",
93
- :status=>"Active",
94
- :email_type_preference=>"HTML",
95
- :"@xsi:type"=>"Subscriber"},
96
- @success=true>
97
- </pre>
98
-
99
- ## Client Class ##
100
-
101
- The Client class takes care of many of the required steps when accessing ExactTarget's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new Client object for each request made.
102
-
103
- Client class accepts multiple parameters
104
-
105
- **Parameters** - Allows for passing authentication information for use with SSO with a JWT or for passing ClientID/ClientSecret.
106
- Additionally the API hostname (base_api_url),Authentication URL (request_token_url) and the SOAP endpoint (soap_endpoint) is now configurable:
107
-
108
- Example passing ClientID/ClientSecret:
109
- > myclient = MarketingCloudSDK::Client.new({'client' => {'id' => 'exampleID','secret' => 'exampleSecret'}})
110
-
111
- Example passing ClientID/ClientSecret/AppSignature/JWT:
112
- > myclient = MarketingCloudSDK::Client.new({'client' => {'id' => 'exampleID','secret' => 'exampleSecret', 'signature'=>'examplesig'}, 'jwt'=>'exampleJWT'})
113
-
114
- Example passing ClientID/ClientSecret/BaseAPIUrl/ReqTokenAuthUrl/Soap Endpoint
115
- > myclient = MarketingCloudSDK::Client.new('client' => {'id' => 'exampleID', 'secret' => 'exampleSecret', 'base_api_url' => 'http://getapis', 'request_token_url' => 'http://authapi', 'soap_endpoint' => 'http://soapendpoint'})
116
-
117
- **Note** - The following defaults apply if the following parameters are omitted:
118
- - base_api_url: https://www.exacttargetapis.com
119
- - request_token_url: https://auth.exacttargetapis.com/v1/requestToken
120
- - soap_endpoint: https://webservice.exacttarget.com/Service.asmx
121
-
122
- **Debug** - If 2nd parameter for debug is set to true, all API requests that the Fuel SDK is making behind the scenes will be logged. This option should only be set to true in order to troubleshoot during the development process and should never be used in a production scenario.
123
- > myclient = MarketingCloudSDK::Client.new auth, true <br>
124
-
125
-
126
- ## Responses ##
127
- All methods on MarketingCloud SDK objects return a generic object that follows the same structure, regardless of the type of call. This object contains a common set of properties used to display details about the request.
128
-
129
- - success?: Boolean value that indicates if the call was successful
130
- - code: HTTP Error Code (will always be 200 for SOAP requests)
131
- - message: Text values containing more details in the event of an error
132
- - results: Collection containing the details unique to the method called.
133
- - more? - Boolean value that indicates on Get requests if more data is available.
134
-
135
-
136
- ## Samples ##
137
- Find more sample files that illustrate using all of the available functions for ExactTarget objects exposed through the API in the samples directory.
138
-
139
-
140
-
141
-
142
-
143
-
1
+ FuelSDK-Ruby / MarketingCloudSDK-Ruby
2
+ =====================================
3
+
4
+ ExactTarget Fuel SDK / SalesforceMarektingCloudSDK for Ruby
5
+
6
+ ## Overview ##
7
+ The Fuel SDK for Ruby provides easy access to ExactTarget's Fuel API Family services, including a collection of REST APIs and a SOAP API. These APIs provide access to ExactTarget functionality via common collection types such as array/hash.
8
+
9
+
10
+ ## New Features in Version 1.2.0 ##
11
+ - **OAuth2 authentication support** - [More Details](https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/integration-considerations.htm)
12
+
13
+ To enable OAuth2 authentication, pass ```use_oAuth2_authentication => true``` in the params argument to the Client's class constructor.
14
+
15
+ Example of instantiating the Client class:
16
+
17
+ ```
18
+ myclient = MarketingCloudSDK::Client.new({
19
+ 'client' => {
20
+ 'id' => '<CLIENT_ID>',
21
+ 'secret' => '<CLIENT_SECRET>',
22
+ 'request_token_url' => '<AUTH TENANT SPECIFIC ENDPOINT>',
23
+ 'soap_endpoint' => '<SOAP TENANT SPECIFIC ENDPOINT>',
24
+ 'base_api_url' => '<REST TENANT SPECIFIC ENDPOINT>',
25
+ 'use_oAuth2_authentication' => true,
26
+ 'account_id' => <TARGET_ACCOUNT_ID>,
27
+ 'scope' => '<PERMISSION_LIST>'
28
+ }
29
+ })
30
+ ```
31
+
32
+ ## New Features in Version 1.1.0 ##
33
+ - **Added support for your tenant's endpoints - [More Details](https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/your-subdomain-tenant-specific-endpoints.htm) **
34
+ - **MarketingCloudSDK gem will be available as sfmc-fuelsdk-ruby on ruby gems.
35
+
36
+ ## Migrationg to version to version 1.0 ##
37
+ - **FuelSDK gem has been renamed to MarketingCloudSDK and will be availbale as marketingcloudsdk on ruby gems.
38
+
39
+ ## New Features in Version .9 ##
40
+ - **Streamlined Folder Support**: All objects that support folders within the UI now have a standardized property called folderId.
41
+ - **Interaction Support**: Now supports Import and Email::SendDefinition objects .
42
+ - **Profile Attribute Support**: Added the ability to manage profile attributes through the ProfileAttribute object.
43
+ - **Support for single request to Add/Update**:A single request can be made which will create the object if one doesn't already or update one if it does. This works for Subscriber, DataExtension::Row, and List objects using the Put method.
44
+ - **Tracking Events Batching Support**: By default, all tracking event types will only pull new data since the last time a request was made using the same filter. If you would like to override this functionality to pull all data, simply set the GetSinceLastBatch property to false.
45
+ - **Automatic Asset Organization for Hub Apps**: Applications that authenticate by providing a JWT will automatically have all created assets placed into a folder based on the HubExchange app's name.
46
+ - **Greater Flexibility for Authentication**:Yaml config file is no longer required in order to define the authentication parameters. They are now required inputs when instantiating the Client class so they can be stored anywhere.
47
+
48
+ ## Migrating from old version ##
49
+ - MarkeitngCloudSDK is now gem, Going forward FuelSDK gem will be available as marketingcloudsdk on ruby gems.
50
+ - Config.yaml is no longer used. ClientID/ClientSecret will now need to be passed when instantiating the Client class.
51
+ - Previous versions of the SalesforceMarketingCloudSDK exposed objects with the prefix "ET_". For backwards compatibility you can still access objects this way.
52
+ Subscriber can be accessed using MarketingCloudSDK::Subscriber or ET_Subscriber.
53
+
54
+ ## Requirements ##
55
+ - Ruby Version 2.2.5
56
+ - Savon 2.2.0
57
+
58
+ ## Getting Started ##
59
+ Build the gem from the source
60
+
61
+ ```ruby
62
+ gem build marketingcloudsdk.gemspec
63
+ ```
64
+
65
+ Install the newly built gem
66
+
67
+ ```ruby
68
+ gem install marketingcloudsdk-1.2.0.gem
69
+ ```
70
+
71
+ If you have not registered your application or you need to lookup your Application Key or Application Signature values, please go to App Center at [Code@: ExactTarget's Developer Community](http://code.exacttarget.com/appcenter "Code@ App Center").
72
+
73
+
74
+ ## Example Request ##
75
+
76
+ Add a require statement to reference the SalesforceMarketingCloud SDK's functionality:
77
+ > require 'marketingcloudsdk'
78
+
79
+ Next, create an instance of the Client class:
80
+ > myClient = MarketingCloudSDK::Client.new {'client' => { 'id' => CLIENTID, 'secret' => SECRET }}
81
+
82
+ Create an instance of the object type we want to work with:
83
+ > list = MarketingCloudSDK::List.new
84
+
85
+ Associate the Client to the object using the client property:
86
+ > list.client = myClient
87
+
88
+ Utilize one of the List methods:
89
+ > response = list.get
90
+
91
+ Print out the results for viewing
92
+ > p response
93
+
94
+ **Example Output:**
95
+
96
+ <pre>
97
+ <MarketingCloudSDK::SoapResponse:0x007fb86abcf190
98
+ @body= {:retrieve_response_msg=> {:overall_status=>"OK", :request_id=>"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", :results=>..}
99
+ @code= 200,
100
+ @message= 'OK',
101
+ @request_id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
102
+ @results=
103
+ [{:client=>{:id=>"xxxx"},
104
+ :partner_key=>nil,
105
+ :created_date=>
106
+ #<DateTime: 2013-05-30T23:02:00+00:00 ((2456443j,82920s,0n),+0s,2299161j)>,
107
+ :id=>"xxxx",
108
+ :object_id=>nil,
109
+ :email_address=>"xxxx",
110
+ :attributes=>
111
+ [{:name=>"Full Name", :value=>"Justin Barber"},
112
+ {:name=>"Gender", :value=>nil},
113
+ {:name=>"Email Address", :value=>"xxx"},
114
+ {:name=>"User Defined", :value=>"02/02/1982"}],
115
+ :subscriber_key=>"xxxx",
116
+ :status=>"Active",
117
+ :email_type_preference=>"HTML",
118
+ :"@xsi:type"=>"Subscriber"},
119
+ @success=true>
120
+ </pre>
121
+
122
+ ## Client Class ##
123
+
124
+ The Client class takes care of many of the required steps when accessing ExactTarget's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new Client object for each request made.
125
+
126
+ Client class accepts multiple parameters
127
+
128
+ **Parameters** - Allows for passing authentication information for use with SSO with a JWT or for passing ClientID/ClientSecret.
129
+ Additionally the API hostname (base_api_url),Authentication URL (request_token_url) and the SOAP endpoint (soap_endpoint) is now configurable:
130
+
131
+ Example passing ClientID/ClientSecret:
132
+ > myclient = MarketingCloudSDK::Client.new({'client' => {'id' => 'exampleID','secret' => 'exampleSecret'}})
133
+
134
+ Example passing ClientID/ClientSecret/AppSignature/JWT:
135
+ > myclient = MarketingCloudSDK::Client.new({'client' => {'id' => 'exampleID','secret' => 'exampleSecret', 'signature'=>'examplesig'}, 'jwt'=>'exampleJWT'})
136
+
137
+ Example passing ClientID/ClientSecret/BaseAPIUrl/ReqTokenAuthUrl/Soap Endpoint
138
+ > myclient = MarketingCloudSDK::Client.new('client' => {'id' => 'exampleID', 'secret' => 'exampleSecret', 'base_api_url' => 'http://getapis', 'request_token_url' => 'http://authapi', 'soap_endpoint' => 'http://soapendpoint'})
139
+
140
+ **Note** - The following defaults apply if the following parameters are omitted:
141
+ - base_api_url: https://www.exacttargetapis.com
142
+ - request_token_url: https://auth.exacttargetapis.com/v1/requestToken
143
+ - soap_endpoint: https://webservice.exacttarget.com/Service.asmx
144
+
145
+ **Debug** - If 2nd parameter for debug is set to true, all API requests that the Fuel SDK is making behind the scenes will be logged. This option should only be set to true in order to troubleshoot during the development process and should never be used in a production scenario.
146
+ > myclient = MarketingCloudSDK::Client.new auth, true <br>
147
+
148
+
149
+ ## Responses ##
150
+ All methods on MarketingCloud SDK objects return a generic object that follows the same structure, regardless of the type of call. This object contains a common set of properties used to display details about the request.
151
+
152
+ - success?: Boolean value that indicates if the call was successful
153
+ - code: HTTP Error Code (will always be 200 for SOAP requests)
154
+ - message: Text values containing more details in the event of an error
155
+ - results: Collection containing the details unique to the method called.
156
+ - more? - Boolean value that indicates on Get requests if more data is available.
157
+
158
+
159
+ ## Samples ##
160
+ Find more sample files that illustrate using all of the available functions for ExactTarget objects exposed through the API in the samples directory.
161
+
162
+
163
+
164
+
165
+
166
+