api-evangelist / inbox

This is the inbox for new APIs.
0 stars 0 forks source link

Library Availability #47

Open kaialane opened 1 month ago

kaialane commented 1 month ago

The Library Availability API delivers availability information for a product (title) in a specific library collection. This includes the number of library copies owned, the number of holds on that title, and whether or not it is currently available for checkout. ~ https://developer.overdrive.com/apis/library-availability

kinlane commented 1 month ago
openapi: 3.1.0
info:
  title: Library Availability API
  description: This API delivers availability information for a product (title) in a specific library collection.
  version: 1.0.0
servers:
  - url: https://api.overdrive.com/v1
    description: Production server
  - url: https://integration-patron.api.overdrive.com
    description: Integration server
security:
  - oauth2: []

components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.overdrive.com/oauth2/token
          scopes: {}
  schemas:
    AvailabilityResponse:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the product.
          example: ebff8d7b-c9a0-4478-a1ed-63b64e8386c5
        crossRefId:
          type: integer
          description: The cross-reference ID of the product.
          example: 1427131
        collections:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: The name of the library.
                example: Your Public Library
              copiesOwned:
                type: integer
                description: The total number of copies owned by the library.
                example: 5
              copiesAvailable:
                type: integer
                description: The number of copies currently available for checkout.
                example: 5
              numberOfHolds:
                type: integer
                description: The number of holds placed on the title.
                example: 0
        available:
          type: boolean
          description: Indicates if the title is available for checkout.
          example: true
        availabilityType:
          type: string
          description: Describes the lending model of the title.
          example: Normal
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message.
          example: Invalid product passed
        token:
          type: string
          description: Token related to the error.
          example: 165b607f-79eb-4e53-afcf-d6d9b1e81e08

paths:
  /collections/{collectionId}/products/{productId}/availability:
    get:
      summary: Get availability information for a specific product.
      operationId: getProductAvailability
      parameters:
        - name: collectionId
          in: path
          required: true
          description: The ID of the library collection.
          schema:
            type: string
        - name: productId
          in: path
          required: true
          description: The ID of the product.
          schema:
            type: string
      responses:
        '200':
          description: Availability information for the product.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvailabilityResponse'
        '400':
          description: Invalid product ID or request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /collections/{collectionId}/availability:
    get:
      summary: Get availability information for multiple products.
      operationId: getBulkProductAvailability
      parameters:
        - name: collectionId
          in: path
          required: true
          description: The ID of the library collection.
          schema:
            type: string
        - name: products
          in: query
          required: true
          description: Comma-separated list of product IDs.
          schema:
            type: string
      responses:
        '200':
          description: Availability information for multiple products.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The ID of the library.
                    example: OverDrive API Integration Library (OH)
                  availability:
                    type: array
                    items:
                      $ref: '#/components/schemas/AvailabilityResponse'
                  totalItems:
                    type: integer
                    description: The total number of products in the response.
                    example: 2
                  links:
                    type: object
                    properties:
                      self:
                        type: object
                        properties:
                          href:
                            type: string
                            example: https://api.overdrive.com/v1/collections/v1L1BBQ0AAA2_/availability?products=95523eba-cc01-40fc-a1c5-85e0b0eb0eae,193f0269-97f7-4dfd-9e5a-aef9d6a3a010
                          type:
                            type: string
                            example: application/vnd.overdrive.api+json
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
kinlane commented 1 month ago
{
  "name": "OverDrive Library Availability API",
  "description": "This API delivers availability information for a product (title) in a specific library collection. It includes details like number of copies owned, number of holds, and availability status.",
  "created": "2024-10-22",
  "modified": "2024-10-22",
  "apis": [
    {
      "name": "Library Availability API",
      "description": "Fetches availability information of a specific product in a library collection. Provides number of copies, holds, and availability status.",
      "humanURL": "https://developer.overdrive.com/apis/library-availability-new",
      "baseURL": "https://api.overdrive.com/v1",
      "tags": ["Library", "Availability", "OverDrive"],
      "properties": {
        "documentation": "https://developer.overdrive.com/docs/reference-guide",
        "protocols": ["REST"],
        "authentication": "OAuth2",
        "formats": ["JSON"]
      }
    }
  ],
  "maintainers": [
    {
      "name": "OverDrive Developer Portal",
      "email": "support@overdrive.com",
      "url": "https://developer.overdrive.com/support/contact-us"
    }
  ],
  "externalDocs": {
    "docs": [
      {
        "name": "Getting Started",
        "url": "https://developer.overdrive.com/docs/getting-started"
      },
      {
        "name": "API Reference Guide",
        "url": "https://developer.overdrive.com/docs/reference-guide"
      }
    ]
  }
}