openapi: 3.0.3
info:
  title: Squirro Community Data Augmentation API
  description: >-
    This is an API description doc based on the OpenAPI 3.0 specification for
    augmenting community data within Squirro.
  termsOfService: 'https://squirro.com/general-terms-conditions/'
  contact:
    email: support@squirro.com
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  version: 1.0.11
externalDocs:
  description: Find out more about Squirro
  url: 'https://docs.squirro.com/en/latest/technical/communities/augmentation.html'
tags:
  - name: data
    description: Operations for fetching data in single and bulk mode.
paths:
  /data/batch:
    post:
      tags:
        - data
      summary: Fetch augmented data in bulk
      description: >-
        Returns augmented data for list of communities matching a facet and
        facet_value
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Community'
              example:
                - community_id: Abdrgjsdj09831Oda
                  name: Jon Snow
                  facet: email
                  facet_value: jon.snow@example.com
                  context: result_list
                - community_id: Abdrgjsdj09831Odb
                  name: Sansa Stark
                  facet: email
                  facet_value: sansa.stark@example.com
                  context: result_list
                - community_id: Abdrgjsdj09831Odc
                  name: House Lannister
                  facet: company
                  facet_value: house_lannister
                  context: result_list
      responses:
        '200':
          description: >-
            Successful operation, returning a dictionary of dictionaries mapping
            each community_id to the additional data
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/ApiResponse'
        '400':
          description: Invalid input
        '404':
          description: Resource not found
        '405':
          description: Validation exception
        '500':
          description: Generic server exception
        default:
          description: successful operation
components:
  schemas:
    Community:
      type: object
      required:
        - community_id
        - name
        - facet
        - facet_value
      properties:
        community_id:
          type: string
          description: Unique community id
          example: Abdrgjsdj09831Oda
        name:
          type: string
          description: Name of the community
          example: Jon Snow
        facet:
          type: string
          description: >-
            Facet or community_type to which the facet_value or community
            belongs to
          example: email
        facet_value:
          type: string
          description: Facet_value or community for which the augmented data is required
          example: jon.snow@example.com
        context:
          type: string
          description: >-
            The context or the location/widget from where the API is requested,
            this argument can be used to filter down the extent of information
            to be returned. This is an optional parameter and can be expanded
            upon based on the level of finesse or verbosity we require at
            different parts of the platform.
          example: result_list
    User:
      type: object
      required:
        - name
      properties:
        id:
          type: integer
          format: int64
          example: 10
        username:
          type: string
          example: theUser
        name:
          type: string
          example: Jon Snow
        photo:
          type: string
          example: www.xyz.com
        title:
          type: string
          example: Lord Commander of the Night's Watch
        phone:
          type: string
          example: '12345'
        social:
          $ref: '#/components/schemas/Social'
        contact:
          $ref: '#/components/schemas/Contact'
        roles:
          $ref: '#/components/schemas/Role'
        projects:
          $ref: '#/components/schemas/Project'
        additional_info:
          type: string
          example: Jon Snow is a Business executive with... and organizational apps.
      xml:
        name: user
    Address:
      type: object
      properties:
        street:
          type: string
          example: 437 Lytton
        city:
          type: string
          example: Palo Alto
        state:
          type: string
          example: CA
        zip:
          type: string
          example: '94301'
      xml:
        name: address
    Social:
      type: array
      items:
        type: object
        properties:
          url:
            type: string
            example: www.example.com
          name:
            type: string
            example: Microsoft teams
    Role:
      type: array
      items:
        type: object
        properties:
          role:
            type: string
            example: Prince of Dragonstone
          expertise:
            type: array
            items:
              type: string
              example: Project Lifecycle
          language:
            type: array
            items:
              type: string
              example: EN
    Project:
      type: array
      items:
        type: object
        properties:
          name:
            type: string
            example: XYZ
          url:
            type: string
            example: www.xyz.com
    Contact:
      type: object
      properties:
        profiles:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                example: Intranet
              url:
                type: string
                example: https://intranet.example.com/
            xml:
              wrapped: true
        office:
          type: string
          example: OF123.61
        location:
          type: string
          example: Stuttgart
        extension:
          type: string
          example: 1234
        email:
          type: string
          example: jon.snow@example.com
      xml:
        name: contact
    Payload:
      type: object
      example:
        id: 10
        username: theUser
        name: Jon Snow
        photo: www.xyz.com
        title: Lord Commander of the Night's Watch
        phone: '12345'
        social:
          - url: www.example.com
            name: Microsoft teams
        contact:
          profiles:
            - name: Intranet
              url: https://intranet.example.com
          office: HN040.29
          location: Stuttgart
          extension: '1234'
          email: jon.snow@example.com
        roles:
          - role: Prince of Dragonstone
            expertise:
              - Project Lifecycle
            language:
              - EN
        projects:
          - name: XYZ
            url: https://xyz.example.com/
        additional_info: Jon Snow is a Business executive with... and organizational apps.
    ApiResponse:
      type: object
      properties:
        name:
          type: string
        photo:
          type: string
        properties:
          $ref: '#/components/schemas/Payload'
      xml:
        name: '##default'
  requestBodies:
    UserArray:
      description: List of user object
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/User'
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: ''
          scopes:
            'read:users': read your users
    api_key:
      type: apiKey
      name: api_key
      in: header
