addDeliveryGroup

The addDeliveryGroup function allows you to add a delivery group.

Syntax

writeResult = bApi.addDeliveryGroup(deliveryGroupObject[] deliveryGroup);

Attributes

Name Type Required Description
name string Yes The name associated with the delivery group.

PHP Code Example

 <?php
    /**
    * This script will add a new delivery group. 
    *
    * @copyright Copyright (c) 2018 Oracle + Bronto Software (http://www.bronto.com)
    */
 
    $client = new SoapClient('https://api.bronto.com/v4?wsdl', array('trace' => 1,
                                     'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
    try {
      // Add your API token
        $token = "ADD YOUR 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));
 
       // $deliveryGroupObject is an array containing the delivery group information.
       // The name is the name of your new delivery group.
        $deliveryGroupObject = array("name" => "NEW DELIVERY GROUP NAME");
 
        $write_result = $client->addDeliveryGroup(array($deliveryGroupObject))->return;
        if ($write_result->errors) {
            print "There was a problem adding the delivery group.\n";
            print_r($write_result->results);
        } else {
            print "The delivery group has been added.\n";
        }
    } catch (Exception $e) {
        print "uncaught exception\n";
        print_r($e);
    }
    ?>