update
This commit is contained in:
@ -5,394 +5,398 @@
|
||||
https://github.com/ticlekiwi/API-Documentation-HTML-Template
|
||||
!-->
|
||||
|
||||
<%- include('top') %>
|
||||
<link rel="stylesheet" href="css/api.css" media="all">
|
||||
<%- include('top') %>
|
||||
<link rel="stylesheet" href="css/api.css" media="all">
|
||||
|
||||
<body class="one-content-column-version">
|
||||
<div class="left-menu">
|
||||
<div class="content-logo">
|
||||
<div class="logo">
|
||||
<img alt="platform by Emily van den Heever from the Noun Project"
|
||||
title="platform by Emily van den Heever from the Noun Project" src="images/apilogo.png"
|
||||
height="32" />
|
||||
<span>API Documentation</span>
|
||||
</div>
|
||||
<button class="burger-menu-icon" id="button-menu-mobile">
|
||||
<svg width="34" height="34" viewBox="0 0 100 100">
|
||||
<path class="line line1"
|
||||
d="M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331 94.543142,77.980673 90.966081,81.670246 85.259173,81.668997 79.552261,81.667751 75.000211,74.999942 75.000211,74.999942 L 25.000021,25.000058">
|
||||
</path>
|
||||
<path class="line line2" d="M 20,50 H 80"></path>
|
||||
<path class="line line3"
|
||||
d="M 20,70.999954 H 80.000231 C 80.000231,70.999954 94.498839,71.182648 94.532987,33.288669 94.543142,22.019327 90.966081,18.329754 85.259173,18.331003 79.552261,18.332249 75.000211,25.000058 75.000211,25.000058 L 25.000021,74.999942">
|
||||
</path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mobile-menu-closer"></div>
|
||||
<div class="content-menu">
|
||||
<div class="content-infos">
|
||||
<div class="info"><b>Version:</b> 0</div>
|
||||
<div class="info"><b>Last Updated:</b> 22th January 2024</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="scroll-to-link active" data-target="content-get-started">
|
||||
<a>GET STARTED</a>
|
||||
</li>
|
||||
<li class="scroll-to-link" data-target="content-get-api">
|
||||
<a>Generate API</a>
|
||||
</li>
|
||||
<li class="scroll-to-link" data-target="content-errors">
|
||||
<a>Errors</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<body class="one-content-column-version">
|
||||
<div class="left-menu">
|
||||
<div class="content-logo">
|
||||
<div class="logo">
|
||||
<img alt="platform by Emily van den Heever from the Noun Project"
|
||||
title="platform by Emily van den Heever from the Noun Project" src="images/apilogo.png"
|
||||
height="32" />
|
||||
<span>API Documentation</span>
|
||||
</div>
|
||||
<button class="burger-menu-icon" id="button-menu-mobile">
|
||||
<svg width="34" height="34" viewBox="0 0 100 100">
|
||||
<path class="line line1"
|
||||
d="M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331 94.543142,77.980673 90.966081,81.670246 85.259173,81.668997 79.552261,81.667751 75.000211,74.999942 75.000211,74.999942 L 25.000021,25.000058">
|
||||
</path>
|
||||
<path class="line line2" d="M 20,50 H 80"></path>
|
||||
<path class="line line3"
|
||||
d="M 20,70.999954 H 80.000231 C 80.000231,70.999954 94.498839,71.182648 94.532987,33.288669 94.543142,22.019327 90.966081,18.329754 85.259173,18.331003 79.552261,18.332249 75.000211,25.000058 75.000211,25.000058 L 25.000021,74.999942">
|
||||
</path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mobile-menu-closer"></div>
|
||||
<div class="content-menu">
|
||||
<div class="content-infos">
|
||||
<div class="info"><b>Version:</b> 0</div>
|
||||
<div class="info"><b>Last Updated:</b> 22th January 2024</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="scroll-to-link active" data-target="content-get-started">
|
||||
<a>GET STARTED</a>
|
||||
</li>
|
||||
<li class="scroll-to-link" data-target="content-errors">
|
||||
<a>Errors</a>
|
||||
</li>
|
||||
<li class="scroll-to-link" data-target="content-get-api">
|
||||
<a>Generate API</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<div class="overflow-hidden content-section" id="content-get-started">
|
||||
<h1>Get started</h1>
|
||||
<p>
|
||||
The following API is provided by the Eco saver developer team. It allows you to get Location and
|
||||
Sensor and Sensor Data from the Eco saver database.
|
||||
</p>
|
||||
<p>
|
||||
To use this API, you need an <strong>API key</strong>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-get-location">
|
||||
<h2>Get all location</h2>
|
||||
<p>
|
||||
To get Location of sensors you need to make a GET call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) Example: curl https://api.teeseng.uk/api/v0/location -H "Authorization:
|
||||
{provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-get-location-by-id">
|
||||
<h2>Get location by ID</h2>
|
||||
<p>
|
||||
To get Location you need to make a GET call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/{id}</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>(Required) Your API key.</td>
|
||||
<td>Example: curl https://api.teeseng.uk/api/v0/location -H "Authorization: {provide
|
||||
your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-add-location">
|
||||
<h2>Add Location (Only for system or admin API key)</h2>
|
||||
<p>
|
||||
To add an Location you need to make a POST call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/new</code>
|
||||
<br>
|
||||
<br>
|
||||
Example :<br>
|
||||
<code
|
||||
class="higlighted break-word">curl https://api.teeseng.uk/api/v0/location/new -H "Content-Type: application/json" -X POST -d '{"name": "SAMPLE", "added_by": "system" , "description": "test"}'</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) Example: curl https://api.teeseng.uk/api/v0/location/new -H
|
||||
"Authorization: {provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location name</td>
|
||||
<td>JSON</td>
|
||||
<td>Location name.</td>
|
||||
<td>(Required) Location name. Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"name":"Location name"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Added by </td>
|
||||
<td>JSON</td>
|
||||
<td>System or Admin</td>
|
||||
<td>(Required) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"added_by":"system"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>JSON</td>
|
||||
<td>Description of Location</td>
|
||||
<td>(Required) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"description":"test"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- update -->
|
||||
<div class="overflow-hidden content-section" id="content-update-location-by-id">
|
||||
<h2>Update Location (Only for system or admin API key)</h2>
|
||||
<p>
|
||||
To update an Location you need to make a PUT call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/update</code>
|
||||
<br>
|
||||
<br>
|
||||
Example :<br>
|
||||
<code
|
||||
class="higlighted break-word">curl https://api.teeseng.uk/api/v0/location/update -H "Content-Type: application/json" -X POST -d '{"id": "7" , "name": "SAMPLE", "added_by": "system" , "description": "test"}'</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200","message":"Location 7 updated"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) example: curl https://api.teeseng.uk/api/v0/location/update -H
|
||||
"Authorization: {provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>JSON</td>
|
||||
<td>Location ID</td>
|
||||
<td>(Required) Location ID Example: curl https://api.teeseng.uk/api/v0/location/update
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"id": "7"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location name</td>
|
||||
<td>JSON</td>
|
||||
<td>Location name.</td>
|
||||
<td>(Optional) Location name. Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"name":"Location name"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Added by </td>
|
||||
<td>JSON</td>
|
||||
<td>System or Admin</td>
|
||||
<td>(Optional) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"added_by":"system"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>JSON</td>
|
||||
<td>Description of Location</td>
|
||||
<td>(Optional) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"description":"test"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- delete location -->
|
||||
<div class="overflow-hidden content-section" id="content-update-location-by-id">
|
||||
<h2>Delete Location (Only for system or admin API key)</h2>
|
||||
<p>
|
||||
To delete an Location you need to make a DELETE call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/delete</code>
|
||||
<br>
|
||||
<br>
|
||||
Example :<br>
|
||||
<code
|
||||
class="higlighted break-word">curl https://api.teeseng.uk/api/v0/location/delete -H "Content-Type: application/json" -X POST -d '{"id": "7"}'</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) example: curl https://api.teeseng.uk/api/v0/location/delete -H
|
||||
"Authorization: {provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>JSON</td>
|
||||
<td>Location ID</td>
|
||||
<td>(Required) Location ID Example: curl https://api.teeseng.uk/api/v0/location/delete
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"id": "7"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<div class="overflow-hidden content-section" id="content-get-started">
|
||||
<h1>Get started</h1>
|
||||
<p>
|
||||
The following API is provided by the Eco saver developer team. It allows you to get Location and
|
||||
Sensor and Sensor Data from the Eco saver database.
|
||||
</p>
|
||||
<p>
|
||||
To use this API, you need an <strong>API key</strong>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-get-location">
|
||||
<h2>Get all location</h2>
|
||||
<p>
|
||||
To get Location of sensors you need to make a GET call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) Example: curl https://api.teeseng.uk/api/v0/location -H "Authorization:
|
||||
{provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-get-location-by-id">
|
||||
<h2>Get location by ID</h2>
|
||||
<p>
|
||||
To get Location you need to make a GET call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/{id}</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>(Required) Your API key.</td>
|
||||
<td>Example: curl https://api.teeseng.uk/api/v0/location -H "Authorization: {provide
|
||||
your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-add-location">
|
||||
<h2>Add Location (Only for system or admin API key)</h2>
|
||||
<p>
|
||||
To add an Location you need to make a POST call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/new</code>
|
||||
<br>
|
||||
<br>
|
||||
Example :<br>
|
||||
<code
|
||||
class="higlighted break-word">curl https://api.teeseng.uk/api/v0/location/new -H "Content-Type: application/json" -X POST -d '{"name": "SAMPLE", "added_by": "system" , "description": "test"}'</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) Example: curl https://api.teeseng.uk/api/v0/location/new -H
|
||||
"Authorization: {provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location name</td>
|
||||
<td>JSON</td>
|
||||
<td>Location name.</td>
|
||||
<td>(Required) Location name. Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"name":"Location name"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Added by </td>
|
||||
<td>JSON</td>
|
||||
<td>System or Admin</td>
|
||||
<td>(Required) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"added_by":"system"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>JSON</td>
|
||||
<td>Description of Location</td>
|
||||
<td>(Required) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"description":"test"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- update -->
|
||||
<div class="overflow-hidden content-section" id="content-update-location-by-id">
|
||||
<h2>Update Location (Only for system or admin API key)</h2>
|
||||
<p>
|
||||
To update an Location you need to make a PUT call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/update</code>
|
||||
<br>
|
||||
<br>
|
||||
Example :<br>
|
||||
<code
|
||||
class="higlighted break-word">curl https://api.teeseng.uk/api/v0/location/update -H "Content-Type: application/json" -X POST -d '{"id": "7" , "name": "SAMPLE", "added_by": "system" , "description": "test"}'</code>
|
||||
<br>
|
||||
<br>
|
||||
Return Response :<br>
|
||||
<code class="higlighted break-word">{"status":"200","message":"Location 7 updated"}</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) example: curl https://api.teeseng.uk/api/v0/location/update -H
|
||||
"Authorization: {provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>JSON</td>
|
||||
<td>Location ID</td>
|
||||
<td>(Required) Location ID Example: curl https://api.teeseng.uk/api/v0/location/update
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"id": "7"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location name</td>
|
||||
<td>JSON</td>
|
||||
<td>Location name.</td>
|
||||
<td>(Optional) Location name. Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"name":"Location name"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Added by </td>
|
||||
<td>JSON</td>
|
||||
<td>System or Admin</td>
|
||||
<td>(Optional) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"added_by":"system"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>JSON</td>
|
||||
<td>Description of Location</td>
|
||||
<td>(Optional) System or Admin Example: curl https://api.teeseng.uk/api/v0/location/new
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"description":"test"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- delete location -->
|
||||
<div class="overflow-hidden content-section" id="content-update-location-by-id">
|
||||
<h2>Delete Location (Only for system or admin API key)</h2>
|
||||
<p>
|
||||
To delete an Location you need to make a DELETE call to the following url :<br>
|
||||
<code class="higlighted break-word">https://api.teeseng.uk/api/v0/location/delete</code>
|
||||
<br>
|
||||
<br>
|
||||
Example :<br>
|
||||
<code
|
||||
class="higlighted break-word">curl https://api.teeseng.uk/api/v0/location/delete -H "Content-Type: application/json" -X POST -d '{"id": "7"}'</code>
|
||||
</p>
|
||||
<br>
|
||||
<h4>QUERY PARAMETERS</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Authorization</td>
|
||||
<td>JSON</td>
|
||||
<td>Your API key.</td>
|
||||
<td>(Required) example: curl https://api.teeseng.uk/api/v0/location/delete -H
|
||||
"Authorization: {provide your
|
||||
API key here}"</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>JSON</td>
|
||||
<td>Location ID</td>
|
||||
<td>(Required) Location ID Example: curl https://api.teeseng.uk/api/v0/location/delete
|
||||
-H "Authorization: provide
|
||||
your API key here" -d '{"id": "7"}'</td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden content-section" id="content-errors">
|
||||
<h2>Errors</h2>
|
||||
<p>
|
||||
The Westeros API uses the following error codes:
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Error Code</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>X000</td>
|
||||
<td>
|
||||
Some parameters are missing. This error appears when you don't pass every mandatory
|
||||
parameters.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>403</td>
|
||||
<td>
|
||||
Unknown or unvalid <code class="higlighted">secret_key</code>. This error appears if
|
||||
you use an unknow API key or if your API key expired.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>500</td>
|
||||
<td>
|
||||
Unvalid <code class="higlighted">secret_key</code> No API key was supplied. Invalid
|
||||
request.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>X003</td>
|
||||
<td>
|
||||
Unknown or unvalid user <code class="higlighted">token</code>. This error appears if
|
||||
you use an unknow user <code class="higlighted">token</code> or if the user <code
|
||||
class="higlighted">token</code> expired.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-get-api">
|
||||
<div class="api-keys-header">
|
||||
<h2>API Keys</h2>
|
||||
<button class="generate-key-button">Generate Key</button>
|
||||
<p>
|
||||
You can generate API Keys here:
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Public Key</th>
|
||||
<th>Private Key</th>
|
||||
<th>Key Type</th>
|
||||
<th>Created</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>API Key</td>
|
||||
<td>GR234-We34</td>
|
||||
<td>greR-234-fEG</td>
|
||||
<td>Type</td>
|
||||
<td>2024-01-22</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="overflow-hidden content-section" id="content-errors">
|
||||
<h2>Errors</h2>
|
||||
<p>
|
||||
The Westeros API uses the following error codes:
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Error Code</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>X000</td>
|
||||
<td>
|
||||
Some parameters are missing. This error appears when you don't pass every mandatory
|
||||
parameters.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>403</td>
|
||||
<td>
|
||||
Unknown or unvalid <code class="higlighted">secret_key</code>. This error appears if
|
||||
you use an unknow API key or if your API key expired.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>500</td>
|
||||
<td>
|
||||
Unvalid <code class="higlighted">secret_key</code> No API key was supplied. Invalid
|
||||
request.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>X003</td>
|
||||
<td>
|
||||
Unknown or unvalid user <code class="higlighted">token</code>. This error appears if
|
||||
you use an unknow user <code class="higlighted">token</code> or if the user <code
|
||||
class="higlighted">token</code> expired.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="overflow-hidden content-section" id="content-get-api">
|
||||
<div class="api-keys-header">
|
||||
<h2>API Keys</h2>
|
||||
<div class="button-container">
|
||||
<button class="generate-key-button" onclick="generateKey()">Generate Key</button>
|
||||
<button class="delete-key-button" onclick="deleteKeys()">Delete Keys</button>
|
||||
</div>
|
||||
<p>
|
||||
You can generate API Keys here:
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Public Key</th>
|
||||
<th>Private Key</th>
|
||||
<th>Created</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>API Key</td>
|
||||
<td>GR234-We34</td>
|
||||
<td>greR-234-fEG</td>
|
||||
<td>2024-01-22</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script src="js/api.js"></script>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script src="js/api.js"></script>
|
||||
<script src="js/apikey.js"></script>
|
||||
|
||||
</html>
|
||||
|
@ -82,6 +82,9 @@
|
||||
</div>
|
||||
</footer>
|
||||
<script src="js/search.js"></script>
|
||||
<script src="js/data.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -38,7 +38,11 @@
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<script src="js/learnmore.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
|
||||
<%- include('bot') %>
|
||||
|
48
consumerWebsite/views/test.html
Normal file
48
consumerWebsite/views/test.html
Normal file
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PM2.5 Sub-Index Over Time</title>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="pm25Chart"></canvas>
|
||||
|
||||
<script>
|
||||
const ctx = document.getElementById('pm25Chart').getContext('2d');
|
||||
|
||||
const pm25Data = [37, 38, 39, 40, 41, 39, 38];
|
||||
const timestamps = ["4pm", "7pm", "11pm", "3am", "7am", "11am", "3pm"];
|
||||
|
||||
const myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: timestamps,
|
||||
datasets: [{
|
||||
label: 'PM2.5 Sub-Index',
|
||||
data: pm25Data,
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
||||
borderColor: 'rgba(255, 99, 132, 1)',
|
||||
pointRadius: 5,
|
||||
pointHitRadius: 10,
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'PM2.5 Sub-Index Over Time'
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
43
consumerWebsite/views/viewdata.ejs
Normal file
43
consumerWebsite/views/viewdata.ejs
Normal file
@ -0,0 +1,43 @@
|
||||
<%- include('top') %>
|
||||
<link href="css/data.css" rel="stylesheet" />
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="air-quality-container">
|
||||
<%#
|
||||
<div class="graphbutton-container">
|
||||
<button id="barButton">Bar Graph</button>
|
||||
<button id="lineButton">Line Graph</button>
|
||||
</div> %>
|
||||
<div class="chart-container">
|
||||
<canvas id="dataChart"></canvas>
|
||||
</div>
|
||||
<div class="button-container">
|
||||
<button id="aqiButton">AQI</button>
|
||||
<button id="tempButton">Temperature</button>
|
||||
<button id="humButton">Humidity</button>
|
||||
<button id="pm25Button">PM2.5</button>
|
||||
<button id="pm10Button">PM10</button>
|
||||
<button id="o3Button">O3</button>
|
||||
<button id="no2Button">NO2</button>
|
||||
<button id="so2Button">SO2</button>
|
||||
<button id="coButton">CO</button>
|
||||
</div>
|
||||
<div class="download-container">
|
||||
<p>Download data here:</p>
|
||||
<button id="downloadCSVButton">Download CSV</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<%- include('bot') %>
|
Reference in New Issue
Block a user