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

38 lines
785 B
PHP
Executable File

<?php
use Respect\Validation\Validator as DataValidator;
/**
* @api {post} /system/get-api-keys Get APIKeys
* @apiVersion 4.3.2
*
* @apiName Get APIKeys
*
* @apiGroup System
*
* @apiDescription This path retrieves the all APIKeys.
*
* @apiPermission staff3
*
* @apiUse NO_PERMISSION
*
* @apiSuccess {[APIKey](#api-Data_Structures-ObjectApikey)[]} data Array of APIKeys
*
*/
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());
}
}