University of Edinburgh Communities API

Top-level and nested communities

OpenAPI Specification

university-of-edinburgh-communities-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Edinburgh DataShare REST Bitstreams Communities API
  description: Public read-only DSpace 6 legacy REST API for Edinburgh DataShare, the University of Edinburgh's open-access research-data repository. Allows programmatic querying of communities, collections, items, bitstreams and the metadata/schema registry. Responses are JSON. This specification was reconstructed from the live API index at https://datashare.ed.ac.uk/rest and verified against live responses; only the documented public GET endpoints are described here.
  version: 6.x
  contact:
    name: Edinburgh DataShare
    url: https://datashare.ed.ac.uk/
  license:
    name: DSpace BSD License
    url: https://github.com/DSpace/DSpace/blob/dspace-6_x/LICENSE
servers:
- url: https://datashare.ed.ac.uk/rest
  description: Edinburgh DataShare production REST endpoint
tags:
- name: Communities
  description: Top-level and nested communities
paths:
  /communities:
    get:
      tags:
      - Communities
      summary: List communities
      description: Return an array of all communities in DSpace.
      operationId: getCommunities
      parameters:
      - $ref: '#/components/parameters/expand'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Array of communities.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Community'
  /communities/top-communities:
    get:
      tags:
      - Communities
      summary: List top-level communities
      description: Returns an array of all top-level communities in DSpace.
      operationId: getTopCommunities
      parameters:
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: Array of top-level communities.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Community'
  /communities/{communityId}:
    get:
      tags:
      - Communities
      summary: Get community
      description: Returns a community with the specified ID.
      operationId: getCommunity
      parameters:
      - $ref: '#/components/parameters/communityId'
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: The requested community.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Community'
        '404':
          $ref: '#/components/responses/NotFound'
  /communities/{communityId}/collections:
    get:
      tags:
      - Communities
      summary: List collections of a community
      description: Returns an array of collections of the specified community.
      operationId: getCommunityCollections
      parameters:
      - $ref: '#/components/parameters/communityId'
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: Array of collections.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Collection'
  /communities/{communityId}/communities:
    get:
      tags:
      - Communities
      summary: List subcommunities of a community
      description: Returns an array of subcommunities of the specified community.
      operationId: getSubCommunities
      parameters:
      - $ref: '#/components/parameters/communityId'
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: Array of subcommunities.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Community'
components:
  parameters:
    offset:
      name: offset
      in: query
      required: false
      description: Offset into the result set for pagination.
      schema:
        type: integer
        default: 0
    expand:
      name: expand
      in: query
      required: false
      description: Comma-separated list of optional fields to expand in the response (e.g. metadata, bitstreams, collections, parentCommunity, all).
      schema:
        type: string
      example: metadata,bitstreams
    communityId:
      name: communityId
      in: path
      required: true
      description: UUID of the community.
      schema:
        type: string
        format: uuid
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of records to return.
      schema:
        type: integer
        default: 100
  schemas:
    Bitstream:
      allOf:
      - $ref: '#/components/schemas/DSpaceObject'
      - type: object
        properties:
          bundleName:
            type: string
            description: Bundle the bitstream belongs to (e.g. ORIGINAL, THUMBNAIL, CC-LICENSE).
          description:
            type: string
            nullable: true
          format:
            type: string
            description: Human-readable format label (e.g. JPEG).
          mimeType:
            type: string
          sizeBytes:
            type: integer
            format: int64
          parentObject:
            type: object
            nullable: true
          retrieveLink:
            type: string
          checkSum:
            $ref: '#/components/schemas/CheckSum'
          sequenceId:
            type: integer
          policies:
            type: array
            nullable: true
            items:
              $ref: '#/components/schemas/ResourcePolicy'
    Collection:
      allOf:
      - $ref: '#/components/schemas/DSpaceObject'
      - type: object
        properties:
          logo:
            $ref: '#/components/schemas/Bitstream'
          parentCommunity:
            $ref: '#/components/schemas/Community'
          parentCommunityList:
            type: array
            items:
              $ref: '#/components/schemas/Community'
          items:
            type: array
            items:
              $ref: '#/components/schemas/Item'
          license:
            type: string
            nullable: true
          copyrightText:
            type: string
          introductoryText:
            type: string
          shortDescription:
            type: string
          sidebarText:
            type: string
          numberItems:
            type: integer
    MetadataEntry:
      type: object
      properties:
        key:
          type: string
          example: dc.contributor.author
        value:
          type: string
        language:
          type: string
          nullable: true
        schema:
          type: string
          example: dc
        element:
          type: string
          example: contributor
        qualifier:
          type: string
          nullable: true
    Community:
      allOf:
      - $ref: '#/components/schemas/DSpaceObject'
      - type: object
        properties:
          logo:
            $ref: '#/components/schemas/Bitstream'
          parentCommunity:
            $ref: '#/components/schemas/Community'
          copyrightText:
            type: string
          introductoryText:
            type: string
          shortDescription:
            type: string
          sidebarText:
            type: string
          countItems:
            type: integer
          collections:
            type: array
            items:
              $ref: '#/components/schemas/Collection'
          subcommunities:
            type: array
            items:
              $ref: '#/components/schemas/Community'
    CheckSum:
      type: object
      properties:
        value:
          type: string
        checkSumAlgorithm:
          type: string
          example: MD5
    DSpaceObject:
      type: object
      description: Common fields shared by all DSpace REST objects.
      properties:
        uuid:
          type: string
          format: uuid
        name:
          type: string
        handle:
          type: string
          nullable: true
          description: Persistent handle identifier (e.g. 10283/928).
        type:
          type: string
          enum:
          - community
          - collection
          - item
          - bitstream
        expand:
          type: array
          items:
            type: string
        link:
          type: string
          description: Relative REST link to this object.
    ResourcePolicy:
      type: object
      properties:
        id:
          type: integer
        action:
          type: string
        epersonId:
          type: integer
        groupId:
          type: integer
        resourceId:
          type: integer
        resourceType:
          type: string
        rpDescription:
          type: string
          nullable: true
        rpName:
          type: string
          nullable: true
        rpType:
          type: string
          nullable: true
        startDate:
          type: string
          nullable: true
        endDate:
          type: string
          nullable: true
    Item:
      allOf:
      - $ref: '#/components/schemas/DSpaceObject'
      - type: object
        properties:
          lastModified:
            type: string
            description: Last modification timestamp.
          parentCollection:
            $ref: '#/components/schemas/Collection'
          parentCollectionList:
            type: array
            nullable: true
            items:
              $ref: '#/components/schemas/Collection'
          parentCommunityList:
            type: array
            nullable: true
            items:
              $ref: '#/components/schemas/Community'
          metadata:
            type: array
            items:
              $ref: '#/components/schemas/MetadataEntry'
          bitstreams:
            type: array
            items:
              $ref: '#/components/schemas/Bitstream'
          archived:
            type: string
          withdrawn:
            type: string
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string