AlayaCare message inbox API

The message inbox API from AlayaCare — 4 operation(s) for message inbox.

OpenAPI Specification

alayacare-message-inbox-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.19-oas3
  title: AlayaCare Accounting Accounts message inbox API
  description: '**AlayaCare IDs:**

    The following terms are used to reference IDs that identify resources in AlayaCare:

    - id

    - visit_id

    - premium_id

    - visit_premium_id

    - employee_id

    - cost_centre_id

    - client_id


    **External IDs**

    The following terms are used to reference IDs that identify resources systems external to AlayaCare:

    - employee_external_id

    - client_external_id


    External IDs are required to be unique.

    No other assumptions are made regarding their format they are treated as strings.

    '
servers:
- url: https://example.alayacare.com/ext/api/v2/accounting
security:
- basic_auth: []
tags:
- name: message inbox
paths:
  /v1/inbox/messages:
    post:
      tags:
      - message inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Send a message for a sequence as a supply organization.

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgAdminMessageSendRequest'
      responses:
        201:
          description: Successfully sent message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAdminMessageDetailResponse'
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
    get:
      tags:
      - message inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Get a paginated collection of messages for a sequence as a supply organization.

        '
      parameters:
      - $ref: '#/components/parameters/SequenceIdQueryParam'
      - $ref: '#/components/parameters/MessageSenderTypeQueryParam'
      - $ref: '#/components/parameters/MessageCategoryQueryParam'
      - $ref: '#/components/parameters/PageNumberParam'
      - $ref: '#/components/parameters/ItemsPerPageParam'
      - in: query
        name: sort_by
        schema:
          type: string
          enum:
          - created_at
          default: created_at
      - $ref: '#/components/parameters/SortOrderParam'
      responses:
        200:
          description: Successfully got the messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAdminMessagePageResponse'
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
  /v1/inbox/messages/{message_id}:
    parameters:
    - $ref: '#/components/parameters/MessageIdPathParam'
    get:
      tags:
      - message inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Get the details of a message for a sequence as a supply organization.

        '
      responses:
        200:
          description: Successfully got the message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAdminMessageDetailResponse'
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
  /v1/inbox/messages/files/{file_id}:
    parameters:
    - $ref: '#/components/parameters/FileIdPathParam'
    get:
      tags:
      - message inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Get the file attached to a message as a supply organization.

        '
      responses:
        200:
          description: Successfully got the file.
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
  /v1/inbox/messages/files/{file_id}/presigned:
    parameters:
    - $ref: '#/components/parameters/FileIdPathParam'
    get:
      tags:
      - message inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Get the pre-signed URL for the file attached to a message as a supply

        organization.

        '
      responses:
        200:
          description: Successfully got the pre-signed URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAdminFilePresignedDetailResponse'
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
components:
  parameters:
    MessageCategoryQueryParam:
      in: query
      name: category
      schema:
        $ref: '#/components/schemas/MessageCategoryCore'
    SequenceIdQueryParam:
      in: query
      name: sequence_id
      schema:
        type: string
        format: uuid
      required: true
    MessageSenderTypeQueryParam:
      in: query
      name: sender_type
      schema:
        $ref: '#/components/schemas/MessageSenderTypeCore'
    FileIdPathParam:
      in: path
      name: file_id
      schema:
        type: string
        format: uuid
      required: true
      description: ID of a file.
    SortOrderParam:
      in: query
      name: sort_order
      schema:
        $ref: '#/components/schemas/SortOrderCore'
    PageNumberParam:
      in: query
      name: page
      schema:
        $ref: '#/components/schemas/PageNumberCore'
    MessageIdPathParam:
      in: path
      name: message_id
      schema:
        type: string
        format: uuid
      required: true
      description: ID of a message.
    ItemsPerPageParam:
      in: query
      name: items_per_page
      schema:
        $ref: '#/components/schemas/ItemsPerPageCore'
  schemas:
    PageNumberCore:
      type: integer
      minimum: 1
      default: 1
    SortOrderCore:
      type: string
      enum:
      - asc
      - desc
      default: desc
    OrgAdminMessageSendRequest:
      properties:
        sequence_id:
          type: string
          format: uuid
        category:
          $ref: '#/components/schemas/MessageCategoryCore'
        text:
          type: string
          maxLength: 2500
        author:
          type: string
          maxLength: 100
        file:
          type: object
          title: OrgAdminMessageSendFileRequest
          properties:
            url:
              type: string
            name:
              type: string
            size_in_bytes:
              type: integer
              minimum: 0
              maximum: 52428800
          required:
          - url
          - name
      required:
      - sequence_id
      - category
    OrgAdminMessageCollectionResponse:
      properties:
        id:
          type: string
          format: uuid
        category:
          $ref: '#/components/schemas/MessageCategoryCore'
        sender_type:
          $ref: '#/components/schemas/MessageSenderTypeCore'
        text:
          type: string
          maxLength: 2500
        author:
          type: string
          maxLength: 100
        created_at:
          type: string
          format: date-time
        file:
          type: object
          title: MessageCollectionFileResponse
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
          required:
          - id
          - name
      required:
      - id
      - category
      - sender_type
      - created_at
    ItemsPerPageCore:
      type: integer
      minimum: 1
      default: 100
    PageCore:
      description: Root page schema for returning collections.
      type: object
      properties:
        page:
          $ref: '#/components/schemas/PageNumberCore'
        items_per_page:
          $ref: '#/components/schemas/ItemsPerPageCore'
        total_items:
          type: integer
          minimum: 0
        total_pages:
          type: integer
          minimum: 0
      required:
      - page
      - items_per_page
      - total_items
      - total_pages
    OrgAdminMessagePageResponse:
      allOf:
      - $ref: '#/components/schemas/PageCore'
      - type: object
        properties:
          items:
            type: array
            items:
              $ref: '#/components/schemas/OrgAdminMessageCollectionResponse'
        required:
        - items
    OrgAdminFilePresignedDetailResponse:
      properties:
        url:
          type: string
      required:
      - url
    MessageSenderTypeCore:
      type: string
      enum:
      - demand
      - supply
    OrgAdminMessageDetailResponse:
      properties:
        message:
          type: object
          title: OrgAdminMessageDetailMessageResponse
          properties:
            id:
              type: string
              format: uuid
            sequence_id:
              type: string
              format: uuid
            category:
              $ref: '#/components/schemas/MessageCategoryCore'
            sender_type:
              $ref: '#/components/schemas/MessageSenderTypeCore'
            text:
              type: string
              maxLength: 2500
            author:
              type: string
              maxLength: 100
            created_at:
              type: string
              format: date-time
            file:
              type: object
              title: OrgAdminMessageDetailFileResponse
              properties:
                id:
                  type: string
                  format: uuid
                url:
                  type: string
                name:
                  type: string
                size_in_bytes:
                  type: integer
                  minimum: 0
                  maximum: 52428800
              required:
              - id
              - name
          required:
          - id
          - sequence_id
          - category
          - sender_type
          - created_at
        sender:
          type: object
          title: OrgAdminMessageDetailSenderResponse
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
          required:
          - id
          - name
        recipient:
          type: object
          title: OrgAdminMessageDetailRecipientResponse
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
          required:
          - id
          - name
      required:
      - message
      - sender
      - recipient
    MessageCategoryCore:
      type: string
      enum:
      - client_attachment
      - comment
  securitySchemes:
    basic_auth:
      type: http
      description: Basic HTTP auth over https
      scheme: basic