Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Any advice on creating a SoapClient.IET_Client.SoapClient.perform( ? #103

Closed
davestacey opened this issue Jul 19, 2016 · 5 comments
Closed

Comments

@davestacey
Copy link

I'm trying to do an IET_Client.SoapClient.perform(.
Something like:
IET_Client.SoapClient.perform(
'EmailSendDefinition',
options,
function( err, response ) {...`

    var options = {
        props: {
            "Action": "start"
            , "CustomerKey": "2177425"
            , "SenderProfile": {
                "FromName": "Sender"
                , "FromAddress": "send@test.com"
            }
        }
    };

IET_Client.SoapClient.retrieve works well for me, but I am trying to figure out the structure for a perform.

@vernak2539
Copy link
Contributor

Unfortunately, perform has not been implemented and is actually just FuelSoap.prototype.perform = function() {};.

It could be a while before someone can get around to it, but if you figure it out, we'd love the contribution.

@davestacey
Copy link
Author

Thanks Alex, will do. How about Send? Someone pointed me toward "Creating a Send Object Using an Email ID and a List" I haven't done that yet, any pointers?
<soap:Body> <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"&gt; <Options/> <Objects xsi:type="Send"> <ObjectID xsi:nil="true"/> <Email> <ID>12345</ID> </Email> <List> <ID>12345</ID> </List> </Objects> </CreateRequest> </soap:Body>

@vernak2539
Copy link
Contributor

Sorry for the late response @davestacey, life has been getting the way.

At the moment, I would look at the other functions. I believe in one way or another they will have some sort of example that will let you get to what you need.

@tdsticks
Copy link

tdsticks commented Feb 4, 2017

I managed to get this to work with Automation Studio.

FuelSoap.prototype.perform = function(type, props, callback) {
	console.log("::FuelSoap.prototype.perform::");

	var body = {
		PerformRequestMsg: {
			'$': {
				'xmlns': 'http://exacttarget.com/wsdl/partnerAPI'
			},
			'Action': 'start',
			'Definitions': {
				'Definition': {
					'$': {
						'xsi:type': type,
					},
					'CustomerKey': props.CustomerKey,
				}
			}
		}
	};

	this.soapRequest({
		action: 'Perform',
		req: body,
		key: 'PerformResponseMsg',
		retry: true
	}, callback);
};

Obviously, I just hacked it a bit to get it to work and need to go back a clean it up a bit.

Here's how I execute it:

EtFuelApi.prototype.startAutomationActivity = function () {
    console.log("::et_fuel_api:: startAutomationActivity:");

    var deferred = Q.defer();

    propObj = {
        'CustomerKey': "{Automation Activity Customer Key}"
    };
    // console.log("propObj", propObj);

    // local = this before callback assignment
    this.SoapClient.perform(
        'Automation',
        propObj,
        function( err, response ) {
            if ( err ) {
                // error here
                console.error( err );
                return;
            }
            // console.log(response.body);
            deferred.resolve(response.body);
        }
    );

    return deferred.promise;
};

I also have this working with ImportDefinitions, so it may work with other ET objects that utilize Perform.

@vernak2539
Copy link
Contributor

this has since been implemented in #108. There have been examples added as well. If you don't find what you're looking for, feel free to open another issue

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

No branches or pull requests

3 participants