Jump to content

Recommended Posts

Posted

Hey, 

Hopefully, someone can help.  I am having trouble adding a client via the API, I keep getting the following error:

BlestaResponse Object ( [raw:BlestaResponse:private] => {"message":"An unexpected error occured.","response":"Internal error: Failed to retrieve the default value"} [response_code:BlestaResponse:private] => 500 )

My code is as follows:

require_once "blesta_api.php";
 
$user = '***';
$key = '***';
$url = "https://***/api/";
 
$api = new BlestaApi($url, $user, $key);


$data = array(
    'username' => 'daniel***.com',
    'new_password' => '****',
    'confirm_password' => '****',    
    'client_group_id' => '16',  
    'status' => 'active',
    'first_name' => 'Daniel',  
    'last_name' => '***', 
    'title' => 'Mr',
    'company' => 'MyCompany',
    'email' => 'daniel***.com',  
    'address1' => '1 street',  
    'address2' => 'somewhere',
    'city' => 'mycity', 
    'state' => '***',
    'zip' => '1111',  
    'country' => 'NZ',
    'numbers' => array (
            'type' => 'phone',
            'location' => 'home',
            'number' => '****',
        ),
    'settings' => array (
        'username_type' => 'email',
        'tax_exempt' => false,
        'tax_id' => '',
        'default_currency' => 'NZD',
        'language' => 'en_us',
        'receive_email_marketing' => true,
    ),
	'send_registration_email' => 'true',
);

$response = $api->get("clients", "create", $data);
print_r($response);

 

Thanks,
Daniel

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...