readWorkflows

The readWorkflows function attempts to return the requested data for workflows that match the given workflowFilter.

Results

The readWorkflows function may return 1 or many workflow objects. See the documentation on the workflowObject for a list of the data fields that could potentially be returned.

Note: The data fields returned depend on the type of data you ask for in your request.

Syntax

workflowObject[] workflow = bApi.readWorkflows( filter workflowFilter, pageNumber );

Parameters

Name Type Required Description
filter workflowFilter Yes The workflowFilter allows you to read data from a specific workflow(s).
pageNumber int Yes Retrieves the next “batch” of objects as the value specified increases from 1. In order to obtain an entire set of objects for a given call, you should increase the number value assigned to pageNumber until no more objects are returned.

PHP Code Example

<?php
/**
 * This example will read data for a workflow
 * whose name matches the given filter
 */ 
 
$client = new SoapClient('https://api.bronto.com/v4?wsdl', 
              array('trace' => 1, 
                  'features' => SOAP_SINGLE_ELEMENT_ARRAYS)
            );
 
try {
 
  // Add in a valid API token here
  $token = "ADD IN A VALID API TOKEN";
 
  print "logging in\n";
  $sessionId = $client->login(array('apiToken' => $token))->return;
 
  $session_header = new SoapHeader("http://api.bronto.com/v4",
                   'sessionHeader',
                    array('sessionId' => $sessionId)
                  );
 
  $client->__setSoapHeaders(array($session_header));
 
  // Replace the generic text with name of the workflow
  // whose data you want to obtain.
  $filter = array('name' => array('operator' => 'EqualTo',
                  'value' => 'NAME OF A WORKFLOW')
           );
 
  print "reading activity details\n";
 
  $workflows = $client->readWorkflows(array('pageNumber' => 1,
                        'filter' => $filter,)
                     );
 
// Print the data for the workflow object(s) returned
foreach ($workflows as $workflow) {
    print_r($workflows);
}
 
} catch (Exception $e) {
  print "uncaught exception\n";
  print_r($e);
}