0

I'm attempting to run an automation via a form submission. The response to the post is {"StatusCode":200,"Response":[""]} - yet the automation is not running.

The code for the post is:

Platform.Load("Core","1");

var token = Variable.GetValue("@apitoken"); //API Token generated via AMPScript
var endpoint = 'https://webservice.exacttarget.com/Service.asmx'
var result;
var pkg = 
    '<soapenv:Envelope ' +
        'xmlns:soapenv="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">' +
        '<soapenv:Header>' +
            '<fueloauth>' + token + '</fueloauth>' +
        '</soapenv:Header>' +
        '<soapenv:Body>' +
            '<PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">' +
                '<Action>start</Action>' +
                '<Definitions>' +
                    '<Definition xsi:type="Automation">' +
                        '<Client>' +
                            '<ID> MID used Here </ID>' +
                        '</Client>' +
                        '<ObjectID> Automation External Key Here </ObjectID>' +
                    '</Definition>' +
                '</Definitions>'+
            '</PerformRequestMsg>' +
        '</soapenv:Body>' +
    '</soapenv:Envelope>';

try {
    result = HTTP.Post(endpoint, "text/xml", pkg, ["SOAPAction"], ["Perform"])
} catch (e) {
    Write(Stringify(e));
}

Any thoughts as to why the HTTP Post is coming back a-okay but not triggering the automation?

I have tried setting the automation to a future schedule and paused it - neither disposition works.

0

@Corey <ObjectID> Automation External Key Here </ObjectID> in this part use object id not the automation external key then try its working

| improve this answer | |
  • Yep. Used a retrieve request to get the OID and got it working. Do you know if marketing cloud lists the OID anywhere through the platform? – user43881 Mar 27 '18 at 13:50

Your Answer

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