This document provides a comprehensive guide to the Spying API, detailing its functionalities and how to interact with it.
This API uses JSON for both request and response bodies. It requires Basic Auth for authentication (details in the Security section).
Base URL: http://127.0.0.1:8000/api
The Spying API utilizes Basic Authentication for access control. You will need to provide a username and password in the authorization header of your requests.
- GET /data/: Retrieves a list of data objects.
- Response: Array of
Data
objects (see Data Model definition).
- Response: Array of
- POST /data/: Creates a new data object.
- Request Body: JSON object representing the new
Data
object (see Data Model definition). - Response: The created
Data
object.
- Request Body: JSON object representing the new
- GET /data/{id}/: Retrieves a specific data object by its ID.
- Path Parameter:
id
(integer) - Unique identifier of the data object. - Response: The
Data
object with the corresponding ID.
- Path Parameter:
- PUT /data/{id}/: Updates a data object completely.
- Path Parameter:
id
(integer) - Unique identifier of the data object. - Request Body: JSON object representing the updated
Data
object (see Data Model definition). - Response: The updated
Data
object.
- Path Parameter:
- PATCH /data/{id}/: Updates a data object partially.
- Path Parameter:
id
(integer) - Unique identifier of the data object. - Request Body: JSON object containing the properties to be updated (see Data Model definition).
- Response: The updated
Data
object.
- Path Parameter:
- DELETE /data/{id}/: Deletes a data object.
- Path Parameter:
id
(integer) - Unique identifier of the data object to be deleted. - Response: No content (status code 204).
- Path Parameter:
- GET /gps/: Retrieves a list of GPS points.
- Optional Query Parameter:
ordering
(string) - Field to use for ordering results (e.g., "latitude", "longitude"). - Response: Array of
GpsPoint
objects (see GPS Point Model definition).
- Optional Query Parameter:
- POST /gps/: Creates a new GPS point.
- Request Body: JSON object representing the new
GpsPoint
object (see GPS Point Model definition). - Response: The created
GpsPoint
object.
- Request Body: JSON object representing the new
- GET /gps/{id}/: Retrieves a specific GPS point by its ID.
- Path Parameter:
id
(integer) - Unique identifier of the GPS point. - Response: The
GpsPoint
object with the corresponding ID.
- Path Parameter:
- PUT /gps/{id}/: Updates a GPS point completely.
- Path Parameter:
id
(integer) - Unique identifier of the GPS point. - Request Body: JSON object representing the updated
GpsPoint
object (see GPS Point Model definition). - Response: The updated
GpsPoint
object.
- Path Parameter:
- PATCH /gps/{id}/: Updates a GPS point partially.
- Path Parameter:
id
(integer) - Unique identifier of the GPS point. - Request Body: JSON object containing the properties to be updated (see GPS Point Model definition).
- Response: The updated
GpsPoint
object.
- Path Parameter:
- DELETE /gps/{id}/: Deletes a GPS point.
- Path Parameter:
id
(integer) - Unique identifier of the GPS point to be deleted. - Response: No content (status code 204).
- Path Parameter:
- id (integer, read-only): Unique identifier of the data object.
- cid (integer, nullable): An optional integer value associated with the data.
- message (string, max length 900, nullable): A message string associated with the data, with a maximum length of 900 characters.
- id (integer, read-only): Unique identifier of the GPS point.
- latitude (string, decimal format): Latitude coordinate of the GPS point.
- longitude (string, decimal format): Longitude coordinate of the GPS point.
- timestamp (string, date-time format, nullable): Optional timestamp associated with the GPS point.
- This API documentation is intended to provide a clear and comprehensive overview of the available functionalities.
- Consider including code samples for common use cases to further enhance developer experience.
- Error handling and specific