Endpoints
Endpoints
This section describes the available endpoints for the METI API. Each endpoint includes details on its usage, parameters, and examples to help you interact seamlessly with the API.
Base URL
All API requests should start with the following base URL:
Endpoints Overview
Source Management
GET /sources/?id={id}: Retrieve details of a single source by its ID.
POST /sources: Create a new source using GeoJSON data.
DELETE /sources/?id={id}: Delete a source by its ID.
Authentication
POST /token: Generate an authentication token.
GET /sources/?id={id}
Retrieve details of a source by its unique ID.
URL:
https://api.meti.millpont.com/sources/
?id={id}
Method: GET
Headers:
Authorization: <token>
Path Parameters:
{id}
(string): The unique ID of the source starting with 'src_'.
Example Request
POST /sources
Create a new source using GeoJSON data.
URL:
https://api.meti.millpont.com/sources
Method: POST
Headers:
Content-Type: application/json
Authorization: <token>
Body:
A valid GeoJSON FeatureCollection with:
id (string): Your internal ID (a SSID will also be assigned).
properties (object): Includes
start_at
andend_at
dates in ISO 8601 format.geometry (object): Must contain a valid Polygon.
Example Request
Example Response
DELETE /sources/?id={id}
Delete a source by its unique ID.
URL:
https://api.meti.millpont.com/sources/
?id={id}
Method: DELETE
Headers:
Authorization: <token>
Path Parameters:
{id}
(string): The unique ID of the source to delete.
Response:
message
(string): Confirmation of deletion.
Example Request
Example Response
Authentication Endpoint
POST /token
Generate an authentication token.
URL:
https://api.meti.millpont.com/token
Method: POST
Headers:
Content-Type: application/json
Body Parameters:
email
(string): Your registered email address.password
(string): Your account password.
Response:
token
(string): The authentication token.expires_in
(integer): Token validity period in seconds.
Example Request
Error Handling
Refer to the Error Handling section for details on common errors and their solutions.
Last updated