getSubaccounts
Returns all subbacounts of a master account.
Route |
/user/getSubaccounts[/:key[/:format]] |
required Parameters |
– |
Optional Parameters |
format |
returnvalues |
hash
name
email
|
crossreferences |
– |
hints |
– |
Parameters
labeling |
description |
value margin |
default value |
format |
Defines the format of the result. |
json|xml |
json |
Return values
Labeling |
description |
value margin |
hash |
Id of the subaccount |
(a-z0-9){32} |
name |
Name of subaccount |
(a-z0-9){32} |
email |
Email address of the subaccount |
(a-z0-9){32} |
Messages
Message |
Description |
no permission |
The Api key has no permission to access this function. |
internal error |
An internal error occured. |
param missing |
A required parameter is missing. |
param invalid |
The value of a parameter is not valid. |
result empty |
The request was successful, but the result itself is empty. |
cost error |
The current credit amount is not sufficient to handle the request. |
0k. |
The processing was successful. |
EXAMPLE CODE
$root = 'https://suite.xovi.net/api/';
$arrayParams = array(
'service' =>'user',
'method' =>'getSubaccounts',
'key' =>'myPersonalKey',
);
$GETparams = implode('/', $arrayParams);
$requestURL = $root.$GETparams;
if (!function_exists('curl_init')) die('cURL not available');
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_URL, $requestURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
echo $output;
EXAMPLE RESULTS
JSON
{
"apiErrorCode": 0,
"apiErrorMessage": "0k.",
"apiResult": [{
"hash": "b4b292d0c16f20eee10a7754539a189c",
"name": "mySubuser",
"email": "[email protected]",
}]
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<result>
<apiErrorCode>0</apiErrorCode>
<apiErrorMessage>0k.</apiErrorMessage>
<apiResult>
<subusers>
<subuser>
<hash>3957d580698c3345c9a962e077c44961</hash>
<name>mySubuser</name>
<email>[email protected]</email>
</subuser>
</subusers>
</apiResult>
</result>