Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@

route_api_resource($route, 'blocked_periods', 'api/v1/');

$route['api/v1/system']['get'] = 'api/v1/system_api_v1/index';

$route['api/v1/settings']['get'] = 'api/v1/settings_api_v1/index';

$route['api/v1/settings/(:any)']['get'] = 'api/v1/settings_api_v1/show/$1';
Expand Down
48 changes: 48 additions & 0 deletions application/controllers/api/v1/System_api_v1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');

/* ----------------------------------------------------------------------------
* Easy!Appointments - Online Appointment Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @copyright Copyright (c) Alex Tselegidis
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
* @link https://easyappointments.org
* @since v1.6.1
* ---------------------------------------------------------------------------- */

/**
* Settings API v1 controller.
*
* @package Controllers
*/
class System_api_v1 extends EA_Controller
{
/**
* System_api_v1 constructor.
*/
public function __construct()
{
parent::__construct();

$this->load->library('api');

$this->api->auth();
}

/**
* Get a system collection.
*/
public function index(): void
{
try {
$response = [
'version' => config('version')
];

json_response($response);
} catch (Throwable $e) {
json_exception($e);
}
}
}
33 changes: 33 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tags:
- name: service_categories
- name: services
- name: settings
- name: system
- name: unavailabilities
- name: webhooks
- name: working_plan_exceptions
Expand Down Expand Up @@ -1596,6 +1597,31 @@ paths:
security:
- BearerToken: [ ]
- BasicAuth: [ ]
/system:
get:
tags:
- system
summary: Get system informations
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SystemRecord'
'401':
description: Unauthorized
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- BearerToken: [ ]
- BasicAuth: [ ]
/webhooks:
get:
tags:
Expand Down Expand Up @@ -2462,6 +2488,13 @@ components:
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
SystemRecord:
type: object
properties:
version:
type: string
example:
version: '1.6.1'
ServiceCategoryRecord:
type: object
properties:
Expand Down