openapi: 3.1.0
info:
  title: BeMap Sandbox
  version: 1.0.0
  description: >
    Documentation for the BeMap API, including authentication and routing
    services.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://bemap-beta.benomad.com
    description: Beta environment
  - url: https://bemap-preprod.benomad.com
    description: Preproduction environment
  - url: https://bemap-prod.benomad.com
    description: Production environment
paths:
  /bgis/bnd:
    get:
      tags:
        - Authentication
      operationId: authenticateWithQueryParams
      summary: Authenticate using URL parameters
      parameters:
        - name: appid
          in: query
          required: true
          schema:
            type: string
        - name: appcode
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Authenticated
          headers:
            Set-Cookie:
              description: SESSION or JSESSIONID cookie to reuse session
              schema:
                type: string
        '401':
          description: Authentication failed
    post:
      tags:
        - Authentication
      operationId: authenticateWithBasicAuth
      summary: Authenticate using HTTP basic authorization
      requestBody:
        required: false
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                appid:
                  type: string
                appcode:
                  type: string
      responses:
        '200':
          description: Successful authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Authenticated
          headers:
            Set-Cookie:
              description: SESSION or JSESSIONID cookie to reuse session
              schema:
                type: string
        '401':
          description: Authentication failed
      security:
        - basicAuth: []
  /bgis/service/routing/1.0:
    post:
      tags:
        - Routing
      operationId: computeRoute
      summary: Computes a route through the road network
      description: >-
        Performs route, isochrone or matrix calculation based on coordinates and
        vehicle profile.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoutingRequest'
      responses:
        '200':
          description: >
            Route successfully calculated. The response includes a set of path
            segments and metadata such as duration, distance, and waypoints.
          content:
            application/json:
              example:
                route:
                  duration: 320
                  distance: 7500
                  segments:
                    - ...
        '400':
          description: Invalid input
        '500':
          description: Server error
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    RoutingRequest:
      type: object
      properties:
        destinations:
          type: array
          items:
            $ref: '#/components/schemas/RoutingDest'
        routingVehicleProfile:
          $ref: '#/components/schemas/RoutingVehicleProf'
        routingEnergyVehicleFeature:
          $ref: '#/components/schemas/RoutingEnergyVehicleFeature'
        routingSpeedPonderations:
          type: array
          items:
            $ref: '#/components/schemas/RoutingSpeedPond'
        routingCriterias:
          type: array
          items:
            type: string
        routingMode:
          type: string
          enum:
            - MODE_VIAS
            - MODE_MATRIX
            - MODE_ISOCHRONE
            - MODE_N_TO_N
            - MODE_1_TO_N
        outputLanguage:
          type: string
          example: fr
        options:
          type: array
          items:
            type: string
    RoutingDest:
      type: object
      properties:
        coordinateSat:
          type: object
          properties:
            lon:
              type: number
            lat:
              type: number
    RoutingVehicleProf:
      type: object
      properties:
        transportMode:
          type: string
          enum:
            - CAR
            - TRUCK
            - BICYCLE
            - MOTORCYCLE
            - EMERGENCY
            - PEDESTRIAN
            - PUBLIC_BUS
            - TAXI
        routingVehicleFeature:
          $ref: '#/components/schemas/RoutingVehicleFtr'
    RoutingVehicleFtr:
      type: object
      properties:
        height:
          type: integer
        width:
          type: integer
        length:
          type: integer
        weight:
          type: integer
        axleWeight:
          type: integer
        adrTunnelCategory:
          type: string
        caravan:
          type: string
        cial:
          type: string
        disEquipped:
          type: string
        emissionClass:
          type: string
        hazardousMaterials:
          type: string
        hov:
          type: string
        hybrid:
          type: string
        nbPassengers:
          type: integer
        nbTires:
          type: integer
        nbTrailAxles:
          type: integer
        nbTrailer:
          type: integer
        nbVehAxles:
          type: integer
        onlyPhysical:
          type: boolean
        pollMin:
          type: string
        tollTransportCategory:
          type: string
        trailHeight:
          type: integer
        vehHeight:
          type: integer
        vehWeight:
          type: integer
    RoutingEnergyVehicleFeature:
      type: object
      properties:
        auxConsumption:
          type: number
        batCapacity:
          type: number
        crr:
          type: number
        engineEfficiency:
          type: number
        payload:
          type: number
        recuperation:
          type: number
        scx:
          type: number
        temperature:
          type: number
        userSpeed:
          type: number
        windDirection:
          type: number
        windSpeed:
          type: number
    RoutingSpeedPond:
      type: object
      properties:
        factor:
          type: number
          default: 1
        level:
          type: integer
        pondType:
          type: string
        roadType:
          type: string
security:
  - basicAuth: []
tags:
  - name: Authentication
    description: Operations related to BeMap authentication process
  - name: Routing
    description: Route, isochrone, and matrix computations
