x-generator: NSwag v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))
swagger: '2.0'
info:
  title: Absorb Integration API
  version: v1
consumes:
  - application/json
produces:
  - application/json
paths:
  /credits/credit-types:
    get:
      tags:
        - Credit Types
      summary: List credit types available for enrollments.
      operationId: Credits_GetCreditTypes
      parameters:
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            type: array
            items:
              $ref: '#/definitions/CreditTypeResource'
      security:
        - api_key: []
  /credits/users/{userId}/enrollments/{enrollmentId}:
    get:
      tags:
        - Enrollment Credits
      summary: List credits from a specific user's course enrollment.
      operationId: Credits_GetUserCourseEnrollmentCredits
      parameters:
        - type: string
          name: userId
          in: path
          required: true
          description: The user ID.
          format: guid
          x-nullable: false
        - type: string
          name: enrollmentId
          in: path
          required: true
          description: The enrollment ID.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            type: array
            items:
              $ref: '#/definitions/EnrollmentCreditTypeCreditResource'
        '404':
          x-nullable: false
          description: User or enrollment not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  CreditTypeResource:
    type: object
    description: >-
      Represents information about a credit type for an Integration API
      endpoint.
    properties:
      id:
        type: string
        description: The unique credit type identifier.
        format: guid
      name:
        type: string
        description: The credit type's name.
      isCustom:
        type: boolean
        description: >-
          True if this is a custom credit type, false if it is the default
          general type.
      'dateAdded ':
        type: string
        description: The date when the credit type was added.
        format: date-time
      dateEdited:
        type: string
        description: The date when the credit type was last edited.
        format: date-time
  Link:
    type: object
    properties:
      Rel:
        $ref: '#/definitions/Relation'
      Items:
        type: array
        items:
          $ref: '#/definitions/LinkItem'
  Relation:
    type: object
    properties:
      Name:
        type: string
  LinkItem:
    type: object
    properties:
      Href:
        type: string
      Name:
        type: string
      Templated:
        type: boolean
      Type:
        type: string
      Deprecation:
        type: string
      Profile:
        type: string
      Title:
        type: string
      Hreflang:
        type: string
  IEmbeddedResource:
    type: object
    x-abstract: true
    properties:
      Name:
        type: string
      Resources:
        type: array
        items:
          $ref: '#/definitions/IResource'
  IResource:
    type: object
    x-abstract: true
    properties:
      Links:
        type: array
        items:
          $ref: '#/definitions/Link'
      EmbeddedResources:
        type: array
        items:
          $ref: '#/definitions/IEmbeddedResource'
  EnrollmentCreditTypeCreditResource:
    type: object
    description: >-
      Represents information about an enrollment's credit for an Integration API
      endpoint.
    properties:
      id:
        type: string
        description: The unique course enrollment credit identifier.
        format: guid
      credits:
        type: number
        description: The number of awarded credits for the specified credit type.
        format: decimal
      creditTypeId:
        type: string
        description: The credit type's ID.
        format: guid
      creditTypeName:
        type: string
        description: The credit type's name.
      enrollmentId:
        type: string
        description: The enrollment's ID.
        format: guid
  GenericErrorResponse:
    type: object
    description: |-
      This class is NOT to be used as an actual response. This is to be used as
      the return type for non-200 responses in `SwaggerResponse` attributes.
    properties:
      validations:
        type: array
        description: The validations (if any) which caused the error.
        items:
          type: string
      code:
        description: The status code returned.
        allOf:
          - $ref: '#/definitions/HttpStatusCode'
      message:
        type: string
        description: The error message.
      term:
        type: string
        description: The general error term.
      _meta:
        type: object
        description: 'A list of meta data (if any). '
        additionalProperties:
          type: string
  HttpStatusCode:
    type: integer
    description: ''
    x-enumNames:
      - Continue
      - SwitchingProtocols
      - OK
      - Created
      - Accepted
      - NonAuthoritativeInformation
      - NoContent
      - ResetContent
      - PartialContent
      - MultipleChoices
      - Ambiguous
      - MovedPermanently
      - Moved
      - Found
      - Redirect
      - SeeOther
      - RedirectMethod
      - NotModified
      - UseProxy
      - Unused
      - TemporaryRedirect
      - RedirectKeepVerb
      - BadRequest
      - Unauthorized
      - PaymentRequired
      - Forbidden
      - NotFound
      - MethodNotAllowed
      - NotAcceptable
      - ProxyAuthenticationRequired
      - RequestTimeout
      - Conflict
      - Gone
      - LengthRequired
      - PreconditionFailed
      - RequestEntityTooLarge
      - RequestUriTooLong
      - UnsupportedMediaType
      - RequestedRangeNotSatisfiable
      - ExpectationFailed
      - UpgradeRequired
      - InternalServerError
      - NotImplemented
      - BadGateway
      - ServiceUnavailable
      - GatewayTimeout
      - HttpVersionNotSupported
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
x-servers:
  - url: https://rest.myabsorb.com
    description: US
  - url: https://rest.myabsorb.ca
    description: CA
  - url: https://rest.myabsorb.eu
    description: EU
  - url: https://rest.myabsorb.com.au
    description: AU
