Ostrom Auth API

Describe how to authenticate in the api

OpenAPI Specification

ostrom-auth-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Ostrom Auth API
  version: '2023-11-01'
  description: 'The Ostrom API is designed to allow our customer and partners to develop apps that integrates with our smart energy management platform. The API has a RESTful architecture and utilizes OAuth2 authorization.

    '
  license:
    name: Ostrom Commercial License
    url: https://ostrom.de
servers:
- url: https://sandbox.ostrom-api.io
  description: Sandbox environment (test data)
- url: https://production.ostrom-api.io
  description: Production environment (live data)
- url: https://auth.sandbox.ostrom-api.io
  description: Authentication sandbox environment (generate access token - test data)
- url: https://auth.production.ostrom-api.io
  description: Authentication production environment (generate access token - live data)
tags:
- name: Auth
  description: Describe how to authenticate in the api
paths:
  /oauth2/token:
    post:
      tags:
      - Auth
      operationId: createOAuth2Token
      summary: Obtain OAuth2 Access Token
      description: 'Allowed role: `USER` or `PARTNER`'
      servers:
      - url: https://auth.sandbox.ostrom-api.io
        description: Authentication sandbox environment (generate access token - test data)
      - url: https://auth.production.ostrom-api.io
        description: Authentication production environment (generate access token - live data)
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - grant_type
              properties:
                grant_type:
                  type: string
                  description: The Oauth grant type (e.g. client_credentials)
      responses:
        '200':
          description: Successful token acquisition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuth2TokenResponse'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuth2TokenError400'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuth2TokenError401'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestError429'
      security:
      - OAuth2BasicAuth: []
components:
  schemas:
    OAuth2TokenError400:
      type: object
      properties:
        error:
          type: string
          description: The type of the error
        error_description:
          type: string
          description: A human-readable message providing more details about the error
      example:
        error: invalid_request
        error_description: The request is missing a required parameter, includes an invalid parameter value, or is otherwise malformed.
    OAuth2TokenResponse:
      type: object
      properties:
        access_token:
          type: string
          description: The access token to use for authentication
        expires_in:
          type: integer
          description: The number of seconds until the token expires
        token_type:
          type: string
          description: The type of the token
      example:
        access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6I...
        expires_in: 3600
        token_type: Bearer
    TooManyRequestError429:
      type: object
      properties:
        type:
          type: string
          description: The type of the error
        detail:
          type: string
          description: A human-readable message providing more details about the error
      example:
        type: too_many_requests
        detail: API request limit per minute has been reached. Please try again later.
    OAuth2TokenError401:
      type: object
      properties:
        error:
          type: string
          description: The type of the error
        error_description:
          type: string
          description: A human-readable message providing more details about the error
      example:
        error: invalid_client
        error_description: Client authentication failed (e.g., unknown client or unsupported authentication method).
  securitySchemes:
    ClientAccessToken:
      type: oauth2
      description: 'A `ClientAccessToken` is obtained via the [OAuth 2.0 Client Credentials grant](https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/) and carries authorization to access all functionalities and data in your Ostrom account. Full details at [The ClientAccessToken](/api/reference#getting-an-access-token)

        '
      flows:
        clientCredentials:
          tokenUrl: https://auth.sandbox.ostrom-api.io/oauth2/token
          scopes: {}
    OAuth2BasicAuth:
      type: http
      scheme: basic