responsys-api 0.0.9 → 0.1.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 +8 -8
- data/lib/responsys/api/campaign.rb +11 -0
- data/lib/responsys/api/object/all.rb +1 -0
- data/lib/responsys/api/object/custom_event.rb +29 -0
- data/lib/responsys/i18n/en.yml +4 -1
- data/lib/responsys/member.rb +3 -3
- data/responsys-api.gemspec +1 -1
- data/spec/api/campaign_spec.rb +61 -8
- data/spec/api/object/custom_event_spec.rb +16 -0
- data/spec/api/object/recipient_spec.rb +9 -9
- data/spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_1.yml +48 -0
- data/spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_2.yml +49 -0
- data/spec/fixtures/vcr_cassettes/api/campaign/trigger_message_1.yml +48 -0
- data/spec/fixtures/vcr_cassettes/api/campaign/trigger_message_2.yml +49 -0
- data/spec/test_data.yml +11 -3
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTlmMTI3NDdjZmE5MjYwYTllNzRiMTU3OTE1ZDc4OGQ2N2EwZTNhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjU1YjUxYWUxMWE0Yzg0NTk0YWRmYTAyNDYxMjI3YmQ1YzNiMzYyNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjAwMmE5OWU3YzRhMjliZjNhZmQ2ODNkNGE3ZWEzOWY4NjAxYmJmMWU5YjE0
|
10
|
+
ZDk1M2MwOTlmZjQyYWRmYTM5ODVkZDQwMzA1MjNmMTkyYWQ2NzJmZTc2NWFl
|
11
|
+
NjdiNTlmMDNlMDMzY2M1YmVlNzYwNTJlZDNjNTEyZjg3NWE0OGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTJlNjI3MDZkOWNhMWI2MDNjNTk3ZDAxMGQ3MWM1ZTdiODM5NGU3ODRjNGI3
|
14
|
+
NmY5MGIxNjE2ZWZkMTc0MDZiOTQ5MzdhZTgzNDMyZWRjMGJhNGM0ZTNkN2Mx
|
15
|
+
YmM2NjY1NTlhOWRhM2Y0NWY5MjkwYTgzZjBjODU1ZWRjNzdlZjU=
|
@@ -5,6 +5,17 @@ module Responsys
|
|
5
5
|
module Campaign
|
6
6
|
include Responsys::Exceptions
|
7
7
|
|
8
|
+
def trigger_custom_event(custom_event, recipients)
|
9
|
+
raise ParameterException, Responsys::Helper.get_message("api.campaign.incorrect_recipients_type") unless recipients.is_a? Array
|
10
|
+
raise ParameterException, Responsys::Helper.get_message("api.object.custom_event.incorrect_event_object") unless custom_event.is_a? Responsys::Api::Object::CustomEvent
|
11
|
+
|
12
|
+
message = {
|
13
|
+
customEvent: custom_event.to_api,
|
14
|
+
recipientData: recipients.map(&:to_api)
|
15
|
+
}
|
16
|
+
api_method(:trigger_custom_event, message)
|
17
|
+
end
|
18
|
+
|
8
19
|
def trigger_message(campaign, recipients)
|
9
20
|
raise ParameterException, Responsys::Helper.get_message("api.campaign.incorrect_recipients_type") unless recipients.is_a? Array
|
10
21
|
message = {
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Responsys
|
2
|
+
module Api
|
3
|
+
module Object
|
4
|
+
class CustomEvent
|
5
|
+
include Responsys::Exceptions
|
6
|
+
attr_accessor :event_name, :event_id, :event_string_data_mapping, :event_number_data_mapping, :event_date_data_mapping
|
7
|
+
|
8
|
+
def initialize(event_name="", event_id="", options={})
|
9
|
+
raise ParameterException, Responsys::Helper.get_message("api.object.custom_event.empty_event") if event_name.blank? && event_id.blank?
|
10
|
+
@event_name = event_name || ""
|
11
|
+
@event_id = event_id || ""
|
12
|
+
@event_string_data_mapping = options[:event_string_data_mapping] || ""
|
13
|
+
@event_number_data_mapping = options[:event_number_data_mapping] || ""
|
14
|
+
@event_date_data_mapping = options[:event_date_data_mapping] || ""
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_api
|
18
|
+
{
|
19
|
+
eventName: event_name,
|
20
|
+
eventId: event_id,
|
21
|
+
eventStringDataMapping: event_string_data_mapping,
|
22
|
+
eventDateDataMapping: event_date_data_mapping,
|
23
|
+
eventNumberDataMapping: event_number_data_mapping
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/responsys/i18n/en.yml
CHANGED
@@ -14,6 +14,9 @@ en:
|
|
14
14
|
incorrect_email_format: The email format is not supported
|
15
15
|
record:
|
16
16
|
incorrect_field_values_type: The field_values must be an array
|
17
|
+
custom_event:
|
18
|
+
empty_event: The event_name or event_id must be specified
|
19
|
+
incorrect_event_object: "custom_event must be a CustomEvent instance"
|
17
20
|
client:
|
18
21
|
api_method:
|
19
22
|
wrong_action_login: Please use the dedicated login method
|
@@ -22,4 +25,4 @@ en:
|
|
22
25
|
incorrect_recipients_type: Recipients parameter must be an array
|
23
26
|
member:
|
24
27
|
riid_missing: Variable riid is not provided to the member
|
25
|
-
record_not_found: The member has not been found in the list
|
28
|
+
record_not_found: The member has not been found in the list
|
data/lib/responsys/member.rb
CHANGED
@@ -5,12 +5,12 @@ module Responsys
|
|
5
5
|
class Member
|
6
6
|
include Responsys::Api
|
7
7
|
include Responsys::Api::Object
|
8
|
-
attr_accessor :email, :user_riid
|
8
|
+
attr_accessor :email, :user_riid, :client
|
9
9
|
|
10
|
-
def initialize(email, riid = nil)
|
10
|
+
def initialize(email, riid = nil, client = Client.instance)
|
11
11
|
@email = email
|
12
12
|
@user_riid = riid
|
13
|
-
@client =
|
13
|
+
@client = client
|
14
14
|
end
|
15
15
|
|
16
16
|
def add_to_list(list, subscribe = false, details = {}, update_record = false)
|
data/responsys-api.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "responsys-api"
|
7
|
-
spec.version = "0.0
|
7
|
+
spec.version = "0.1.0"
|
8
8
|
spec.authors = ["Dan DeMeyere", "Florian Lorrain", "Morgan Griggs", "Mike Rocco"]
|
9
9
|
spec.email = ["dan@thredup.com", "florian.lorrain@thredup.com", "morgan@thredup.com", "michael.rocco@thredup.com"]
|
10
10
|
spec.description = "A gem to integrate with the Responsys SOAP API"
|
data/spec/api/campaign_spec.rb
CHANGED
@@ -1,23 +1,76 @@
|
|
1
1
|
require "spec_helper.rb"
|
2
2
|
require "responsys/api/client"
|
3
3
|
|
4
|
-
describe Responsys::Api::Campaign do
|
4
|
+
describe Responsys::Api::Campaign do
|
5
|
+
let(:list) { Responsys::Api::Object::InteractObject.new(DATA[:folder], DATA[:lists][:list1][:name]) }
|
6
|
+
let(:campaign) { Responsys::Api::Object::InteractObject.new(DATA[:folder], DATA[:campaigns][:campaign1][:name]) }
|
7
|
+
let(:recipient1) { Responsys::Api::Object::Recipient.new(emailAddress: DATA[:users][:user1][:EMAIL_ADDRESS], listName: list) }
|
8
|
+
let(:recipient2) { Responsys::Api::Object::Recipient.new(emailAddress: DATA[:users][:user2][:EMAIL_ADDRESS], listName: list) }
|
9
|
+
let(:recipientData1) { Responsys::Api::Object::RecipientData.new(recipient1) }
|
10
|
+
let(:recipientData2) { Responsys::Api::Object::RecipientData.new(recipient2) }
|
11
|
+
let(:custom_event) { Responsys::Api::Object::CustomEvent.new(DATA[:custom_events][:custom_event1][:name]) }
|
12
|
+
|
13
|
+
before(:all) do
|
14
|
+
@client = Responsys::Api::Client.instance
|
15
|
+
end
|
5
16
|
|
6
17
|
context "Trigger Message" do
|
7
|
-
|
8
|
-
|
18
|
+
it "should return a status of ok when triggering a message for one recipient" do
|
19
|
+
VCR.use_cassette("api/campaign/trigger_message_1") do
|
20
|
+
response = Responsys::Api::Client.instance.trigger_message(campaign, [recipientData1])
|
21
|
+
expect(response[:status]).to eq("ok")
|
22
|
+
end
|
9
23
|
end
|
10
24
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
25
|
+
it "should return a status of ok when triggering a message for more than one recipient" do
|
26
|
+
VCR.use_cassette("api/campaign/trigger_message_2") do
|
27
|
+
response = Responsys::Api::Client.instance.trigger_message(campaign, [recipientData1,recipientData2])
|
28
|
+
expect(response[:status]).to eq("ok")
|
29
|
+
end
|
15
30
|
end
|
16
31
|
|
17
32
|
it "should pass api_method a message Hash" do
|
18
33
|
expect(@client).to receive(:api_method).with(anything, be_a_kind_of(Hash))
|
19
|
-
@client.trigger_message(
|
34
|
+
@client.trigger_message(campaign, [recipientData1])
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should pass info to the trigger campaign message API call" do
|
38
|
+
expect(@client).to receive(:api_method).with(:trigger_campaign_message, anything)
|
39
|
+
@client.trigger_message(campaign, [recipientData1])
|
20
40
|
end
|
21
41
|
end
|
22
42
|
|
43
|
+
context "#trigger_custom_event" do
|
44
|
+
it "should return a status of ok when triggering a custom event for one recipient" do
|
45
|
+
VCR.use_cassette("api/campaign/trigger_custom_event_1") do
|
46
|
+
response = Responsys::Api::Client.instance.trigger_custom_event(custom_event, [recipientData1])
|
47
|
+
expect(response[:status]).to eq("ok")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should return a status of ok when triggering a custom event for more than one recipient" do
|
52
|
+
VCR.use_cassette("api/campaign/trigger_custom_event_2") do
|
53
|
+
response = Responsys::Api::Client.instance.trigger_custom_event(custom_event, [recipientData1,recipientData2])
|
54
|
+
expect(response[:status]).to eq("ok")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should pass api_method a message hash" do
|
59
|
+
expect(@client).to receive(:api_method).with(anything, be_a_kind_of(Hash))
|
60
|
+
@client.trigger_custom_event(custom_event, [recipientData1])
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should pass info to the trigger custom event API call" do
|
64
|
+
expect(@client).to receive(:api_method).with(:trigger_custom_event, anything)
|
65
|
+
@client.trigger_custom_event(custom_event, [recipientData1])
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should include a custom event in the message" do
|
69
|
+
expect { @client.trigger_custom_event(campaign, [recipientData1]) }.to raise_error(Responsys::Exceptions::ParameterException, "custom_event must be a CustomEvent instance")
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should only accept an array of recipients in the message" do
|
73
|
+
expect { @client.trigger_custom_event(custom_event, recipientData1) }.to raise_error(Responsys::Exceptions::ParameterException, "Recipients parameter must be an array")
|
74
|
+
end
|
75
|
+
end
|
23
76
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "spec_helper.rb"
|
2
|
+
|
3
|
+
describe Responsys::Api::Object::CustomEvent do
|
4
|
+
context "#intialize" do
|
5
|
+
it "should raise an exception if there is no event identifier present" do
|
6
|
+
expect{ Responsys::Api::Object::CustomEvent.new("") }.to raise_exception(Responsys::Exceptions::ParameterException, "The event_name or event_id must be specified")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
context "#to_api" do
|
11
|
+
it "should correctly transform the object to the api representation" do
|
12
|
+
object = Responsys::Api::Object::CustomEvent.new("event_name")
|
13
|
+
expect(object.to_api).to eq({ eventName: "event_name", eventId: "", eventStringDataMapping: "", eventDateDataMapping: "", eventNumberDataMapping: "" })
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper.rb"
|
2
2
|
require "responsys/api/client"
|
3
3
|
|
4
|
-
describe Responsys::Api::Object::Recipient do
|
4
|
+
describe Responsys::Api::Object::Recipient do
|
5
5
|
|
6
6
|
|
7
7
|
context "new recipient" do
|
@@ -15,19 +15,19 @@ describe Responsys::Api::Object::Recipient do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should have recipient_id attribute" do
|
18
|
-
expect(@recipient.recipient_id).to
|
18
|
+
expect(@recipient.recipient_id).to be_a(String)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should have customer_id attribute" do
|
22
|
-
expect(@recipient.customer_id).to
|
22
|
+
expect(@recipient.customer_id).to be_a(String)
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should have email_address attribute" do
|
26
|
-
expect(@recipient.email_address).to
|
26
|
+
expect(@recipient.email_address).to be_a(String)
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should have mobile_number attribute" do
|
30
|
-
expect(@recipient.mobile_number).to
|
30
|
+
expect(@recipient.mobile_number).to be_a(String)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should have email_format attribute of type EmailFormat" do
|
@@ -46,19 +46,19 @@ describe Responsys::Api::Object::Recipient do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should have recipientId attribute " do
|
49
|
-
expect(@recipient.to_api[:recipientId]).to
|
49
|
+
expect(@recipient.to_api[:recipientId]).to be_a(Integer)
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should have customerId attribute " do
|
53
|
-
expect(@recipient.to_api[:customerId]).to
|
53
|
+
expect(@recipient.to_api[:customerId]).to be_a(String)
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should have emailAddress attribute " do
|
57
|
-
expect(@recipient.to_api[:emailAddress]).to
|
57
|
+
expect(@recipient.to_api[:emailAddress]).to be_a(String)
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should have mobileNumber attribute " do
|
61
|
-
expect(@recipient.to_api[:mobileNumber]).to
|
61
|
+
expect(@recipient.to_api[:mobileNumber]).to be_a(String)
|
62
62
|
end
|
63
63
|
|
64
64
|
it "should have EmailFormat attribute of type String" do
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><sessionHeader><sessionId>zhCE1Tdc0UhcA8pcvIwterF7MK</sessionId></sessionHeader></env:Header><env:Body><tns:triggerCustomEvent><tns:customEvent><tns:eventName>rspec_event1</tns:eventName><tns:eventId></tns:eventId><tns:eventStringDataMapping></tns:eventStringDataMapping><tns:eventDateDataMapping></tns:eventDateDataMapping><tns:eventNumberDataMapping></tns:eventNumberDataMapping></tns:customEvent><tns:recipientData><tns:recipient><tns:listName><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_list1</tns:objectName></tns:listName><tns:recipientId>0</tns:recipientId><tns:customerId></tns:customerId><tns:emailAddress>user1@email.com</tns:emailAddress><tns:mobileNumber></tns:mobileNumber><tns:emailFormat>NO_FORMAT</tns:emailFormat></tns:recipient><tns:optionalData><tns:name></tns:name><tns:value></tns:value></tns:optionalData></tns:recipientData></tns:triggerCustomEvent></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Cookie:
|
13
|
+
- JSESSIONID=0C8539AD888A36D0E56CE1E8C148C822.ws03-ri5
|
14
|
+
Soapaction:
|
15
|
+
- '"triggerCustomEvent"'
|
16
|
+
Content-Type:
|
17
|
+
- text/xml;charset=UTF-8
|
18
|
+
Content-Length:
|
19
|
+
- '1165'
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- '*/*'
|
24
|
+
User-Agent:
|
25
|
+
- Ruby
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Content-Length:
|
32
|
+
- '400'
|
33
|
+
Content-Type:
|
34
|
+
- text/xml; charset=UTF-8
|
35
|
+
Date:
|
36
|
+
- Thu, 13 Nov 2014 23:26:12 GMT
|
37
|
+
Server:
|
38
|
+
- Apache
|
39
|
+
Set-Cookie:
|
40
|
+
- BIGipServerDC2-APIGEE-I5-9051-SSL=3600669706.23331.0000; path=/
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><triggerCustomEventResponse
|
44
|
+
xmlns="urn:ws.rsys.com"><result><recipientId>48614925</recipientId><success>true</success><errorMessage
|
45
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result></triggerCustomEventResponse></soapenv:Body></soapenv:Envelope>
|
46
|
+
http_version:
|
47
|
+
recorded_at: Thu, 13 Nov 2014 23:26:12 GMT
|
48
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><sessionHeader><sessionId>efkxCZI0UR09suTmXLr9X5MQnv</sessionId></sessionHeader></env:Header><env:Body><tns:triggerCustomEvent><tns:customEvent><tns:eventName>rspec_event1</tns:eventName><tns:eventId></tns:eventId><tns:eventStringDataMapping></tns:eventStringDataMapping><tns:eventDateDataMapping></tns:eventDateDataMapping><tns:eventNumberDataMapping></tns:eventNumberDataMapping></tns:customEvent><tns:recipientData><tns:recipient><tns:listName><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_list1</tns:objectName></tns:listName><tns:recipientId>0</tns:recipientId><tns:customerId></tns:customerId><tns:emailAddress>user1@email.com</tns:emailAddress><tns:mobileNumber></tns:mobileNumber><tns:emailFormat>NO_FORMAT</tns:emailFormat></tns:recipient><tns:optionalData><tns:name></tns:name><tns:value></tns:value></tns:optionalData></tns:recipientData><tns:recipientData><tns:recipient><tns:listName><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_list1</tns:objectName></tns:listName><tns:recipientId>0</tns:recipientId><tns:customerId></tns:customerId><tns:emailAddress>user2@email.com</tns:emailAddress><tns:mobileNumber></tns:mobileNumber><tns:emailFormat>NO_FORMAT</tns:emailFormat></tns:recipient><tns:optionalData><tns:name></tns:name><tns:value></tns:value></tns:optionalData></tns:recipientData></tns:triggerCustomEvent></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Cookie:
|
13
|
+
- JSESSIONID=BAC4722EECDC1A1F56B044801679505A.ws04-ri5
|
14
|
+
Soapaction:
|
15
|
+
- '"triggerCustomEvent"'
|
16
|
+
Content-Type:
|
17
|
+
- text/xml;charset=UTF-8
|
18
|
+
Content-Length:
|
19
|
+
- '1635'
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- '*/*'
|
24
|
+
User-Agent:
|
25
|
+
- Ruby
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Content-Length:
|
32
|
+
- '557'
|
33
|
+
Content-Type:
|
34
|
+
- text/xml; charset=UTF-8
|
35
|
+
Date:
|
36
|
+
- Thu, 13 Nov 2014 23:26:12 GMT
|
37
|
+
Server:
|
38
|
+
- Apache
|
39
|
+
Set-Cookie:
|
40
|
+
- BIGipServerDC2-APIGEE-I5-9051-SSL=3600669706.23331.0000; path=/
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><triggerCustomEventResponse
|
44
|
+
xmlns="urn:ws.rsys.com"><result><recipientId>48614925</recipientId><success>true</success><errorMessage
|
45
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result><result><recipientId>48614965</recipientId><success>true</success><errorMessage
|
46
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result></triggerCustomEventResponse></soapenv:Body></soapenv:Envelope>
|
47
|
+
http_version:
|
48
|
+
recorded_at: Thu, 13 Nov 2014 23:26:12 GMT
|
49
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><sessionHeader><sessionId>20Kf4jHbupQjtqpZ6ypNZ0tpoB</sessionId></sessionHeader></env:Header><env:Body><tns:triggerCampaignMessage><tns:campaign><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_campaign1</tns:objectName></tns:campaign><tns:recipientData><tns:recipient><tns:listName><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_list1</tns:objectName></tns:listName><tns:recipientId>0</tns:recipientId><tns:customerId></tns:customerId><tns:emailAddress>user1@email.com</tns:emailAddress><tns:mobileNumber></tns:mobileNumber><tns:emailFormat>NO_FORMAT</tns:emailFormat></tns:recipient><tns:optionalData><tns:name></tns:name><tns:value></tns:value></tns:optionalData></tns:recipientData></tns:triggerCampaignMessage></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Cookie:
|
13
|
+
- JSESSIONID=BD6C90EEC399A3A726DA05EC56D156C3.ws04-ri5
|
14
|
+
Soapaction:
|
15
|
+
- '"triggerCampaignMessage"'
|
16
|
+
Content-Type:
|
17
|
+
- text/xml;charset=UTF-8
|
18
|
+
Content-Length:
|
19
|
+
- '1022'
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- '*/*'
|
24
|
+
User-Agent:
|
25
|
+
- Ruby
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Content-Length:
|
32
|
+
- '408'
|
33
|
+
Content-Type:
|
34
|
+
- text/xml; charset=UTF-8
|
35
|
+
Date:
|
36
|
+
- Thu, 13 Nov 2014 23:26:10 GMT
|
37
|
+
Server:
|
38
|
+
- Apache
|
39
|
+
Set-Cookie:
|
40
|
+
- BIGipServerDC2-APIGEE-I5-9051-SSL=3600669706.23331.0000; path=/
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><triggerCampaignMessageResponse
|
44
|
+
xmlns="urn:ws.rsys.com"><result><recipientId>48614925</recipientId><success>true</success><errorMessage
|
45
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result></triggerCampaignMessageResponse></soapenv:Body></soapenv:Envelope>
|
46
|
+
http_version:
|
47
|
+
recorded_at: Thu, 13 Nov 2014 23:26:11 GMT
|
48
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ws5.responsys.net/webservices/services/ResponsysWSService
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:ws.rsys.com"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><sessionHeader><sessionId>rMc94sfP8BH1ZTd1WzOLOLAogo</sessionId></sessionHeader></env:Header><env:Body><tns:triggerCampaignMessage><tns:campaign><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_campaign1</tns:objectName></tns:campaign><tns:recipientData><tns:recipient><tns:listName><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_list1</tns:objectName></tns:listName><tns:recipientId>0</tns:recipientId><tns:customerId></tns:customerId><tns:emailAddress>user1@email.com</tns:emailAddress><tns:mobileNumber></tns:mobileNumber><tns:emailFormat>NO_FORMAT</tns:emailFormat></tns:recipient><tns:optionalData><tns:name></tns:name><tns:value></tns:value></tns:optionalData></tns:recipientData><tns:recipientData><tns:recipient><tns:listName><tns:folderName>rspec_tests</tns:folderName><tns:objectName>rspec_list1</tns:objectName></tns:listName><tns:recipientId>0</tns:recipientId><tns:customerId></tns:customerId><tns:emailAddress>user2@email.com</tns:emailAddress><tns:mobileNumber></tns:mobileNumber><tns:emailFormat>NO_FORMAT</tns:emailFormat></tns:recipient><tns:optionalData><tns:name></tns:name><tns:value></tns:value></tns:optionalData></tns:recipientData></tns:triggerCampaignMessage></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Cookie:
|
13
|
+
- JSESSIONID=EAF8B08C0EF1AA34C82094C92FF37DEF.ws03-ri5
|
14
|
+
Soapaction:
|
15
|
+
- '"triggerCampaignMessage"'
|
16
|
+
Content-Type:
|
17
|
+
- text/xml;charset=UTF-8
|
18
|
+
Content-Length:
|
19
|
+
- '1492'
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- '*/*'
|
24
|
+
User-Agent:
|
25
|
+
- Ruby
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Content-Length:
|
32
|
+
- '565'
|
33
|
+
Content-Type:
|
34
|
+
- text/xml; charset=UTF-8
|
35
|
+
Date:
|
36
|
+
- Thu, 13 Nov 2014 23:26:11 GMT
|
37
|
+
Server:
|
38
|
+
- Apache
|
39
|
+
Set-Cookie:
|
40
|
+
- BIGipServerDC2-APIGEE-I5-9051-SSL=3600669706.23331.0000; path=/
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><triggerCampaignMessageResponse
|
44
|
+
xmlns="urn:ws.rsys.com"><result><recipientId>48614925</recipientId><success>true</success><errorMessage
|
45
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result><result><recipientId>48614965</recipientId><success>true</success><errorMessage
|
46
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" /></result></triggerCampaignMessageResponse></soapenv:Body></soapenv:Envelope>
|
47
|
+
http_version:
|
48
|
+
recorded_at: Thu, 13 Nov 2014 23:26:11 GMT
|
49
|
+
recorded_with: VCR 2.9.2
|
data/spec/test_data.yml
CHANGED
@@ -20,13 +20,21 @@
|
|
20
20
|
:list1:
|
21
21
|
:name: rspec_list1
|
22
22
|
:records:
|
23
|
-
-
|
23
|
+
-
|
24
24
|
<<: *user1
|
25
|
-
-
|
25
|
+
-
|
26
26
|
<<: *user2
|
27
|
-
-
|
27
|
+
-
|
28
28
|
<<: *user3
|
29
29
|
|
30
|
+
:campaigns:
|
31
|
+
:campaign1:
|
32
|
+
:name: rspec_campaign1
|
33
|
+
|
34
|
+
:custom_events:
|
35
|
+
:custom_event1:
|
36
|
+
:name: rspec_event1
|
37
|
+
|
30
38
|
:pets:
|
31
39
|
:pet1:
|
32
40
|
:name: rspec_pet1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: responsys-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan DeMeyere
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-11-
|
14
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rubyntlm
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/responsys/api/folder.rb
|
163
163
|
- lib/responsys/api/list.rb
|
164
164
|
- lib/responsys/api/object/all.rb
|
165
|
+
- lib/responsys/api/object/custom_event.rb
|
165
166
|
- lib/responsys/api/object/email_format.rb
|
166
167
|
- lib/responsys/api/object/field.rb
|
167
168
|
- lib/responsys/api/object/field_type.rb
|
@@ -187,11 +188,16 @@ files:
|
|
187
188
|
- spec/api/campaign_spec.rb
|
188
189
|
- spec/api/client_spec.rb
|
189
190
|
- spec/api/list_spec.rb
|
191
|
+
- spec/api/object/custom_event_spec.rb
|
190
192
|
- spec/api/object/recipient_data_spec.rb
|
191
193
|
- spec/api/object/recipient_spec.rb
|
192
194
|
- spec/api/object/record_data_spec.rb
|
193
195
|
- spec/api/table_spec.rb
|
194
196
|
- spec/api_credentials.sample.yml
|
197
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_1.yml
|
198
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_2.yml
|
199
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_message_1.yml
|
200
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_message_2.yml
|
195
201
|
- spec/fixtures/vcr_cassettes/api/client/expired_session.yml
|
196
202
|
- spec/fixtures/vcr_cassettes/api/list/merge.yml
|
197
203
|
- spec/fixtures/vcr_cassettes/api/list/retrieve.yml
|
@@ -239,11 +245,16 @@ test_files:
|
|
239
245
|
- spec/api/campaign_spec.rb
|
240
246
|
- spec/api/client_spec.rb
|
241
247
|
- spec/api/list_spec.rb
|
248
|
+
- spec/api/object/custom_event_spec.rb
|
242
249
|
- spec/api/object/recipient_data_spec.rb
|
243
250
|
- spec/api/object/recipient_spec.rb
|
244
251
|
- spec/api/object/record_data_spec.rb
|
245
252
|
- spec/api/table_spec.rb
|
246
253
|
- spec/api_credentials.sample.yml
|
254
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_1.yml
|
255
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_2.yml
|
256
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_message_1.yml
|
257
|
+
- spec/fixtures/vcr_cassettes/api/campaign/trigger_message_2.yml
|
247
258
|
- spec/fixtures/vcr_cassettes/api/client/expired_session.yml
|
248
259
|
- spec/fixtures/vcr_cassettes/api/list/merge.yml
|
249
260
|
- spec/fixtures/vcr_cassettes/api/list/retrieve.yml
|