0

I want to confirm automation perform status.

How do I confirm this by PHP via SOAP-API?

PHP sample code is here.

require('../ET_Client.php');

const OBJ_TYPE        = "Automation";
const ACTION_TYPE     = "start";
const AUTOMATION_NAME = "[Automation name]";

try {
    $authStub = new ET_Client();

    // Get ObjectID
    $props = array(
        'ProgramID',
        'Name'
    );
    $filter = array(
        'Property' => 'Name',
        'SimpleOperator' => 'equals',
        'Value' => AUTOMATION_NAME
    );
    $automationInfo = new ET_Get($authStub, OBJ_TYPE, $props, $filter);
    var_dump($automationInfo);
    $objectID = $automationInfo->results[0]->ObjectID;

    // Perform automation immediately
    $props = array(
        'ObjectID' => $objectID
    );
    $response = new ET_Perform($authStub, OBJ_TYPE, ACTION_TYPE, $props);
    var_dump($response);

} catch (Exception $ex) {
    echo 'Caught exception: ',  $ex->getMessage(), "\n";
}
1
  • Please update your question with a sample of your code -- working or not. It will benefit those coming after you. Commented Apr 19, 2017 at 10:52

1 Answer 1

1

You do a RetrieveRequest on the Automation object and filter on the CustomerKey of your Automation.

The Status is returned in the result. It'll be one of these values:

-1   Error
 0   BuildingError
 1   Building
 2   Ready
 3   Running
 4   Paused
 5   Stopped
 6   Scheduled
 7   Awaiting Trigger
 8   InactiveTrigger

Here's a SSJS example. Structure would be the same if you're using the SDK.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .