add_sambauser()
Create a network drive user.
Signature
add_sambauser(array $parameters): mixedParameters
Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.
| Name | Description | Requirement |
|---|---|---|
samba_path |
The path | Required |
samba_password |
The password | Required |
samba_comment |
The comment | Required |
PHP example
<?php
// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
'samba_path' => 'samba-path',
'samba_password' => 'secret',
'samba_comment' => 'a_comment',
];
try {
$client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
$response = $client->KasApi(json_encode([
'kas_login' => 'w0123456',
'kas_auth_type' => 'session',
'kas_auth_data' => $sessionToken,
'kas_action' => 'add_sambauser',
'KasRequestParams' => $parameters,
]));
print_r($response);
} catch (SoapFault $fault) {
echo 'Error: ' . $fault->faultstring;
}
Responses and error codes
-
TRUEthe action was carried out -
missing_parametera required parameter is missing -
couldnt_get_kas_ressources -
max_sambauser_reached -
password_syntax_incorrect -
path_syntax_incorrect -
samba_comment_syntax_incorrect