openapi: 3.0.1
info:
  title: Push Notification Channel Service API Specification
  description: The Push Notification REST Service provides API endpoints to send push
    notifications
  version: 1.0.118
servers:
- description: ''
  url: https://api.uat.btx.fr.banqup.com/platform/pushnotification
- description: ''
  url: https://api.uat.btx.eu.banqup.com/platform/pushnotification
paths:
  /v1/pushnotifications:
    post:
      tags:
      - Push notification channel
      summary: Sends push notification
      description: 'Sends push notification <br/> Scope: pushnotification_send<br/>
        This Endpoint is part of: push_notification'
      operationId: sendPushNotification
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PushNotification'
        required: true
      responses:
        '202':
          description: Push notification sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushNotificationResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 500
                error: INTERNAL
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Internal Server Error
                detail: The server encountered an unexpected error.
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '401':
          description: Unauthorized Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 401
                error: UNAUTHENTICATED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27T12:34:50Z
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
      security:
      - oauth2:
        - pushnotification_send
components:
  schemas:
    Notification:
      required:
      - body
      - title
      type: object
      properties:
        title:
          type: string
          description: The title of the notification
        body:
          type: string
          description: The body content of the notification
      description: Object containing notification details
    Option:
      required:
      - collapse
      - priority
      - ttl
      type: object
      properties:
        ttl:
          type: integer
          description: Time to live in seconds
          format: int32
        collapse:
          maxLength: 64
          minLength: 0
          type: string
          description: Collapse key for message deduplication
        priority:
          $ref: '#/components/schemas/Priority'
      description: Object containing additional data
    Priority:
      type: string
      description: Delivery priority
      example: NORMAL
      enum:
      - NORMAL
      - HIGH
    PushNotification:
      required:
      - reference
      type: object
      properties:
        reference:
          type: string
        recipient:
          $ref: '#/components/schemas/Recipient'
        notification:
          $ref: '#/components/schemas/Notification'
        data:
          type: object
          additionalProperties:
            type: object
            description: Object containing additional data
          description: Object containing additional data
        option:
          $ref: '#/components/schemas/Option'
    Recipient:
      required:
      - fcmToken
      type: object
      properties:
        fcmToken:
          type: string
          description: FCM Token
    PushNotificationResponse:
      required:
      - notificationId
      type: object
      properties:
        notificationId:
          type: string
    ApiErrorProblemDetail:
      required:
      - error
      - requestId
      - timestamp
      type: object
      properties:
        status:
          type: integer
          format: int32
        error:
          type: string
        requestId:
          type: string
        timestamp:
          type: string
          format: date-time
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
    NestedProblem:
      required:
      - detail
      - error
      - title
      type: object
      properties:
        error:
          type: string
        title:
          type: string
        detail:
          type: string
        type:
          type: string
          format: uri
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.uat.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.uat.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
