getLabels
Returns all created labels.
| Route | /project/getLabels[/:key[/:category[/:format[/:limit[/:skip]]]]] |
|---|---|
| Necessary parameter | – |
| Optional parameter | category format limit (max:1000) skip |
| Return values | hash name |
| Cross references | getCategories |
| Hints | limit – the maximum limit is 1000.To get more results use the parameter skip. |
Parameter
| Labeling | Description | Values margin | Default value |
|---|---|---|---|
| category | Defines for which category the result will be returned. | see getCategories | Null |
| format | Defines in which format the result will be returned. | json|xml | json |
| limit | Defines the amount of the returned results. (max:1000) | 0-1000 | 100 |
| skip | Defines the starting page of the result. One page equals the the value of limit. | (0-9)+ | 0 |
Return values
| Labeling | Description | Values margin |
|---|---|---|
| hash | Contains a unique identifier. | (a-z0-9)+ |
| name | Contains a designator for the already created Label. | (A-Z|a-z|0-9)+ |
| categories | contains an array with categories the label is connected with. | see getCategories |
Messages
| Message | Description |
|---|---|
| limit exeeded | The maximum limit is reached. |
| no permission | The key has no access to 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. |
Exemplary code
$root = 'https://suite.xovi.net/api/';
$arrayParams = array(
'service' => 'project',
'method' =>'getLabels',
'key' =>'myPersonalKey',
'category' =>'projects',
'format' =>'xml',
);
$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;
Exemplary results
JSON
{
"apiErrorCode":"0",
"apiErrorMessage":"0k.",
"apiResult":[
{
"hash":"6af673",
"name":"apilabel",
"categories":{
"categorie0":"projects",
"categorie1":"keywords",
}
}]
}
XML
<?xml version="1.0"?>
<result>
<apiErrorCode>0</apiErrorCode>
<apiErrorMessage>0k.</apiErrorMessage>
<apiResult>
<labels>
<label>
<hash>6af673</hash>
<name>apilabel</name>
<categories>
<categorie0>projects</categorie0>
<categorie1>keywords</categorie1>
</categories>
</label>
</labels>
</apiResult>
</result>
