API docs for alerts #17

This commit is contained in:
Ian Renton
2025-10-05 15:02:27 +01:00
parent 3bea7245f7
commit 186322a6b0

View File

@@ -179,6 +179,81 @@ paths:
$ref: '#/components/schemas/Spot' $ref: '#/components/schemas/Spot'
/alerts:
get:
tags:
- alerts
summary: Get alerts
description: Retrieves alerts (indications of upcoming activations) from the system. Supply this with no query parameters to retrieve all alerts known to the system. Supply query parameters to filter what is retrieved.
operationId: spots
parameters:
- name: limit
in: query
description: Limit the number of alerts in the response
required: false
schema:
type: integer
- name: received_since
in: query
description: Limit the spots to only ones that the system found out about at this time or later. Time in UTC seconds since UNIX epoch. If you are using a front-end that tracks the last time it queried the API and requests spots since then, you want *this* version of the query parameter, not "since", because otherwise it may miss things. The logic is "greater than" rather than "greater than or equal to", so you can submit the time of the last received item back to this call and you will get all the more recent spots back, without duplicating the previous latest spot.
required: false
schema:
type: integer
- name: source
in: query
description: "Limit the spots to only ones from one or more sources. To select more than one source, supply a comma-separated list."
required: false
schema:
type: string
enum:
- POTA
- SOTA
- WWFF
- WWBOTA
- GMA
- HEMA
- ParksNPeaks
- Cluster
- RBN
- APRS-IS
- name: sig
in: query
description: "Limit the spots to only ones from one or more Special Interest Groups. To select more than one SIG, supply a comma-separated list."
required: false
schema:
type: string
enum:
- POTA
- SOTA
- WWFF
- WWBOTA
- GMA
- HEMA
- name: dx_continent
in: query
description: "Limit the spots to only ones where the DX (the operator being spotted) is on the given continent(s). To select more than one continent, supply a comma-separated list."
required: false
schema:
type: string
enum:
- EU
- NA
- SA
- AS
- AF
- OC
- AN
responses:
'200':
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Alert'
/status: /status:
get: get:
tags: tags:
@@ -499,10 +574,18 @@ components:
type: number type: number
description: Time of the spot, UTC seconds since UNIX epoch description: Time of the spot, UTC seconds since UNIX epoch
example: 1759579508 example: 1759579508
time_iso:
type: string
description: Time of the spot, ISO 8601
example: "2025-10-05T12:34:56.789Z"
received_time: received_time:
type: number type: number
description: Time that this software received the spot, UTC seconds since UNIX epoch. This is used with the "since_received" call to our API to receive all data that is new to us, even if by a quirk of the API it might be older than the list time the client polled the API. description: Time that this software received the spot, UTC seconds since UNIX epoch. This is used with the "since_received" call to our API to receive all data that is new to us, even if by a quirk of the API it might be older than the list time the client polled the API.
example: 1759579508 example: 1759579508
received_time_iso:
type: string
description: Time that this software received the spot, ISO 8601
example: "2025-10-05T12:34:56.789Z"
comment: comment:
type: string type: string
description: Comment left by the spotter, if any description: Comment left by the spotter, if any
@@ -587,6 +670,137 @@ components:
description: The ID the source gave it, if any. description: The ID the source gave it, if any.
example: "GUID-123456" example: "GUID-123456"
Alert:
type: object
properties:
id:
type: integer
description: Unique identifier based on a hash of the alert to distinguish this one from any others.
example: 123987609816349182
dx_call:
type: string
description: Callsign of the operator that is going to be activating
example: M0TRT
dx_name:
type: string
description: Name of the operator that is going to be activating
example: Ian
dx_country:
type: string
description: Country of the DX operator
example: United Kingdom
dx_flag:
type: string
description: Country flag of the DX operator
example: ""
dx_continent:
type: string
description: Continent of the DX operator
enum:
- EU
- NA
- SA
- AS
- AF
- OC
- AN
example: EU
dx_dxcc_id:
type: integer
description: DXCC ID of the DX operator
example: 235
dx_cq_zone:
type: integer
description: CQ zone of the DX operator
example: 27
dx_itu_zone:
type: integer
description: ITU zone of the DX operator
example: 14
freqs_modes:
type: string
description: An indication of the frequencies and modes that the activation will use, if provided.
example: "7-ssb 14-ssb maybe 145-fm"
start_time:
type: number
description: Time that the activation is expected to start, UTC seconds since UNIX epoch
example: 1759579508
start_time_iso:
type: string
description: Time that the activation is expected to start, ISO 8601
example: "2025-10-05T12:34:56.789Z"
end_time:
type: number
description: Time that the activation is expected to star, UTC seconds since UNIX epoch
example: 1759579508
end_time_iso:
type: string
description: Time that the activation is expected to star, ISO 8601
example: "2025-10-05T12:34:56.789Z"
received_time:
type: number
description: Time that this software received the alert, UTC seconds since UNIX epoch. This is used with the "since_received" call to our API to receive all data that is new to us, even if by a quirk of the API it might be older than the list time the client polled the API.
example: 1759579508
received_time_iso:
type: string
description: Time that this software received the alert, ISO 8601
example: "2025-10-05T12:34:56.789Z"
comment:
type: string
description: Comment made by the activator, if any
example: "2025 DXpedition to null island"
sig:
type: string
description: Special Interest Group (SIG), e.g. outdoor activity programme such as POTA
enum:
- POTA
- SOTA
- WWFF
- WWBOTA
- GMA
- HEMA
example: POTA
sig_refs:
type: array
items:
type: string
description: SIG references. We allow multiple here for e.g. n-fer activations, unlike ADIF SIG_INFO
example: GB-0001
sig_refs_names:
type: array
items:
type: string
description: SIG reference names
example: Null Country Park
activation_score:
type: integer
description: Activation score. SOTA only
example: 0
icon:
type: string
descripton: Icon, from the Font Awesome set. This is fairly opinionated but is here to help the Spothole web UI and Field Spotter. Does not include the "fa-" prefix.
example: tree
source:
type: string
description: Where we got the alert from.
enum:
- POTA
- SOTA
- WWFF
- WWBOTA
- GMA
- HEMA
- ParksNPeaks
- Cluster
- RBN
- APRS-IS
example: POTA
source_id:
type: string
description: The ID the source gave it, if any.
example: "GUID-123456"
SpotProviderStatus: SpotProviderStatus:
type: object type: object
properties: properties: