Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

API list

Arvid Sandin edited this page Mar 1, 2022 · 3 revisions

Send report

Adds a report to the database

Request

Request type: POST

Content-Type: application/x-www-form-urlencoded

URL: /send-report

Request body:

{
        longitude: number
        latitude: number
        auroraRating: integer 0-5
        userID: integer
}

Response

  • 200 OK:
    • true if report is added to the database
    • false otherwise
  • 400 Bad request. An error message is returned
  • 500 Server error. An error occured in the server. No further information is given.

Fetch reports

Get all the reports from the database posted in the last 6 hours

Request

Request type: GET

URL: /get-reports

Response

  • 200 OK. A list of the reports are returned. Each report contains the following data:
    "id": 11,
    timestamp: Datetime
    rating: number
    image: null
    latitude: number
    longitude: number
  • 500 Server error. An error occured in the server. No further information is given.

Fetch latest aurora overlay image

Get the latest overlay with aurora data

Request

Request type: GET

URL: /latest.png

Response

  • 200 OK. The image is returned
  • 404 Not found. The file latest.png does not exist at the moment