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:
  /resources:
    get:
      tags:
        - Resources
      summary: List resources.
      operationId: Resources_GetResources
      parameters:
        - type: string
          name: _filter
          in: query
          description: >-
            One or more filter operations to be performed on the collection.

            The referenced fields must allow filtering. See the respective
            report's schema for which fields can be filtered. 
                        
            Supports most of the [OData filter
            syntax](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part2-url-conventions/odata-v4.01-cs01-part2-url-conventions.html#sec_SystemQueryOptionfilter).
                        
            Supported operations:
                * eq,
                * ne,
                * gt,
                * ge,
                * lt,
                * le,
                * and,
                * or,
                * not,
                * ()

            Supported functions:
                * substringof('value',fieldName),
                * endswith(fieldName,'value'),
                * startswith(fieldName,'value'),
                * tolower(fieldName),
                * toupper(fieldName)
                        
            Examples:

            * _filter=`firstname eq 'Jeffrey'`

            * _filter=`id eq guid'a14c149a-2ce0-41d4-b532-02189ad3cb22'`

            * _filter=`startsWith(lastname,'leb') or dateAdded ge
            datetime'1998-03-06T20:38:07Z'`
          x-nullable: true
        - type: string
          name: _sort
          in: query
          description: >-
            Optional list of comma-separated fields to sort the collection by.


            The referenced fields must allow sorting. See the respective
            report's schema for which fields can be sorted. 

            If not specified, all report fields are returned.


            To sort in a descending manner, prefix the field name with `-`. For
            example, 

            `_sort=name,-date`, sorts the collection of items by `name`
            (ascending) 

            and then by `date` (descending).
          x-nullable: true
        - type: string
          name: _limit
          in: query
          description: >-
            The maximum number of items to return in the current page of the
            collection.
          x-nullable: true
        - type: string
          name: _offset
          in: query
          description: The number of pages to offset into the collection.
          x-nullable: true
        - 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/ResourceResource'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /resources/{id}:
    get:
      tags:
        - Resources
      summary: Get resource.
      operationId: Resources_GetResource
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The resource 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:
            $ref: '#/definitions/NonPagedResourceResource'
        '404':
          x-nullable: false
          description: Resource not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /courses/{courseId}/resources:
    get:
      tags:
        - Course Resources
      summary: List resources from a specific course.
      operationId: Resources_GetCourseResources
      parameters:
        - type: string
          name: courseId
          in: path
          required: true
          description: The course 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/NonPagedResourceResource'
        '404':
          x-nullable: false
          description: Course not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /courses/{courseId}/resources/{resourceId}:
    get:
      tags:
        - Course Resources
      summary: Get resource from a specific course.
      operationId: Resources_GetCourseResourceById
      parameters:
        - type: string
          name: resourceId
          in: path
          required: true
          description: The resource ID.
          format: guid
          x-nullable: false
        - type: string
          name: courseId
          in: path
          required: true
          description: The course 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:
            $ref: '#/definitions/NonPagedResourceResource'
        '404':
          x-nullable: false
          description: Course or resource not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /users/{userId}/resources:
    get:
      tags:
        - Resources
      summary: List resources available to a specific user.
      operationId: Resources_GetUserResources
      parameters:
        - type: string
          name: userId
          in: path
          required: true
          description: The user 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/NonPagedResourceResource'
        '404':
          x-nullable: false
          description: User not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /users/{userId}/enrollments/{courseId}/resources:
    get:
      tags:
        - Course Resources
      summary: >-
        List resources associated with a specified enrollment for a specific
        user.
      operationId: Resources_GetUserResourcesByCourseId
      parameters:
        - type: string
          name: userId
          in: path
          required: true
          description: The user ID.
          format: guid
          x-nullable: false
        - type: string
          name: courseId
          in: path
          required: true
          description: The course 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/NonPagedResourceResource'
        '404':
          x-nullable: false
          description: User or course not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /enrollments/{id}/my-resources:
    get:
      tags:
        - Course Resources
      summary: >-
        List resources available from a specific course for the current
        authenticated user.
      operationId: Resources_GetMyCourseResources
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The course 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/NonPagedResourceResource'
        '404':
          x-nullable: false
          description: Course not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /enrollments/my-resources:
    get:
      tags:
        - Resources
      summary: List resources for the current authenticated user.
      operationId: Resources_GetMyResources
      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/NonPagedResourceResource'
      security:
        - api_key: []
definitions:
  ResourceResource:
    type: object
    description: Represents information about a resource in the Integration API.
    properties:
      id:
        type: string
        description: |-
          `Filterable` 

          The unique resource identifier
        format: guid
      name:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The resource's name.
      description:
        type: string
        description: |-
          `Filterable` 

          The resource's description.
      file:
        type: string
        description: '`Sortable` The resource''s associated file, if any. '
  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'
  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
  NonPagedResourceResource:
    type: object
    description: >-
      This class is NOT to be used as an actual response. This is to be used as
      the `SwaggerResponse` return type for

      non-paginated endpoints that return ResourceResource.
    properties:
      id:
        type: string
        description: The unique resource identifier
        format: guid
      name:
        type: string
        description: The resource's name.
      description:
        type: string
        description: The resource's description.
      file:
        type: string
        description: 'The resource''s associated file, if any. '
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
