|
@@ -0,0 +1,46 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+require_once API_DIR.'/v1.0/json.AbstractJson.php';
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Basic example to try api
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+class Test extends AbstractJson
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @var string Dummy string value
|
|
|
|
+ */
|
|
|
|
+ protected $value = '';
|
|
|
|
+
|
|
|
|
+ public function post_test()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ // Check authorization
|
|
|
|
+ // TODO ...
|
|
|
|
+
|
|
|
|
+ $message = sprintf("This is the value passed from post value : %s", $this->value);
|
|
|
|
+
|
|
|
|
+ return array(
|
|
|
|
+ "status" => ApiStatus::API_SUCCESS_STATUS,
|
|
|
|
+ "message" => $message,
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function get_test()
|
|
|
|
+ {
|
|
|
|
+ $message = sprintf("This is the value passed from post value : %s", $this->value);
|
|
|
|
+
|
|
|
|
+ return array(
|
|
|
|
+ "status" => ApiStatus::API_SUCCESS_STATUS,
|
|
|
|
+ "message" => $message,
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected function get_protected()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|