opensupports/server/controllers/system/get-api-keys.php

37 lines
781 B
PHP
Raw Normal View History

<?php
use Respect\Validation\Validator as DataValidator;
2017-04-18 02:09:16 +02:00
/**
2017-04-21 08:09:24 +02:00
* @api {post} /system/get-api-keys Retrieve api keys.
2017-04-18 02:09:16 +02:00
*
* @apiName Get api keys
*
* @apiGroup system
*
2017-04-21 08:09:24 +02:00
* @apiDescription This path retrieves the all api keys.
2017-04-18 02:09:16 +02:00
*
* @apiPermission Staff level 3
*
2017-04-21 08:09:24 +02:00
* @apiUse NO_PERMISSION
*
2017-04-22 03:33:17 +02:00
* @apiSuccess {[APIKey](#api-Data_Structures-ObjectApikey)[]} data Array of api keys
2017-04-18 02:09:16 +02:00
*
*/
class GetAPIKeysController extends Controller {
const PATH = '/get-api-keys';
const METHOD = 'POST';
public function validations() {
return [
'permission' => 'staff_3',
'requestData' => []
];
}
public function handler() {
$apiList = APIKey::getAll();
Response::respondSuccess($apiList->toArray());
}
}