Fabric8Labs Media API

The Media API from Fabric8Labs — 2 anonymous read operations over the 276 media library attachments (product imagery, press assets, diagrams) on www.fabric8labs.com.

OpenAPI Specification

fabric8labs-media-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Fabric8Labs Media API
  version: wp/v2
  description: Read-only view of the public WordPress REST API (namespace wp/v2) served by www.fabric8labs.com.
    Derived by API Evangelist from the live, anonymous route index at https://www.fabric8labs.com/wp-json
    and the per-route OPTIONS schema documents the site serves. Only operations verified to answer anonymously
    with HTTP 200 are included; the write methods WordPress also registers on these routes require authentication
    and are not part of this public surface.
  contact:
    name: Fabric8Labs
    url: https://www.fabric8labs.com/contact-us/
servers:
- url: https://www.fabric8labs.com/wp-json
tags:
- name: Media
  description: Media resources on www.fabric8labs.com.
paths:
  /wp/v2/media:
    get:
      operationId: listMedia
      summary: List media
      description: Returns a paginated collection of media published on www.fabric8labs.com.
      tags:
      - Media
      parameters:
      - name: after
        in: query
        schema:
          type: string
          format: date-time
        description: Limit response to posts published after a given ISO8601 compliant date.
      - name: author
        in: query
        schema:
          type: array
          items:
            type: integer
          default: []
        description: Limit result set to posts assigned to specific authors.
      - name: author_exclude
        in: query
        schema:
          type: array
          items:
            type: integer
          default: []
        description: Ensure result set excludes posts assigned to specific authors.
      - name: before
        in: query
        schema:
          type: string
          format: date-time
        description: Limit response to posts published before a given ISO8601 compliant date.
      - name: context
        in: query
        schema:
          type: string
          enum:
          - view
          - embed
          - edit
          default: view
        description: Scope under which the request is made; determines fields present in response.
      - name: exclude
        in: query
        schema:
          type: array
          items:
            type: integer
          default: []
        description: Ensure result set excludes specific IDs.
      - name: include
        in: query
        schema:
          type: array
          items:
            type: integer
          default: []
        description: Limit result set to specific IDs.
      - name: media_type
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - image
            - video
            - text
            - application
            - audio
        description: Limit result set to attachments of a particular media type or media types.
      - name: mime_type
        in: query
        schema:
          type: array
          items:
            type: string
        description: Limit result set to attachments of a particular MIME type or MIME types.
      - name: modified_after
        in: query
        schema:
          type: string
          format: date-time
        description: Limit response to posts modified after a given ISO8601 compliant date.
      - name: modified_before
        in: query
        schema:
          type: string
          format: date-time
        description: Limit response to posts modified before a given ISO8601 compliant date.
      - name: offset
        in: query
        schema:
          type: integer
        description: Offset the result set by a specific number of items.
      - name: order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
          default: desc
        description: Order sort attribute ascending or descending.
      - name: orderby
        in: query
        schema:
          type: string
          enum:
          - author
          - date
          - id
          - include
          - modified
          - parent
          - relevance
          - slug
          - include_slugs
          - title
          default: date
        description: Sort collection by post attribute.
      - name: page
        in: query
        schema:
          type: integer
          minimum: 1
          default: 1
        description: Current page of the collection.
      - name: parent
        in: query
        schema:
          type: array
          items:
            type: integer
          default: []
        description: Limit result set to items with particular parent IDs.
      - name: parent_exclude
        in: query
        schema:
          type: array
          items:
            type: integer
          default: []
        description: Limit result set to all items except those of a particular parent ID.
      - name: per_page
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 10
        description: Maximum number of items to be returned in result set.
      - name: search
        in: query
        schema:
          type: string
        description: Limit results to those matching a string.
      - name: search_columns
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - post_title
            - post_content
            - post_excerpt
          default: []
        description: Array of column names to be searched.
      - name: search_semantics
        in: query
        schema:
          type: string
          enum:
          - exact
        description: How to interpret the search input.
      - name: slug
        in: query
        schema:
          type: array
          items:
            type: string
        description: Limit result set to posts with one or more specific slugs.
      - name: status
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - inherit
            - private
            - trash
          default: inherit
        description: Limit result set to posts assigned one or more statuses.
      responses:
        '200':
          description: A list of media.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Attachment'
          headers:
            X-WP-Total:
              description: Total number of matching records.
              schema:
                type: integer
            X-WP-TotalPages:
              description: Total number of pages available.
              schema:
                type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /wp/v2/media/{id}:
    get:
      operationId: getMediaById
      summary: Retrieve a single media
      description: Returns one record from the media collection on www.fabric8labs.com.
      tags:
      - Media
      parameters:
      - name: id
        in: path
        schema:
          type: integer
        description: Unique identifier for the post.
        required: true
      - name: context
        in: query
        schema:
          type: string
          enum:
          - view
          - embed
          - edit
          default: view
        description: Scope under which the request is made; determines fields present in response.
      responses:
        '200':
          description: A single media.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Attachment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Attachment:
      title: attachment
      type: object
      properties:
        date:
          description: The date the post was published, in the site's timezone.
          type: string
          format: date-time
        date_gmt:
          description: The date the post was published, as GMT.
          type: string
          format: date-time
        guid:
          description: The globally unique identifier for the post.
          type: object
          properties:
            raw:
              description: GUID for the post, as it exists in the database.
              type: string
            rendered:
              description: GUID for the post, transformed for display.
              type: string
        id:
          description: Unique identifier for the post.
          type: integer
        link:
          description: URL to the post.
          type: string
          format: uri
        modified:
          description: The date the post was last modified, in the site's timezone.
          type: string
          format: date-time
        modified_gmt:
          description: The date the post was last modified, as GMT.
          type: string
          format: date-time
        slug:
          description: An alphanumeric identifier for the post unique to its type.
          type: string
        status:
          description: A named status for the post.
          type: string
          enum:
          - publish
          - future
          - draft
          - pending
          - private
          - acf-disabled
        type:
          description: Type of post.
          type: string
        permalink_template:
          description: Permalink template for the post.
          type: string
        generated_slug:
          description: Slug automatically generated from the post title.
          type: string
        class_list:
          description: An array of the class names for the post container element.
          type: array
          items:
            type: string
        title:
          description: The title for the post.
          type: object
          properties:
            raw:
              description: Title for the post, as it exists in the database.
              type: string
            rendered:
              description: HTML title for the post, transformed for display.
              type: string
        author:
          description: The ID for the author of the post.
          type: integer
        featured_media:
          description: The ID of the featured media for the post.
          type: integer
        comment_status:
          description: Whether or not comments are open on the post.
          type: string
          enum:
          - open
          - closed
        ping_status:
          description: Whether or not the post can be pinged.
          type: string
          enum:
          - open
          - closed
        meta:
          description: Meta fields.
          type: object
          properties:
            _acf_changed:
              type: boolean
              title: ''
              description: ''
              default: false
            inline_featured_image:
              type: boolean
              title: ''
              description: ''
              default: false
            _genesis_hide_title:
              type: boolean
              title: ''
              description: ''
              default: false
            _genesis_hide_breadcrumbs:
              type: boolean
              title: ''
              description: ''
              default: false
            _genesis_hide_singular_image:
              type: boolean
              title: ''
              description: ''
              default: false
            _genesis_hide_footer_widgets:
              type: boolean
              title: ''
              description: ''
              default: false
            _genesis_custom_body_class:
              type: string
              title: ''
              description: ''
              default: ''
            _genesis_custom_post_class:
              type: string
              title: ''
              description: ''
              default: ''
            _genesis_layout:
              type: string
              title: ''
              description: ''
              default: ''
        template:
          description: The theme file to use to display the post.
          type: string
        acf:
          description: ACF field data
          type: object
          properties: []
        alt_text:
          description: Alternative text to display when attachment is not displayed.
          type: string
        caption:
          description: The attachment caption.
          type: object
          properties:
            raw:
              description: Caption for the attachment, as it exists in the database.
              type: string
            rendered:
              description: HTML caption for the attachment, transformed for display.
              type: string
        description:
          description: The attachment description.
          type: object
          properties:
            raw:
              description: Description for the attachment, as it exists in the database.
              type: string
            rendered:
              description: HTML description for the attachment, transformed for display.
              type: string
        media_type:
          description: Attachment type.
          type: string
          enum:
          - image
          - file
        mime_type:
          description: The attachment MIME type.
          type: string
        media_details:
          description: Details about the media file, specific to its type.
          type: object
        post:
          description: The ID for the associated post of the attachment.
          type: integer
        source_url:
          description: URL to the original attachment file.
          type: string
          format: uri
        missing_image_sizes:
          description: List of the missing image sizes of the attachment.
          type: array
          items:
            type: string
        filename:
          description: Original attachment file name.
          type: string
        filesize:
          description: Attachment file size in bytes.
          type: integer
        exif_orientation:
          description: EXIF orientation value. Values 1-8 follow the EXIF specification, where 1 means
            no rotation needed.
          type: integer
      links:
      - rel: https://api.w.org/action-unfiltered-html
        title: The current user can post unfiltered HTML markup and JavaScript.
        href: https://www.fabric8labs.com/wp-json/wp/v2/media/{id}
        targetSchema:
          type: object
          properties:
            content:
              raw:
                type: string
      - rel: https://api.w.org/action-assign-author
        title: The current user can change the author on this post.
        href: https://www.fabric8labs.com/wp-json/wp/v2/media/{id}
        targetSchema:
          type: object
          properties:
            author:
              type: integer
    Error:
      type: object
      description: The WordPress REST API error envelope returned by www.fabric8labs.com.
      properties:
        code:
          type: string
          description: Machine-readable error code, e.g. rest_post_invalid_id.
        message:
          type: string
          description: Human-readable error message.
        data:
          type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
            params:
              type: object
              description: Per-parameter validation messages, when present.
      required:
      - code
      - message
  responses:
    BadRequest:
      description: Invalid parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required or insufficient permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No record matches the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'