From 6e4025dc58a19d4573a5af48af77f55ef898efc5 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Wed, 2 Feb 2022 22:16:08 +0000 Subject: [PATCH] Initial new api --- api/v1/assets/read.php | 66 ++++++++++++++++++++++++ api/v1/validate_api_key.php | 100 ++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 api/v1/assets/read.php create mode 100644 api/v1/validate_api_key.php diff --git a/api/v1/assets/read.php b/api/v1/assets/read.php new file mode 100644 index 00000000..ae064519 --- /dev/null +++ b/api/v1/assets/read.php @@ -0,0 +1,66 @@ + 0){ + $return_arr['success'] = "True"; + $return_arr['count'] = mysqli_num_rows($sql); + + $row = array(); + while($row = mysqli_fetch_array($sql)){ + $return_arr['data'][] = $row; + } + + echo json_encode($return_arr); + exit(); +} +else{ + $return_arr['success'] = "False"; + $return_arr['message'] = "No asset(s) (with that ID) for this company"; + echo json_encode($return_arr); + exit(); +} \ No newline at end of file diff --git a/api/v1/validate_api_key.php b/api/v1/validate_api_key.php new file mode 100644 index 00000000..1eea0fb6 --- /dev/null +++ b/api/v1/validate_api_key.php @@ -0,0 +1,100 @@ +