openapi: 3.0.0
info:
  description: |
    Welcome to the HumHub activity module API reference.
  version: 1.0.0
  title: HumHub - Activity API
  contact:
    email: info@humhub.com
  license:
    name: AGPLv2
    url: https://www.humhub.org/en/licences
tags:
  - name: Activity
    description: API to access activity information.
    externalDocs:
      description: Find out more
      url: http://docs.humhub.org
paths:
  /activity:
    get:
      tags:
        - Activity
      summary: Find all global activity
      description: ""
      parameters:
        - $ref: common.yaml#/components/parameters/pageParam
        - $ref: common.yaml#/components/parameters/limitParam
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    $ref: common.yaml#/components/schemas/totalProperty
                  page:
                    $ref: common.yaml#/components/schemas/pageProperty
                  pages:
                    $ref: common.yaml#/components/schemas/pagesProperty
                  links:
                    $ref: common.yaml#/components/schemas/linksProperty
                  results:
                    type: array
                    items:
                      $ref: "#/components/schemas/Activity"
            application/xml:
              schema:
                type: object
                properties:
                  total:
                    $ref: common.yaml#/components/schemas/totalProperty
                  page:
                    $ref: common.yaml#/components/schemas/pageProperty
                  pages:
                    $ref: common.yaml#/components/schemas/pagesProperty
                  links:
                    $ref: common.yaml#/components/schemas/linksProperty
                  results:
                    type: array
                    items:
                      $ref: "#/components/schemas/Activity"
  "/activity/{id}":
    get:
      tags:
        - Activity
      summary: Get activity by id
      description: ""
      parameters:
        - name: id
          in: path
          description: The id of activity
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Activity"
            application/xml:
              schema:
                $ref: "#/components/schemas/Activity"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: Activity not found
            application/xml:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 404
                  message:
                    type: string
                    example: Activity not found
  "/activity/container/{containerId}":
    get:
      tags:
        - Activity
      summary: Get all activities by container
      description: ""
      parameters:
        - $ref: common.yaml#/components/parameters/pageParam
        - $ref: common.yaml#/components/parameters/limitParam
        - in: path
          name: containerId
          description: The id of container
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    $ref: common.yaml#/components/schemas/totalProperty
                  page:
                    $ref: common.yaml#/components/schemas/pageProperty
                  pages:
                    $ref: common.yaml#/components/schemas/pagesProperty
                  links:
                    $ref: common.yaml#/components/schemas/linksProperty
                  results:
                    type: array
                    items:
                      $ref: "#/components/schemas/Activity"
            application/xml:
              schema:
                type: object
                properties:
                  total:
                    $ref: common.yaml#/components/schemas/totalProperty
                  page:
                    $ref: common.yaml#/components/schemas/pageProperty
                  pages:
                    $ref: common.yaml#/components/schemas/pagesProperty
                  links:
                    $ref: common.yaml#/components/schemas/linksProperty
                  results:
                    type: array
                    items:
                      $ref: "#/components/schemas/Activity"
servers:
  - url: /api/v1
components:
  securitySchemes:
    _ref: common.yaml#/securityDefinitions
  schemas:
    Activity:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 32
        class:
          type: string
          example: humhub\modules\space\activities\MemberAdded
        content:
          $ref: "#/components/schemas/ActivityContent"
        originator:
          $ref: user.yaml#/components/schemas/UserShort
        source:
          $ref: space.yaml#/components/schemas/SpaceShort
        createdAt:
          type: string
          example: 2019-03-05 15:35:02
    ActivityContent:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 12
        guid:
          type: string
          example: 3c66dc40-6157-4b9e-a3cd-b2bdba69614d
        pinned:
          type: boolean
          example: false
        archived:
          type: boolean
          example: false
        output:
          type: string
          example: <strong>John Smith</strong> joined the space <strong>Welcome
            Space</strong>
