Base Operations Public Charts API

The Public Charts API from Base Operations — 4 operation(s) for public charts.

OpenAPI Specification

base-operations-public-charts-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Customer API - Base Operations Analytics Public Charts API
  description: 'Welcome to the Base Operations Customer API! This API allows you to interact with our data and perform detailed analysis. In this documentation, we''ll explain how to use the API, including the available endpoints and the expected request bodies or query parameters.


    ### Authentication


    To use this API, you''ll need to authenticate using an API key. Please reach out to Base Operations to have an API key provisioned for your user. Once you have your API key, you can use it to authorize the Swagger docs.


    To authenticate on the Swagger docs, follow these steps:


    1.  Click on the "Authorize" button on the top right corner of the Swagger docs.

    2.  In the "Value" field, enter your API key.

    3.  Click "Authorize" to authenticate.


    ### Helpful Hints


    When using the API, you may see the following query parameters:


    - `savedLocationId`: This is an internal identifier for a saved location. You can acquire this identifier by using the `GET /v1/public/saved-locations` endpoint.


    - `categoryId`: This is an internal identifier for a threat category. You can acquire this identifier by using the `GET /v1/public/threat-categories` endpoint.<br><br>


    That''s it! You''re now authenticated and can start using the API. If you have any questions or issues, please contact Base Operations support.

    '
  version: '1.0'
  contact: {}
servers:
- url: https://api.baseoperationsenterprise.com/
tags:
- name: Public Charts
paths:
  /v1/public/charts/historical-analysis/day-of-week:
    get:
      operationId: PublicChartsController_getAverageDayOfWeek_v1
      parameters:
      - name: fromDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: toDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: types
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - crime
            - unrest
            - customer
            - uas_sighting
      - name: sourceIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: categoryIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: months
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: daytimes
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - morning
            - midmorning
            - afternoon
            - evening
            - night
      - name: isGTM
        required: false
        in: query
        schema:
          default: true
          type: boolean
      - name: locationId
        required: true
        in: query
        description: The ID of the location to retrieve chart data for
        schema:
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/HistoricalMonthlyChartDto'
                - properties:
                    chartData:
                      type: array
                      items:
                        $ref: '#/components/schemas/HistoricalDayOfWeekData'
            text/csv:
              schema:
                type: string
                example: 'day,threatCount,average,fromDate,toDate

                  1,621,12.94,2023-01-03,2023-01-09'
          description: ''
        '401':
          description: Unauthorized. Your API Key may be invalid or expired.
        '404':
          description: Location not found | Boundary not found | Saved Location not found
        '432':
          description: Not enough data available
        '500':
          description: Internal Server Error
      security:
      - ApiKey: []
      tags:
      - Public Charts
  /v1/public/charts/historical-analysis/time-of-day:
    get:
      operationId: PublicChartsController_getAverageTimeOfDay_v1
      parameters:
      - name: fromDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: toDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: types
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - crime
            - unrest
            - customer
            - uas_sighting
      - name: sourceIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: categoryIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: months
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: daytimes
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - morning
            - midmorning
            - afternoon
            - evening
            - night
      - name: isGTM
        required: false
        in: query
        schema:
          default: true
          type: boolean
      - name: locationId
        required: true
        in: query
        description: The ID of the location to retrieve chart data for
        schema:
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/HistoricalMonthlyChartDto'
                - properties:
                    chartData:
                      type: array
                      items:
                        $ref: '#/components/schemas/HistoricalTimeOfDaysData'
            text/csv:
              schema:
                type: string
                example: 'timeOfDay,threatCount,average,fromDate,toDate

                  1,621,12.94,2022-01-02,2022-01-02 23:59:59'
          description: ''
        '401':
          description: Unauthorized. Your API Key may be invalid or expired.
        '404':
          description: Location not found | Boundary not found | Saved Location not found
        '432':
          description: Not enough data available
        '500':
          description: Internal Server Error
      security:
      - ApiKey: []
      tags:
      - Public Charts
  /v1/public/charts/historical-analysis/monthly:
    get:
      operationId: PublicChartsController_getAverageMonthly_v1
      parameters:
      - name: fromDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: toDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: types
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - crime
            - unrest
            - customer
            - uas_sighting
      - name: sourceIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: categoryIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: months
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: daytimes
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - morning
            - midmorning
            - afternoon
            - evening
            - night
      - name: isGTM
        required: false
        in: query
        schema:
          default: true
          type: boolean
      - name: locationId
        required: true
        in: query
        description: The ID of the location to retrieve chart data for
        schema:
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/HistoricalMonthlyChartDto'
                - properties:
                    chartData:
                      type: array
                      items:
                        $ref: '#/components/schemas/HistoricalMonthlyData'
            text/csv:
              schema:
                type: string
                example: 'month,threatCount,average,fromDate,toDate

                  January,621,12.94,2022-01-01,2022-01-31'
          description: ''
        '401':
          description: Unauthorized. Your API Key may be invalid or expired.
        '404':
          description: Location not found | Boundary not found | Saved Location not found
        '432':
          description: Not enough data available
        '500':
          description: Internal Server Error
      security:
      - ApiKey: []
      tags:
      - Public Charts
  /v1/public/charts/event-breakdown:
    get:
      description: Calculates relationships between categories, subcategories, and time of day.
      operationId: PublicChartsController_getEventBreakdown_v1
      parameters:
      - name: fromDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: toDate
        required: true
        in: query
        schema:
          format: date-time
          type: string
      - name: types
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - crime
            - unrest
            - customer
            - uas_sighting
      - name: sourceIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: categoryIds
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: months
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: daytimes
        required: false
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - morning
            - midmorning
            - afternoon
            - evening
            - night
      - name: isGTM
        required: false
        in: query
        schema:
          default: true
          type: boolean
      - name: locationId
        required: true
        in: query
        description: The ID of the location to retrieve chart data for
        schema:
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ChartDto'
                - properties:
                    chartData:
                      type: array
                      items:
                        $ref: '#/components/schemas/SankeyData'
            text/csv:
              schema:
                type: string
                example: 'source,target,value

                  Theft,morning,16'
          description: ''
        '401':
          description: Unauthorized. Your API Key may be invalid or expired.
        '404':
          description: Location not found | Boundary not found | Saved Location not found
        '432':
          description: Not enough data available
        '500':
          description: Internal Server Error
      security:
      - ApiKey: []
      summary: Get Event Breakdown
      tags:
      - Public Charts
components:
  schemas:
    HistoricalMonthlyChartDto:
      type: object
      properties:
        chartData:
          type: object
        metadata:
          type: object
        fromDate:
          type: string
        toDate:
          type: string
      required:
      - chartData
    SankeyLink:
      type: object
      properties:
        source:
          type: string
        target:
          type: string
        value:
          type: number
      required:
      - source
      - target
      - value
    HistoricalMonthlyData:
      type: object
      properties:
        monthNumber:
          type: number
        month:
          type: string
        average:
          type: number
        threatType:
          type: string
      required:
      - monthNumber
      - month
      - average
    HistoricalTimeOfDaysData:
      type: object
      properties:
        timeOfDay:
          type: number
        average:
          type: number
        threatType:
          type: string
      required:
      - timeOfDay
      - average
    HistoricalDayOfWeekData:
      type: object
      properties:
        day:
          type: number
        average:
          type: number
        threatType:
          type: string
      required:
      - day
      - average
    SankeyData:
      type: object
      properties:
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/SankeyNode'
        links:
          type: array
          items:
            $ref: '#/components/schemas/SankeyLink'
      required:
      - nodes
      - links
    ChartDto:
      type: object
      properties:
        chartData:
          type: object
        metadata:
          type: object
      required:
      - chartData
    SankeyNode:
      type: object
      properties:
        id:
          oneOf:
          - type: number
          - type: string
        name:
          type: string
        type:
          type: string
        value:
          type: number
      required:
      - id
      - name
      - type
      - value
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-KEY