swagger: "2.0"

host: "rest.wonderflow.co"
basePath: "/"
schemes:
  - "https"

info:
  description: |
    [Read the introduction to the API](https://developers.wonderflow.co/api)

    [Contact the technical support](mailto:hello@wonderflow.co)
  version: 1.0.0
  title: Wonderflow REST API
  contact:
    email: "dev@wonderflow.co"

tags:
  - name: Product Catalog
  - name: Analytics - Pros&Cons
  - name: Analytics - Relevance
  - name: Analytics - Rating Trend
  - name: Analytics - Rating Breakdown
  - name: Analytics - Frequency Trend
  - name: Raw Data - Consumer Feedback
  - name: Dimensions
  - name: Authentication
paths:
  /product:
    get:
      tags:
        - Product Catalog
      summary: 'List all the products available in the product catalog'
      description: ''
      parameters:
      - name: product
        in: query
        description: Product
        type: string
      - name: brand
        in: query
        description: Brand
        type: string
      - name: price-category
        in: query
        description: Price category
        type: string
      - name: division
        in: query
        description: Division
        type: string
      - name: category
        in: query
        description: Category
        type: string
      - name: type
        in: query
        description: Type
        type: string
      - name: sku
        in: query
        description: Sku
        type: string
      - name: country
        in: query
        description: Country
        type: string
      - name: channel
        in: query
        description: Channel
        type: string
      produces:
      - "application/json"
      responses:
        '200':
          description: 'OK'
          schema:
            $ref: '#/definitions/Product'
        '204':
          description: 'No Content'
          schema:
            $ref: '#/definitions/ResponseWithMessage'
        '401':
          description: 'Unauthorized'        
          schema:
            $ref: '#/definitions/ResponseWithMessage'
    post:
      tags: 
      - 'Product Catalog'
      summary: Create product data
      produces:
      - "application/json"
      responses:
        '405':
          description: 'Method Not Allowed'
    put:
      tags: 
      - 'Product Catalog'
      summary: Update product data
      produces:
      - "application/json"
      responses:
        '405':
          description: 'Method Not Allowed'
    delete:
      tags: 
      - 'Product Catalog'
      summary: Delete product data
      produces:
      - "application/json"
      responses:
        '405':
          description: 'Method Not Allowed'
  /prosCons:
    get:
      tags:
        - 'Analytics - Pros&Cons'
      summary: >-
        Find out which characteristics customers like/dislike about your
        products or services
      description: ''
      parameters:
      - name: productId
        in: query
        description: Product IDs that identifies the products to calculate analytics from, separated by comma. E.g. productId=id1,id2
        type: string
      - name: date
        in: query
        description: Date
        type: string
      - name: data-source
        in: query
        description: Data source
        type: string
      - name: sku
        in: query
        description: Sku
        type: string
      - name: country
        in: query
        description: Country
        type: string
      - name: channel
        in: query
        description: Channel
        type: string
      responses:
        '200':
          description: 'OK'
          schema:
            $ref: '#/definitions/ProsCons'
        '204':
          description: 'No Content'
          schema:
            $ref: '#/definitions/ResponseWithMessage'
        '401':
          description: 'Unauthorized'        
          schema:
            $ref: '#/definitions/ResponseWithMessage'
    post:
      tags:
      - Analytics - Pros&Cons
      summary: Create prosCons data
      responses:
        '405':
          description: Method Not Allowed
    put:
      tags:
      - Analytics - Pros&Cons
      summary: Update prosCons data
      responses:
        '405':
          description: Method Not Allowed
    delete:
      tags:
      - Analytics - Pros&Cons
      summary: Delete prosCons data
      responses:
        '405':
          description: Method Not Allowed
  /token:
    post:
      tags:
        - Authentication
      summary: Auth
      description: ''
      parameters:
      - name: apiKey
        in: query
        description: Api Key
        type: string
      - name: apiSecret
        in: query
        description: Api Secret
        type: string
      responses:
        '200':
          description: 'OK'
          schema:
            $ref: '#/definitions/LoginResponse'
        '401':
          description: 'Unauthorized'        
          schema:
            $ref: '#/definitions/ResponseWithMessage'
externalDocs:
  description: Find out more about Wonderflow
  url: 'https://wonderflow.co'
definitions:
  Product:
    type: "object"
    properties:
      id:
        type: "string"
  ResponseWithMessage:
    type: "object"
    properties:
      message:
        type: "string"
  LoginResponse:
    type: "object"
    properties:
      token:
        type: "string"
  ProsCons:
    type: "object"
    properties:
      numberOfFeedback:
        type: integer
        format: int32