in the previous post i am using a Chrome extension HTTP Client (Boomerang) beacause i cant use the SDK
This is my PHP Code if i use the API SDK
<?php
require_once 'api/blesta_api.php';
$user = "isaac";
$key = "a5-----------------0f4f";
$url = "http://domain.com/api";
$api = new BlestaApi($url, $user, $key);
$args = array(
'vars' => array(
'username' => 'fulanito',
'new_password' => 'Mash.123',
'confirm_password' => 'Mash.123',
'client_group_id' => 1,
'first_name' => 'Fulanito',
'last_name' => 'De tal',
'email' => 'fulanito@moesbar.com',
'state' => 'AGU',
'country' => 'MX',
'zip' => '27000',
'settings' => array(
'default_currency' => 'MXN',
'language' => 'es_es',
'tax_exempt' => true,
'send_registration_email' => false
)
)
);
$response = $api->post('clients', 'create', $args);
var_dump($response);
The var_dump show this:
object(BlestaResponse)#2 (2) {
["raw":"BlestaResponse":private]=>
string(0) ""
["response_code":"BlestaResponse":private]=>
int(302)
}