Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TriggeredSend issues - FuelSDK::DescribeError: Unable to get TriggeredSend #2

Open
alssndro opened this issue Feb 22, 2014 · 7 comments

Comments

@alssndro
Copy link

Hi, first off thanks for maintaining a fork of the seemingly abandoned 'official' gem.

I am having the same issue that was present in the unmaintained version here.

Using this gem, I can get a list of TriggeredSends and retrieve their status no problem.

Sending with a TriggeredSend does not work though, and always raises the error:

FuelSDK::DescribeError: Unable to get TriggeredSend
from /Users/s/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:163:in `get_all_object_properties'

And the full error message with debug mode on:

D, [2014-02-22T00:40:21.336074 #10338] DEBUG -- : HTTPI GET request to webservice.exacttarget.com (net_http)
I, [2014-02-22T00:40:22.100041 #10338]  INFO -- : SOAP request: https://webservice.s6.exacttarget.com/Service.asmx
I, [2014-02-22T00:40:22.100111 #10338]  INFO -- : SOAPAction: "Describe", Content-Type: text/xml;charset=UTF-8, Content-Length: 1238
D, [2014-02-22T00:40:22.100151 #10338] DEBUG -- : 

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://exacttarget.com/wsdl/partnerAPI" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
    <oAuth xmlns="http://exacttarget.com">
    <oAuthToken>[redacted]</oAuthToken>
</oAuth>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1">
<wsse:Username>*</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">*</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
<env:Body>
    <tns:DefinitionRequestMsg>
        <tns:DescribeRequests>
            <tns:ObjectDefinitionRequest>
                <tns:ObjectType>TriggeredSend</tns:ObjectType>
            </tns:ObjectDefinitionRequest>
        </tns:DescribeRequests>
    </tns:DefinitionRequestMsg>
</env:Body>
</env:Envelope>

D, [2014-02-22T00:40:22.100272 #10338] DEBUG -- : HTTPI POST request to webservice.s6.exacttarget.com (net_http)
I, [2014-02-22T00:40:23.519374 #10338]  INFO -- : SOAP response (status 200)
D, [2014-02-22T00:40:23.519457 #10338] DEBUG -- :
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
    <wsa:Action>DescribeResponse</wsa:Action>
    <wsa:MessageID>urn:uuid:1f47b68d-e788-4b63-9ec0-e0068be419db</wsa:MessageID>
    <wsa:RelatesTo>urn:uuid:5b481866-080f-469b-974a-6bd4414d7e5d</wsa:RelatesTo>
    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsse:Security>
        <wsu:Timestamp wsu:Id="Timestamp-4404a62b-6aef-4c75-a8db-8c26d11cc70d">
            <wsu:Created>2014-02-22T00:40:23Z</wsu:Created>
            <wsu:Expires>2014-02-22T00:45:23Z</wsu:Expires>
        </wsu:Timestamp>
    </wsse:Security>
</soap:Header>
<soap:Body>
    <DefinitionResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <RequestID>f8d496f5-98b0-48ec-a059-146338e5d01f</RequestID>
</DefinitionResponseMsg>
</soap:Body>
</soap:Envelope>
FuelSDK::DescribeError: Unable to get TriggeredSend
from /Users/s/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:163:in `get_all_object_properties'

I will continue to dig around the source, but any help would be appreciated.

Thanks

@bbakersmith
Copy link
Contributor

Hey, alessndro.

Can you post the code you've been using to try to trigger sends? Here's what has worked for me in the past:

et = FuelSDK::TriggeredSend.new

et.client =  FuelSDK::Client.new({
    'client' => {
        'id' => <CLIENT_ID>,
        'secret' => <CLIENT_SECRET>
    } 
})

et.properties = {
    "CustomerKey" => <CUSTOMER KEY OF TRIGGERED SEND>,
    "Subscribers" => [{
        "EmailAddress" => <TARGET EMAIL ADDRESS>,
        "SubscriberKey" => <TARGET EMAIL ADDRESS>,
        "Attributes" => <ARRAY OF ATTRIBUTE HASHES>
    }]
}

response = et.send

I believe Attributes takes an array something like...

[
    {'Name' => 'FirstName', 'Value' => 'John Smith'}, 
    {'Name' => 'Age', 'Value' => 76}
]

@alssndro
Copy link
Author

Hi @bbakersmith,

I was using samples provided in the repo, so for triggered sends that was the example here.

I just retried using the code you provided and I am receiving the exact same error:

FuelSDK::DescribeError: Unable to get TriggeredSend
from /Users/s/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fuelsdk-0.1.6/lib/fuelsdk/soap.rb:164:in `get_all_object_properties'

I did try stepping through the code using pry-debugger, but saying I have little experience with SOAP would be an understatement! I'm using Ruby 2.1.0, though I don't think that's the problem since the other developer who was also having this problem with the original Fuel-SDK gem was using Ruby 1.9.

In the end I gave up and wrote my own very simple wrapper around ExactTarget's REST API instead (using this endpoint), which seems to be working so far.

Thanks for your help though!

@bbakersmith
Copy link
Contributor

Aha, you're right, I was using an old version of the SDK, v 0.0.5. My code fails if I use the current version of the gem.

@barberj
Copy link
Owner

barberj commented Mar 13, 2014

Looking at this and the other issue today.

@barberj
Copy link
Owner

barberj commented Mar 14, 2014

@alessndro not addressed in 0.1.7.

@udit7590
Copy link

udit7590 commented Oct 6, 2015

@barberj I am too getting this issue. Any fix there yet?

@hcarreras
Copy link

Getting the same error...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants