openapi: 3.0.1
info:
  title: Sms Channel Service API Specification
  description: The Sms Service provides API endpoints to send smses
  version: 1.0.102
servers:
- description: ''
  url: https://api.uat.btx.fr.banqup.com/core/sms
- description: ''
  url: https://api.uat.btx.eu.banqup.com/core/sms
paths:
  /v1/smses:
    post:
      tags:
      - Sms Channel
      summary: Sends sms
      description: 'Sends sms <br/> Scope: sms_send'
      operationId: sendSms
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsNotification'
        required: true
      responses:
        '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-27 12:34:50
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '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-27 12:34:50
                type: about:blank
                title: Internal Server Error
                detail: The server encountered an unexpected error.
        '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-27 12:34:50
                type: about:blank
                title: Unauthorized
                detail: Access to the requested resource lacks valid authentication
                  credentials.
        '202':
          description: Sms sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsNotificationResponse'
      security:
      - sms_service:
        - sms_send
components:
  schemas:
    SmsNotification:
      required:
      - message
      - phoneNumber
      - reference
      - sender
      type: object
      properties:
        reference:
          type: string
          description: Recipient data
        sender:
          type: string
          description: Sender name
        phoneNumber:
          type: string
          description: Receiver phone number
        message:
          type: string
          description: Sms content
    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
    SmsNotificationResponse:
      required:
      - notificationId
      type: object
      properties:
        notificationId:
          type: string
  securitySchemes:
    sms_service:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.uat.btx.fr.banqup.com/v1/oauth20/authorization
          tokenUrl: https://api.uat.btx.fr.banqup.com/v1/oauth20/token_kc
          scopes:
            sms_send: Can send smses
