readDeliveryGroups

The readDeliveryGroups function attempts to return a delivery group and all the items contained in the delivery group.

Results

The readDeliveryGroups function may return 1 or many delivery group objects. See the documentation on the deliveryGroupObject 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

deliveryGroupObject[] deliveryGroup = bApi.readDeliveryGroups(filter deliveryGroupFilter, pageNumber);

Parameters

Name Type Required Description
filter deliveryGroupFilter Yes The filter used to return a specific delivery group.
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 return the a deliveryGroupObject for each
  * delivery group that matches the given filter.
  */
$client = new SoapClient('https://api.bronto.com/v4?wsdl', array('trace' => 1, 
                                 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
 
try {
  // Add your API token 
  $token = "API TOKEN HERE";
 
  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));
 
  $filter = array(
      // Filter by name
      "name" => array("operator" => "EqualTo", "value" => "NAME OF DELIVERY GROUP")
  );
 
  $result = $client->readDeliveryGroups(array(
                          "filter" => $filter,
                          "pageNumber" => 1
                          ));
 
  print_r($result);
 
} catch (Exception $e) {
  print "uncaught exception\n";
  print_r($e);
}

Python Code Example

This example uses the byListType filter.

<?php
/**
  * This example will return return the IDs of all 
  * deliveries that are part of the delivery group.
  */
 
$client = new SoapClient('https://api.bronto.com/v4?wsdl', array('trace' => 1, 
                                 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
 
try {
 
  // Add your API token 
  $token = "API TOKEN HERE";
 
  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));
 
  $filter = array(
    "listByType" => "DELIVERIES",
    "deliveryGroupId" => "ADD THE ID OF THE DELIVERY GROUP"
  );
 
  $result = $client->readDeliveryGroups(array(
                          "filter" => $filter,
                          "pageNumber" => 1
                          ));
 
  print_r($result);
 
} catch (Exception $e) {
  print "uncaught exception\n";
  print_r($e);
}