openapi: 3.0.0
info:
  title: auraline incoming api to aura bridge
  description: Set of endpoints related to bridge auraline incoming
  version: 1.0.0
tags:
  - name: auraline
    description: Bridge auraline incoming plugin
servers:
  - url: 'http://localhost:8045'
    description: Local server
  - url: 'https://svc-ap-current.auracognitive.com'
    description: ap-current
paths:
  /aura-services/v1/auraline/conversations/{conversationId}/activities:
    post:
      security:
        - ApiKeyHeaderAuth: [ ]
      parameters:
        - name: correlator
          in: header
          description: correlator to identify the request
          required: false
          schema:
            type: string
        - name: conversationId
          in: path
          description: Conversation identifier
          required: true
          schema:
            type: string
      description: Send a message to a conversation
      operationId: postAuralineMessages
      x-router-controller: plugins
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuralineActivity'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityPostResponse'
        '400':
          description: The URL, body, or headers in the request are malformed or invalid.
        '401':
          description: The operation includes an invalid or missing Authorization header.
        '500':
          description: There is an unexpected error while processing the request.
  /aura-services/v1/auraline/conversations/{conversationId}/activities/{activityId}/status:
    post:
      security:
        - ApiKeyHeaderAuth: [ ]
      parameters:
        - name: correlator
          in: header
          description: correlator to identify the request
          required: false
          schema:
            type: string
        - name: conversationId
          in: path
          description: Conversation identifier
          required: true
          schema:
            type: string
        - name: activityId
          in: path
          description: Message identifier
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuralineStatusList'
      description: Send status from a received message
      operationId: postAuralineStatus
      x-router-controller: plugins
      responses:
        '200':
          description: OK
        '400':
          description: The URL, body, or headers in the request are malformed or invalid.
        '401':
          description: The operation includes an invalid or missing Authorization header.
        '500':
          description: There is an unexpected error while processing the request.
components:
  securitySchemes:
    ApiKeyHeaderAuth:
      type: apiKey
      in: header     # can be "header", "query" or "cookie"
      name: Authorization
  schemas:
    AuralineActivity:
      description: An Activity is the basic communication type for the Auraline protocol.
      type: object
      required:
        - locale
        - type
        - text
        - from
        - channelData
      properties:
        type:
          description: Contains the activity type.
          type: string
        from:
          description: Identifies the sender of the message.
          type: object
          properties:
            id:
              description: AuraId of the user that sends the message
              type: string
            name:
              description: Display friendly name
              type: string
        locale:
          description: "A locale name for the contents of the text field.\r\nThe locale
            name is a combination of an ISO 639 two- or three-letter culture code associated
            with a language\r\nand an ISO 3166 two-letter subculture code associated with
            a country or region.\r\nThe locale name can also correspond to a valid BCP-47
            language tag."
          type: string
        text:
          description: The text content of the message.
          type: string
        channelData:
          description: Contains channel-specific content.
          $ref: '#/components/schemas/AuralineChannelDataIncoming'
    AuralineStatusList:
      description: List of status of a received message in callback
      type: array
      items:
        type: object
        required:
          - id
          - status
        properties:
          id:
            description: Message id
            type: string
          status:
            description: Status of the message
            type: string
            enum:
              - delivered
              - failed
          description:
            description: Description of the status
            type: string
    ActivityPostResponse:
      description: Response to an activity post
      type: object
      required:
        - id
      properties:
        id:
          description: Activity id
          type: string
    AuralineChannelDataIncoming:
      description: Contains channel-specific content.
      type: object
      required:
        - version
        - appContext
      properties:
        correlator:
          description: Request correlator. Must be the same as the one sent in the request headers if sent. If both are different, the request will be rejected.
          type: string
        version:
          description: version of channelData.
          type: string
        appContext:
          description: contains context of app
          type: object
          required:
            - channel
          properties:
            channel:
              description: channel information.
              type: object
              required:
                - id
              properties:
                id:
                  description: channel identifier.
                  type: string
