23 lines
505 B
PHP
23 lines
505 B
PHP
<?php
|
|
// Load Main Library
|
|
require "../api.php";
|
|
|
|
$api = new gbAPI(false);
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
|
|
$api->answer(400, [
|
|
"error" => "false_request_method",
|
|
"error_text" => "Only POST allowed"
|
|
]);
|
|
}
|
|
|
|
$input = json_decode(file_get_contents("php://input"), true);
|
|
|
|
if (!isset($input["name"]) || !isset($input["text"])) {
|
|
$api->answer(400, [
|
|
"error" => "missing_fields",
|
|
"error_text" => "Some fields are missing"
|
|
]);
|
|
}
|
|
|
|
$api->getSetting(""); |