swagger: '2.0'
info:
  title: Thales TSH Transit Notification API - WS to TSH
  description: Thales TSH Transit Notification API - WS to TSH
  termsOfService: Copyright (c) 2019 Thales. All Rights Reserved
  version: 1.0.8
paths:
  /getMessages:
    post:
      summary: Request to fetch messages for a specific virtual card
      description: This method is used by Wallet Server to fetch messages for a specific virtual card.
      operationId: getMessages
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - $ref: '#/parameters/podHeader'
        - in: body
          name: body
          schema:
            $ref: '#/definitions/getMessagesReq'
          description: getMessages request payload
          required: true
      responses:
        '200':
          description: getMessages response payload
          schema:
            $ref: '#/definitions/getMessagesRes'
        '500':
          description: Internal Server Error
definitions:
  getMessagesReq:
    type: object
    properties:
      requestHeader:
        $ref: '#/definitions/requestHeader'
      walletCardId:
        $ref: '#/definitions/walletCardId'
      lastUpdatedTimestamp:
        $ref: '#/definitions/lastUpdatedTimestamp'
    required:
      - requestHeader
      - walletCardId
  requestHeader:
    type: object
    properties:
      requestId:
        $ref: '#/definitions/requestId'
      sessionId:
        $ref: '#/definitions/sessionId'
      generationDateTime:
        $ref: '#/definitions/generationDateTime'
    required:
      - requestId
      - sessionId
  requestId:
    type: string
    description: Unique request identifier
    minLength: 1
    maxLength: 48
  sessionId:
    type: string
    description: Unique session identifier used to trace the calls across systems during a use case.
    minLength: 1
    maxLength: 48
  generationDateTime:
    type: string
    description: |-
      Date time representing when the request or response has been generated.<br/>RFC3339 format. <br/>Example:
       - 2018-12-24T17:32:28Z
    format: date-time
  walletCardId:
    type: string
    description: The Wallet Card Identifier. Unique for each wallet card.
    minLength: 1
    maxLength: 64
  lastUpdatedTimestamp:
    type: string
    description: Timestamp used for filtering messages.</br> Messages already provided to wallet server before this timestamp will not be returned.</br> Its format is as specified in RFC 3339
    format: date-time
  getMessagesRes:
    type: object
    properties:
      responseHeader:
        $ref: '#/definitions/responseHeader'
      lastUpdatedTimestamp:
        $ref: '#/definitions/lastUpdatedTimestamp'
      messages:
        type: array
        description: Array of message for the supplied walletCardId using lastUpdatedTimestamp for filtering
        items:
          type: object
          properties:
            identifier:
              type: string
              description: unique identifier of the message
              maxLength: 64
            messageDate:
              type: string
              description: Date when the message was generated.</br> Its format is as specified in RFC 3339
              format: date-time
            expirationDate:
              type: string
              description: Date when the message is no longer valid and should be removed.</br> Its format is as specified in RFC 3339
              format: date-time
            content:
              type: string
              description: Plain text message to be displayed to the end user
              maxLength: 128
            allowDeepLink:
              type: boolean
              description: Flag indicating if the message should "deep link" to the issuer's app
          required:
            - identifier
            - messageDate
            - expirationDate
            - content
    required:
      - responseHeader
  responseHeader:
    type: object
    properties:
      responseId:
        $ref: '#/definitions/responseId'
      sessionId:
        $ref: '#/definitions/sessionId'
      generationDateTime:
        $ref: '#/definitions/generationDateTime'
      statusCode:
        type: number
        description: |
          Status code to the request
          |Status code | Description|
          |-------|-------|
          |0|OK|      
          |111|Missing mandatory parameter|
          |112|Bad parameter format|          
          |119|Unknown virtual card|                    
          |911|Operation failed|          
          |921|Unexpected server error|
      statusMessage:
        type: string
        description: Textual status message
    required:
      - responseId
      - sessionId
      - statusCode
  responseId:
    type: string
    description: Unique response identifier
    minLength: 1
    maxLength: 48
parameters:
  podHeader:
    name: x-pod
    in: header
    description: HTTP header identifying the pod and corresponding DNS hostname of the load balancer from which traffic is coming.</br> Subsequent API calls should be sent to this pod.
    required: true
    type: string
    maxLength: 128
