0

I've been using the SOAP api for things. It's working really well for almost everything. The one thing that it couldn't do the last time I checked was pull a template from the ExactTarget platform and populate a content area. So what I had to do instead was set up a Paste HTML and send the template along with my content as a wrapper. It works, but it's not ideal.

I see that there is now a REST api but that it doesn't do everything. I'd much prefer to work with REST and I'm wondering if it's possible to use both? I'd like to use REST for the things it can do, pull from the system, and then send that data with my SOAP envelope. As I'm writing this I think it's probably doable, but I can't wrap my head around the how.

Thanks.

  • You're right, it's doable and should not be a big deal if you're already using SOAP and REST separately. Your question is a bit vague, not sure what you're trying to ask. If you could be a bit more specific with your problem statement that would get you a solution faster. – Rajdeep Singh Apr 24 '17 at 20:45
  • I'm not sure I have a problem statement... but when I come up with one I will update. – garek007 Apr 24 '17 at 20:50
1

Yep. This is completely doable. You can even authenticate your SOAP calls through the same oAuth token as your REST (http://www.kellyjandrews.com/2014/02/20/using-fuel-oauth-with-the-soap-api.html). The main difference is that while in SOAP you can say QueryAllAccounts is true and potentially gain access to multiple business units, the REST calls will only authenticate into the BU linked within your code. app.

---EDIT--- So after making a request to get your token:

curl -X POST -H "Content-Type: application/json" -d '{ "clientId": "YOURID","clientSecret": "YOURSECRET"}' https://auth.exacttargetapis.com/v1/requestToken

You can take the token returned:

{"accessToken":"YOURACCESSTOKEN","expiresIn":3600}

and use it in SOAP. Here is an example SOAP call using the oAuth token requested via the REST endpoint. This specific request is pulling all the folders for the BU associated to the clientid during the app center app's registration.

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Body>
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <RetrieveRequest>
        <ObjectType>DataFolder</ObjectType>
        <Properties>Name</Properties>
        <Properties>ID</Properties>
        <Properties>ParentFolder.ID</Properties>
        <Properties>ContentType</Properties>
        <Properties>Client.ID</Properties>
      </RetrieveRequest>
    </RetrieveRequestMsg>
  </Body>
  <Header>
    <fueloauth xmlns="http://exacttarget.com">YOURACCESSTOKEN</fueloauth>
  </Header>
</Envelope>
  • thank you for posting your answer, if possible, could you modify it to include a code sample and or quotes from the link provided of what it is you are attempting to explain with the context, in case the link would expire or become unavailable for some reason. Thanks – glls Apr 24 '17 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.