openapi: 3.0.0
info:
  version: 1.1.0
  title: ThingPark DX Location Geolocation API
  description: API providing geolocation services
externalDocs:
  description: For more information, please check the online examples in this documentation.
  url: '/location-geolocation/latest/doc/index.html'
tags:
  - name: GPSAlmanac
    description: Almanac operations are used to provide GPS Almanac data.
paths:
  /almanac:
    get:
      summary: Satellite GPS almanac data as JSON format retrieval
      description: Retrieve Satellite GPS almanac data.
      x-since-version: 1.0.0
      parameters:
        - in: query
          name: date
          description: The time of GPS almanac data to retrieve. Most recent almanac data before this time will be returned. ISO 8601 format
          schema:
            type: string
            format: date-time
          example: 2021-03-23T13:22:00+0100
      tags:
        - GPSAlmanac
      responses:
        '200':
          description: GPS Almanac data retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GpsAlmanacData'
        '400':
          description: Any error when processing the request
        '401':
          description: Unauthorized - invalid api key or user not authorized for access
        '404':
          description: Not found
      security:
        - bearerAuth: []
          Dx-Admin: []
          keycloak: []
servers:
  - url: '/location-geolocation/latest/api'
components:
  securitySchemes:
    bearerAuth:
      description: 'Enter your access token here without prefix "bearer " '
      type: http
      scheme: bearer
      bearerFormat: JWT
    keycloak:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: '/auth/realms/tpw-users-actility-tpe-ope/protocol/openid-connect/auth'
          scopes: {}
    Dx-Admin:
      type: oauth2
      description: |
        **This authorization is deprecated. Service account authentication should be used.**

        Enter your ThingPark credentials with dx-profile-id as prefix. 

        Example: dev1-api/test@abeeway.com
      flows:
        clientCredentials:
          tokenUrl: '/admin/latest/api/oauth/token'
          scopes: {}
  schemas:
    GpsAlmanacData:
      description: Resource representing GPS almanac data.
      properties:
        date:
          type: string
          description: Satellite GPS almanac data saved date.
        almanac:
          type: array
          description: Satellite almanac data.
          items:
            type: array
            items:
              type: number
              format: double
