updateAccounts Multi-Brand Only
The updateAccounts
function allows you to change account options, settings, and other details.
Overview
For accounts marked as inactive, the only action you can perform is to switch the account to active.
Syntax
writeResult = bApi.updateAccounts(accountObject[] accounts);
Attributes
Name | Type | Required | Description |
---|---|---|---|
id |
string | Yes | The unique id for the account. |
name |
string | No | The name for the account. The name can be used to reference a specific account when using the account functions. |
status |
string | Yes | The status of the account. You can update an account from
unrestricted to inactive and
inactive to unrestricted . You can’t change the
status of a restricted account. Users will not be able to login
(from the UI or the API) to accounts with a status of
inactive . |
generalSettings |
GeneralSettings[] | Yes | Allows you to specify an array of values corresponding to the general settings in the account. Click in the Name row for more information on the items in the array. |
contactInformation |
ContactInformation[] | No | Allows you to specify an array of values corresponding to the contact information for the account. Click in the Name row for more information on the items in the array. |
formatSettings |
FormatSettings[] | No | Allows you to specify an array of values corresponding to the formatting settings in the account. Click in the Name row for more information on the items in the array. |
repliesSettings |
RepliesSettings[] | No | Allows you to specify an array of values corresponding to the replies settings in the account. Click in the Name row for more information on the items in the array. |
allocations |
AccountAllocations[] | Yes | Agency Only Allows you to specify an array of values corresponding to the allocations you assign to the account you are adding. Click in the Name row for more information on the items in the array. |
PHP Code Example
<?php /** * This example will update the details of an Agency client account. * Note that it uses only the minimum required account attributes * needed to perform an update */ $client = new SoapClient('https://api.bronto.com/v4?wsdl', array('trace' => 1, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS)); try { $token = "ADD YOUR 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)); //General Settings $generalSettings = array( 'sitename' => 'someagency', 'agencyTemplateuploadPerm' => 1, 'defaultTemplates' => 1, 'enableInboxPreviews' => 0, 'allowCustomizedBranding' => 1, 'bounceLimit' => 7, 'usageAlertEmail' => 'joe@example.com', 'sendUsageAlerts' => 1, ); $allocations = array( 'periodFrequency' => 12, 'bundle' => 'professional', ); $account = array( 'id' => 'ADD THE CLIENT ACCOUNT ID HERE', 'status' => 'active', 'generalSettings' => $generalSettings, 'allocations' => $allocations, ); $res = $client->updateAccounts(array($account))->return; if ($res->errors) { print "There was a problem updating the account:\n"; print_r($res->results); } else { print "Account has been updated. \n"; } } catch (Exception $e) { print "uncaught exception\n"; print_r($e); }