swagger: '2.0'
info:
  version: 2.0 24/07/2016
  title: Quran Tools
  description: REST API for Quran Tools
  termsOfService: 'http://helloreverb.com/terms/'
  contact:
    name: Quran Tools API Team
    email: info@quran.tools
    url: 'http://quran.tools'
  license:
    name: Open Source with Copyright
    url: http://quran.tools
host: securewebserver.net
basePath: /jetty/qttest/rest
schemes:
  - https
#host: localhost:8080
#basePath: /QuranToolsApp/rest
consumes:
  - application/json
produces:
  - application/json
paths:
  /authors:
    get:
      tags:
         - authors
      description: Returns all authors
      produces:
        - application/json
      responses:
        '200':
          description: author response
          schema:
            type: array
            items:
              $ref: '#/definitions/author'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /chapters:
    get:
      tags:
         - chapters
      description: Returns all chapters
      produces:
        - application/json
      responses:
        '200':
          description: chapter response
          schema:
            type: array
            items:
              $ref: '#/definitions/chapter'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/chapters/{chapter_id}/authors/{author_mask}':
    get:
      tags:
         - chapters
      description: Returns all translations of the chapter for selected authors
      produces:
        - application/json
      parameters:
        - name: chapter_id
          in: path
          description: ID of the chapter which is same as the quran order.
          required: true
          type: integer
          format: int8
        - name: author_mask
          in: path
          description: A number which is obtained by bitwise OR id of selected authors.
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: verse list response
          schema:
            type: array
            items:
              $ref: '#/definitions/verse'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/chapters/{chapter_id}/authors/{author_mask}/annotations':
    get:
      tags:
         - chapters
      description: Returns the annotations for the chapter translations of selected authors.
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: chapter_id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
        - name: author_mask
          in: path
          description: A number which is obtained by bitwise OR id of selected authors.
          required: true
          type: integer
          format: int64
        - name: tags
          in: query
          description: List of tags separated by comma
          required: false
          type: string
        - name: users
          in: query
          description: List of annotation owner users separated by comma
          required: false
          type: string
        - name: circles
          in: query
          description: List of annotation owner circles separated by comma
          required: false
          type: string
      responses:
        '200':
          description: Annotation
          schema:
            type: array
            items:
              $ref: '#/definitions/annotation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/chapters/{chapter_id}/links':
    get:
      tags:
         - chapters
      description: Returns the list of the chapter verses that have links
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: chapter_id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
        - name: users
          in: query
          description: List of annotation owner users separated by comma
          required: false
          type: string
        - name: circles
          in: query
          description: List of annotation owner circles separated by comma
          required: false
          type: string
      responses:
        '200':
          description: Annotation
          schema:
            type: array
            items:
              $ref: '#/definitions/verse_link_mark'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/verses/{verse_id}/links':
    get:
      tags:
         - verses
      description: Returns the verse links related with the given verse
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: verse_id
          in: path
          description: Verse ID in the system
          required: true
          type: integer
          format: int32
        - name: users
          in: query
          description: List of link owner users separated by comma
          required: false
          type: string
        - name: circles
          in: query
          description: List of link owner circles separated by comma
          required: false
          type: string
      responses:
        '200':
          description: Verse links result
          schema:
            $ref: '#/definitions/verse_links'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/verses/{verse_id}':
    get:
      tags:
         - verses
      description: Returns the verse links related with the given verse
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: verse_id
          in: path
          description: Verse ID in the system
          required: true
          type: integer
          format: int32
        - name: users
          in: query
          description: List of link owner users separated by comma
          required: false
          type: string
        - name: circles
          in: query
          description: List of link owner circles separated by comma
          required: false
          type: string
      responses:
        '200':
          description: Verse links result
          schema:
            $ref: '#/definitions/verse_links'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/authors/{author_id}/verse/{verse_id}':
    get:
      tags:
         - authors
      description: Returns the verse translation of the author.
      produces:
        - application/json
      parameters:
        - name: author_id
          in: path
          description: Id of the author
          required: true
          type: integer
          format: int64
        - name: verse_id
          in: path
          description: 'Id of the verse in XY format where X is the chapter number, Y is the verse number filled with left zeros.'
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: translation response
          schema:
            $ref: '#/definitions/translation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /translations:
    get:
      tags:
         - translations
      description: Provides the list of translations with given constraints
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: false
          type: string
        - name: chapter
          in: query
          description: Chapter ID in the system
          required: false
          type: integer
          format: int16
        - name: author
          in: query
          description: author mask
          required: true
          type: integer
          format: int64
        - name: verse
          in: query
          description: 'verse interval in the chapter. The chapter should be given. May be "3", "3,7", "3-7"'
          required: false
          type: string
        - name: verse_keyword
          in: query
          description: keyword to be searched on translations
          required: false
          type: string
        - name: users
          in: query
          description: Comma separated List of users that owns the annotations
          required: false
          type: string
        - name: circles
          in: query
          description: 'Circles that own annotations. List of circles IDs with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: verse_tags
          in: query
          description: Comma separated list of tags that are used in verse annotations
          required: false
          type: string
        - name: inference
          in: query
          description: ID of the inference that references the verses of translations
          required: false
          type: integer
      responses:
        '200':
          description: Translation list grouped by verse
          schema:
            type: array
            items:
              $ref: '#/definitions/verse'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/translations/search_keyword':
    get:
      tags:
         - translations
      description: Provides the list of translations with language and keyword
      produces:
        - application/json
      parameters:
        - name: keyword
          in: query
          description: keyword with minimum 3 characters
          required: true
          type: string
        - name: language
          in: query
          description: code for language constraint
          required: true
          type: string
        - name: author
          in: query
          description: author mask
          required: false
          type: integer
      responses:
        '200':
          description: Translation list grouped by verse
          schema:
            type: array
            items:
              $ref: '#/definitions/verse'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/translations/{id}':
    get:
      tags:
         - translations
      description: Returns a translation based on a single ID.
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: ID of translation to fetch
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: translation response
          schema:
            $ref: '#/definitions/translation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/translations/{id}/footnotes':
    get:
      tags:
         - translations
      description: Returns the footnotes of a translation based on a single ID.
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: ID of translation to fetch
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: footnote array response
          schema:
            type: array
            items:
              type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'


  '/translations/list':
    get:
      tags:
         - translations
      description: Provides the list of translations with given author and verse list
      produces:
        - application/json
      parameters:
        - name: author
          in: query
          description: author id
          required: true
          type: integer
          format: int64
        - name: verselist
          in: query
          description: verse id list
          required: false
          type: string

      responses:
        '200':
          description: Translation list
          schema:
            type: array
            items:
              $ref: '#/definitions/translation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /users:
    post:
      tags:
         - users
      description: 'Authenticates the given facebook access token and returns internal access token. Creates a user with  Facebook information (name, email etc.) related with given Facebook access token if there is no user exists in the system with the Facebook ID. Provided system access token will be used for all REST requests that need authorization.'
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: fb_access_token
          in: formData
          description: Facebook access token obtained after FB login
          required: true
          type: string
      responses:
        '200':
          description: User info with  access token
          schema:
            $ref: '#/definitions/user_access'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    put:
       tags:
          - users
       description: 'Update user info (name, username, photo etc.)'
       consumes:
         - application/x-www-form-urlencoded
       produces:
         - application/json
       parameters:
         - name: access_token
           in: header
           description: Access token for the system
           required: true
           type: string
         - name: name
           in: formData
           description: Name of user
           required: false
           type: string
         - name: username
           in: formData
           description: Username of user
           required: false
           type: string
         - name: photo
           in: formData
           description: Photo of user
           required: false
           type: string
       responses:
         '200':
           description: Result status
           schema:
             type: string
         default:
           description: unexpected error
           schema:
             $ref: '#/definitions/errorModel'

    get:
      tags:
         - users
      description: Validates the give system access token and returns the user info
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: System access token
          required: true
          type: string
      responses:
        '200':
          description: User info with  access token
          schema:
            $ref: '#/definitions/user_access'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    delete:
      tags:
         - users
      description: Deletes the user from the system with its token
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: System access token
          required: true
          type: string
      responses:
        '200':
          description: Result status
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /users/register:
    post:
      tags:
         - users
      description: 'Creates a user with entered user info (name, email, password) if there is no user exists in the system with the given email.'
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: name
          in: formData
          description: User name
          required: true
          type: string
        - name: email
          in: formData
          description: User email
          required: true
          type: string
        - name: password
          in: formData
          description: User password
          required: true
          type: string
      responses:
        '200':
          description: Result status
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/users/login':
      post:
        tags:
           - users
        description: 'User log in with email.'
        consumes:
          - application/x-www-form-urlencoded
        produces:
          - application/json
        parameters:
          - name: email
            in: formData
            description: User email
            required: true
            type: string
          - name: password
            in: formData
            description: User password
            required: true
            type: string
        responses:
          '200':
            description: User info with  access token
            schema:
              $ref: '#/definitions/user_access'
          default:
            description: unexpected error
            schema:
              $ref: '#/definitions/errorModel'

  '/users/activate/{code}':
    get:
      tags:
         - users
      description: Activate registered user
      produces:
        - text/html
      parameters:
        - name: code
          in: path
          description: Activation Code of user registration
          required: true
          type: string
      responses:
        '200':
          description: Result status or HTML message
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  /users/reset_password:
    post:
      tags:
         - users
      description: 'Creates reset password request.'
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: email
          in: formData
          description: User email
          required: true
          type: string
      responses:
        '200':
          description: Result status
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    put:
      tags:
         - users
      description: 'Updates user password newly entered one.'
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: activation_code
          in: formData
          description: Activation Code of user registration
          required: true
          type: string
        - name: password
          in: formData
          description: User password
          required: true
          type: string
        - name: confirm_password
          in: formData
          description: User password
          required: true
          type: string
      responses:
        '200':
          description: Result status
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /users/search:
    get:
      tags:
         - users
      description: Searches for registered users
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: System access token
          required: true
          type: string
        - name: search_query
          in: query
          description: Query for user search
          required: true
          type: string
      responses:
        '200':
          description: User Search result which contains list of users.
          schema:
            $ref: '#/definitions/user_search_result'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  /users/statistics:
    get:
      tags:
         - users
      description: Provides user information
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: System access token
          required: false
          type: string
        - name: user_id
          in: query
          description: ID of the user
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: Statistics of the user.
          schema:
            $ref: '#/definitions/user_statistics'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'


  /users/friends:
    get:
      tags:
         - users
      description: Provides facebook friends of the system user. Friends are kurancalis.com users that allows user_friends permission.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: System access token
          required: true
          type: string
      responses:
        '200':
          description: User info with  access token
          schema:
            type: array
            items:
              $ref: '#/definitions/user'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /words:
    get:
      tags:
         - words
      description: Gets word list with given parameters
      produces:
        - application/json
      parameters:
        - name: word_id
          in: query
          description: ID of word
          required: false
          type: integer
          format: int32
        - name: root
          in: query
          description: Root of word
          required: false
          type: string
        - name: verse_id
          in: query
          description: ID of verse
          required: false
          type: integer
          format: int8
      responses:
        '200':
          description: Array of words
          schema:
            type: array
            items:
              $ref: '#/definitions/word_normal'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  /words/translation:
    get:
      tags:
         - words
      description: Gets word list with given parameters
      produces:
        - application/json
      parameters:
        - name: arabic
          in: query
          description: Word as Arabic
          required: false
          type: string
        - name: root_arabic
          in: query
          description: Word root as Arabic
          required: false
          type: string
        - name: author_id
          in: query
          description: Author ID
          required: false
          type: integer
          format: int64
      responses:
        '200':
          description: Array of words
          schema:
            type: array
            items:
              $ref: '#/definitions/word_translations'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /words/{id}:
    get:
      tags:
         - words
      description: Get word with id
      produces:
        - application/json
      parameters:
        - name: id
          in: path
          description: ID of word
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: Word for given ID
          schema:
            $ref: '#/definitions/word_detailed'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /allannotations_with_permissions:
    get:
      tags:
         - annotations
      description: Provides the list of annotations with given constraints. Public notes are included in the results. Also permissions are included.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
      responses:
        '200':
          description: Annotation
          schema:
            $ref: '#/definitions/annotation_with_permissions'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'
  /annotations:
    post:
      tags:
         - annotations
      description: Creates new annotation for the user
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: verseId
          in: formData
          description: Verse ID in the system
          required: true
          type: string
        - name: translationId
          in: formData
          description: Translation ID in the system
          required: true
          type: string
        - name: authorId
          in: formData
          description: Author ID in the system, if Translation ID is empty (as a default value -1) Author ID will be used to set Translation ID
          required: false
          type: integer
          format: int64
        - name: quote
          in: formData
          description: Highlighted content in the verse translation
          required: true
          type: string
        - name: content
          in: formData
          description: Comment of the user
          required: true
          type: string
        - name: colour
          in: formData
          description: Colour of the highlight
          required: true
          type: string
        - name: translationVersion
          in: formData
          description: The version of the highlighted verse
          required: false
          type: integer
          format: int8
        - name: start
          in: formData
          description: Annotation start
          required: true
          type: string
        - name: end
          in: formData
          description: Annotation end
          required: true
          type: string
        - name: startOffset
          in: formData
          description: Annotation start offset
          type: integer
          format: int32
        - name: endOffset
          in: formData
          description: Annotation end offset
          required: true
          type: integer
          format: int16
        - name: tags
          in: formData
          description: Tags with comma separated. At least 3 characters.
          required: false
          type: string
        - name: canViewCircles
          in: formData
          description: 'Circles that have access to view that annotation. List of circles IDs with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canCommentCircles
          in: formData
          description: 'Circles that have access to comment to that annotation. List of circles IDs with comma separated. canCommentCircles have also right to view. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canViewUsers
          in: formData
          description: Users that have access to view that annotation. List of users IDs with comma separated.
          required: false
          type: string
        - name: canCommentUsers
          in: formData
          description: Users that have access to comment to that annotation. List of circles IDs with comma separated. canCommentUsers have also right to view.
          required: false
          type: string
      responses:
        '200':
          description: Annotation
          schema:
            $ref: '#/definitions/annotation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    get:
      tags:
         - annotations
      description: Provides the list of annotations with given constraints. Public notes are included in the results.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: chapter
          in: query
          description: Chapter ID in the system
          required: false
          type: string
        - name: author
          in: query
          description: author mask
          required: true
          type: string
        - name: verse
          in: query
          description: 'verse interval in the chapter. The chapter should be given. May be "3", "3,7", "3-7"'
          required: false
          type: string
        - name: verse_keyword
          in: query
          description: keyword to be searched on translations
          required: true
          type: string
        - name: users
          in: query
          description: Comma separated List of users that owns the annotations
          required: true
          type: string
        - name: circles
          in: query
          description: 'The circles that own the annotations listed with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: verse_tags
          in: query
          description: Comma separated list of tags that are used in verse annotations
          required: false
          type: string
        - name: own_annotations
          in: query
          description: true if the owned annotations should be also retrieved.. false otherwise.
          required: false
          type: string
        - name: start
          in: query
          description: 'start record number for limitation. >=0'
          type: integer
          format: int16
        - name: limit
          in: query
          description: 'max number of records from start point  for limitation. >=0'
          type: integer
          format: int8
        - name: orderby
          in: query
          description: 'order criteria. the value should be time or verse. Time (update time)is descending, related verse is ascending.'
          required: false
          type: string
      responses:
        '200':
          description: Annotation
          schema:
            $ref: '#/definitions/annotation'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'
    delete:
      tags:
         - annotations
      description: Delete bulk annotations
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: annotations
          in: query
          description: Comma divided annotation IDs
          required: true
          type: string
      responses:
        '200':
         description:  success message. - OK.
         schema:
           $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/annotations/{id}':
    get:
      tags:
         - annotations
      description: Returns an annotation based on a single ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: false
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: Annotation
          schema:
            $ref: '#/definitions/annotation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    put:
      tags:
         - annotations
      description: Updates the annotation of given Id
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Id of the annotation to be updated
          required: true
          type: integer
          format: int32
        - name: verseId
          in: formData
          description: Verse ID in the system
          required: true
          type: string
        - name: translationId
          in: formData
          description: Translation ID in the system
          required: true
          type: string
        - name: quote
          in: formData
          description: Highlighted content in the verse translation
          required: true
          type: string
        - name: content
          in: formData
          description: Comment of the user
          required: true
          type: string
        - name: colour
          in: formData
          description: Colour of the highlight
          required: true
          type: string
        - name: translationVersion
          in: formData
          description: The version of the highlighted verse
          required: false
          type: integer
          format: int8
        - name: start
          in: formData
          description: Annotation start
          required: true
          type: string
        - name: end
          in: formData
          description: Annotation end
          required: true
          type: string
        - name: startOffset
          in: formData
          description: Annotation start offset
          type: integer
          format: int32
        - name: endOffset
          in: formData
          description: Annotation end offset
          required: true
          type: integer
          format: int32
        - name: tags
          in: formData
          description: Tags with comma separated. At least 3 characters.
          required: false
          type: string
        - name: canViewCircles
          in: formData
          description: 'Circles that have access to view that annotation. List of circles IDs with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canCommentCircles
          in: formData
          description: 'Circles that have access to comment to that annotation. List of circles IDs with comma separated. canCommentCircles have also right to view. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canViewUsers
          in: formData
          description: Users that have access to view that annotation. List of users IDs with comma separated.
          required: false
          type: string
        - name: canCommentUsers
          in: formData
          description: Users that have access to comment to that annotation. List of circles IDs with comma separated. canCommentUsers have also right to view.
          required: false
          type: string
      responses:
        '200':
          description: Annotation
          schema:
            $ref: '#/definitions/annotation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    delete:
      tags:
         - annotations
      description: Deletes an annotation based on a single ID. All tags and comments related with the annotation will be deleted
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: Annotation
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/annotations/{id}/permissions':
    get:
      tags:
         - annotations
      description: Returns the permissions of an annotation based on a single ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: Annotation permissions
          schema:
            $ref: '#/definitions/annotation_permissions'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/annotations/{id}/comments/{comment_id}':
    put:
      tags:
         - annotations
         - comments
      description: Updates a comment on an annotation.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
        - name: content
          in: formData
          description: Comment text
          required: true
          type: string
      responses:
        '200':
          description: Latest state of the comment
          schema:
            $ref: '#/definitions/annotation_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    delete:
      tags:
         - annotations
         - comments
      description: Deletes the comment of an annotation based on a single ID.
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: List of comments of the owner annotation (from root)
          schema:
            type: array
            items:
              $ref: '#/definitions/annotation_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/annotations/{id}/comments':
    get:
      tags:
         - annotations
         - comments
      description: Returns the comments of an annotation based on a single ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: Annotation
          schema:
            type: array
            items:
              $ref: '#/definitions/annotation_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - annotations
         - comments
      description: Creates a comment on an annotation based on a single ID.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: string
        - name: parent_id
          in: formData
          description: parent comment id.
          required: false
          type: string
        - name: content
          in: formData
          description: content text
          required: true
          type: string
      responses:
        '200':
          description: Latest state of the comment
          schema:
            type: array
            items:
              $ref: '#/definitions/annotation_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'


  '/annotations/{id}/votes':
    delete:
      tags:
         - annotations
         - votes
      description: Deletes the vote of the user for an annotation.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32

      responses:
        '200':
          description: Most recent vote counts for the annotation
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    get:
      tags:
         - annotations
         - votes
      description: Returns the users who vote this study.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: List of user votes for the annotation
          schema:
            type: array
            items:
              $ref: '#/definitions/user_vote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    post:
      tags:
         - annotations
         - votes
      description: Creates a vote on an annotation. Replaces previous vote if exist.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: string
        - name: content
          in: formData
          description: like or dislike
          required: true
          type: string
      responses:
        '200':
          description: Most recent vote counts for the annotation
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/annotations/{id}/comments/{comment_id}/votes':
    delete:
      tags:
         - annotations
         - votes
         - comments
      description: Deletes the vote of the user comment for an annotation.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64

      responses:
        '200':
          description: Most recent vote counts for the comment
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    get:
      tags:
         - annotations
         - votes
         - comments
      description: Returns the users who vote this comment.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: integer
          format: int32
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: List of user votes for the annotation
          schema:
            type: array
            items:
              $ref: '#/definitions/user_vote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    post:
      tags:
         - annotations
         - votes
         - comments
      description: Creates a vote on an comment. Replaces previous vote if exist.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Annotation ID in the system
          required: true
          type: string
        - name: content
          in: formData
          description: like or dislike (1/0)
          required: true
          type: integer
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: Most recent vote counts for the annotation
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'


  /annotations/tags:
    get:
      tags:
         - annotations
         - tags
      description: Provides the verse tags combined from annotations for given constraints.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: chapter
          in: query
          description: Chapter ID in the system. Provides the tags for the verses in the chapter. Only one of chapter or verse parameters can be used
          required: false
          type: string
        - name: verses
          in: query
          description: Comma separated verse IDs. Only one of chapter or verses parameters can be used
          required: false
          type: string
        - name: users
          in: query
          description: Comma separated List of users that owns the annotations
          required: true
          type: string
        - name: circles
          in: query
          description: 'The circles that own the annotations listed with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: own_annotations
          in: query
          description: true if the owned annotations should be also retrieved.. false otherwise.
          required: false
          type: string
      responses:
        '200':
          description: Array of verse tags that are produces from annotations
          schema:
            type: array
            items:
              $ref: '#/definitions/verse_tags'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'

  /annotations/import:
    post:
      tags:
         - annotations
      description: İmport annotations from csv file.
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: headerName
          in: query
          description: Defines whether imported CVS has header or not
          required: false
          type: string
        - name: canViewCircles
          in: query
          description: Defines shared circles of imported annotations
          required: false
          type: string
        - name: file
          in: formData
          description: 'File data'
          required: true
          type: file
      responses:
        '200':
          description:  success message. - OK.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'

  /annotations/export:
    get:
      tags:
         - annotations
      description: Provides the verse tags combined from annotations for given constraints.
      produces:
        - application/json
        - application/octet-stream
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: remove_carriage
          in: query
          description: To remove carriage return between columns
          required: false
          type: string
        - name: column_name
          in: query
          description: Define whether exported CVS has header or not
          required: false
          type: string
      responses:
        '200':
          description:  success message. - OK.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'

  /inferences:
    post:
      tags:
         - inferences
      description: Creates new inference for the user
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: title
          in: formData
          description: Title of the inference
          required: true
          type: string
        - name: image
          in: formData
          description: Image of the inference to give brief info
          required: false
          type: string
        - name: content
          in: formData
          description: Content of the inference
          required: true
          type: string
        - name: tags
          in: formData
          description: Tags with comma separated. At least 3 characters.
          required: false
          type: string
        - name: canViewCircles
          in: formData
          description: 'Circles that have access to view that inference. List of circles IDs with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canCommentCircles
          in: formData
          description: 'Circles that have access to comment to that inference. List of circles IDs with comma separated. canCommentCircles have also right to view. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canViewUsers
          in: formData
          description: Users that have access to view that inference. List of users IDs with comma separated.
          required: false
          type: string
        - name: canCommentUsers
          in: formData
          description: Users that have access to comment to that inference. List of circles IDs with comma separated. canCommentUsers have also right to view.
          required: false
          type: string
      responses:
        '200':
          description: inference
          schema:
            $ref: '#/definitions/inference'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    get:
      tags:
         - inferences
      description: Provides the list of inferences with given constraints
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: keyword
          in: query
          description: Keyword to search in inference
          required: false
          type: string
        - name: users
          in: query
          description: Comma separated List of users that owns the inferences
          required: true
          type: string
        - name: circles
          in: query
          description: 'The circles that own the inferences listed with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: tags
          in: query
          description: Comma separated list of tags that are used in verse inferences
          required: false
          type: string
        - name: own_inferences
          in: query
          description: true if the owned inferences should be also retrieved.. false otherwise.
          required: false
          type: string
        - name: reference_to_verse
          in: query
          description: verse ID that the inference makes reference
          required: false
          type: integer
          format: int16
        - name: start
          in: query
          description: 'start record number for limitation. >=0'
          type: integer
          format: int16
        - name: limit
          in: query
          description: 'max number of records from start point  for limitation. >=0'
          type: integer
          format: int8
      responses:
        '200':
          description: inferences that contain first 55 words of the content.
          schema:
            $ref: '#/definitions/inference'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'
  '/inferences/{id}':
    get:
      tags:
         - inferences
      description: Returns an inference based on a single ID.
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: inference that contain complete content and
          schema:
            $ref: '#/definitions/inference'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    put:
      tags:
         - inferences
      description: Updates the inference of given Id
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Id of the inference to be updated
          required: true
          type: integer
          format: int32
        - name: title
          in: formData
          description: Title of the inference
          required: true
          type: string
        - name: image
          in: formData
          description: Image of the inference to give brief info
          required: false
          type: string
        - name: content
          in: formData
          description: Content of the inference
          required: true
          type: string
        - name: tags
          in: formData
          description: Tags with comma separated. At least 3 characters.
          required: false
          type: string
        - name: canViewCircles
          in: formData
          description: 'Circles that have access to view that inference. List of circles IDs with comma separated. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canCommentCircles
          in: formData
          description: 'Circles that have access to comment to that inference. List of circles IDs with comma separated. canCommentCircles have also right to view. There are special circles; Public:-1, All circles of the user:-2'
          required: false
          type: string
        - name: canViewUsers
          in: formData
          description: Users that have access to view that inference. List of users IDs with comma separated.
          required: false
          type: string
        - name: canCommentUsers
          in: formData
          description: Users that have access to comment to that inference. List of circles IDs with comma separated. canCommentUsers have also right to view.
          required: false
          type: string
      responses:
        '200':
          description: inference
          schema:
            $ref: '#/definitions/inference'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    delete:
      tags:
         - inferences
      description: Deletes an inference based on a single ID. All tags and comments related with the inference will be deleted
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: inference
          schema:
            type: string
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/inferences/{id}/permissions':
    get:
      tags:
         - inferences
      description: Returns the permissions of an inference based on a single ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: inference permissions
          schema:
            $ref: '#/definitions/inference_permissions'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/inferences/{id}/comments/{comment_id}':
    put:
      tags:
         - inferences
         - comments
      description: Updates a comment on an inference.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
        - name: content
          in: formData
          description: Comment text
          required: true
          type: string
      responses:
        '200':
          description: Latest state of the comment
          schema:
            $ref: '#/definitions/inference_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    delete:
      tags:
         - inferences
         - comments
      description: Deletes the comment of an inference based on a single ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: List of comments of the owner inference (from root)
          schema:
            type: array
            items:
              $ref: '#/definitions/inference_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/inferences/{id}/comments':
    get:
      tags:
         - inferences
         - comments
      description: Returns the comments of an inference based on a single ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: inference
          schema:
            type: array
            items:
              $ref: '#/definitions/inference_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - inferences
         - comments
      description: Creates a comment on an inference based on a single ID.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: string
        - name: parent_id
          in: formData
          description: inference ID in the system
          required: false
          type: string
        - name: content
          in: formData
          description: inference ID in the system
          required: true
          type: string
      responses:
        '200':
          description: List of comments of the owner inference (from root)
          schema:
            type: array
            items:
              $ref: '#/definitions/inference_comment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/inferences/{id}/votes':
    delete:
      tags:
         - inferences
         - votes
      description: Deletes the vote of the user for an inference.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32

      responses:
        '200':
          description: Most recent vote counts for the inference
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    get:
      tags:
         - inferences
         - votes
      description: Returns the users who vote this study.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Inference ID in the system
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: List of user votes for the inference
          schema:
            type: array
            items:
              $ref: '#/definitions/user_vote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    post:
      tags:
         - inferences
         - votes
      description: Creates a vote on an inference. Replaces previous vote if exist.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: Inference ID in the system
          required: true
          type: string
        - name: content
          in: formData
          description: like or dislike
          required: true
          type: string
      responses:
        '200':
          description: Most recent vote counts for the inference
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'


  '/inferences/{id}/comments/{comment_id}/votes':
    delete:
      tags:
         - inferences
         - votes
         - comments
      description: Deletes the vote of the user comment for an inference.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64

      responses:
        '200':
          description: Most recent vote counts for the comment
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    get:
      tags:
         - inferences
         - votes
         - comments
      description: Returns the users who vote this comment.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: integer
          format: int32
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: List of user votes for the inference
          schema:
            type: array
            items:
              $ref: '#/definitions/user_vote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

    post:
      tags:
         - inferences
         - votes
         - comments
      description: Creates a vote on an comment. Replaces previous vote if exist.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: inference ID in the system
          required: true
          type: string
        - name: content
          in: formData
          description: like or dislike (1/0)
          required: true
          type: integer
        - name: comment_id
          in: path
          description: Comment ID in the system
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: Most recent vote counts for the inference
          schema:
            $ref: '#/definitions/vote_counts'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'



  /tags:
    get:
      tags:
         - tags
      description: Returns all tags for reference.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
      responses:
        '200':
          description: Tag response
          schema:
            type: array
            items:
              $ref: '#/definitions/tag'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/tags/{key}':
    get:
      tags:
         - tags
      description: Returns the list of tags that mach the search key
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: key
          in: path
          description: 'Search keyword. Search query will be "%a%b%c%" for key:"abc"'
          required: true
          type: string
      responses:
        '200':
          description: Tag response
          schema:
            type: array
            items:
              $ref: '#/definitions/tag'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /verse_links:
    post:
      tags:
         - verse_links
      description: Creates new directed link between two verses.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: source_verse_id
          in: formData
          description: ID of the source verse
          required: true
          type: string
        - name: target_verse_id
          in: formData
          description: ID of the target verse
          required: true
          type: string
        - name: name
          in: formData
          description: The name of the link. I can be empty or null
          required: false
          type: string
      responses:
        '200':
          description: The list of verse links of the source verse after creation.
          schema:
            $ref: '#/definitions/verse_links'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/verse_links/{id}':
    delete:
      tags:
         - verse_links
      description: deletes a specific verse_link
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the verse link to be deleted
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: The list of verse links of the source verse after deletion.
          schema:
            $ref: '#/definitions/verse_links'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  /circles:
    get:
      tags:
         - circles
      description: Get the circle list of the user.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
      responses:
        '200':
          description: The list of circles of the user after creation.
          schema:
            type: array
            items:
              $ref: '#/definitions/circle'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - circles
      description: Creates new circle for the user. Returns added circle or ERROR CIRCLE_EXISTS if circle with that name already exists.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: name
          in: formData
          description: The name of the circle
          required: true
          type: string
      responses:
        '200':
          description: The information of the added circle after creation.
          schema:
            $ref: '#/definitions/circle'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/circles/{id}':
    get:
      tags:
         - circles
      description: Get the information of the user.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: The id of the circle
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: The properties of the circle.
          schema:
            $ref: '#/definitions/circle'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    delete:
      tags:
         - circles
      description: deletes a specific circle. returns OK if successful
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the circle to be deleted
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    put:
      tags:
         - circles
      description: 'Updates the circle for the user. returns the circle whose name is updated. if circle with given name exists, returns ERROR CIRCLE_EXISTS'
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the circle to be deleted
          required: true
          type: integer
          format: int32
        - name: name
          in: formData
          description: The name of the circle
          required: true
          type: string
      responses:
        '200':
          description: The properties of the circle.
          schema:
            $ref: '#/definitions/circle'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/circles/{id}/users':
    get:
      tags:
         - circles
      description: Get the user list of the circle .
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: The id of the circle
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: The list of usersin the circle.
          schema:
            type: array
            items:
              $ref: '#/definitions/circle_user'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/circles/{id}/users/fbfriend':
    post:
      tags:
         - circles
      description: Add user to circle. Return added circle user or ERROR CIRCLE_USER_EXISTS if circle user with that user id already exists for the given circle id.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: The id of the circle
          required: true
          type: integer
          format: int32
        - name: fb_user_id
          in: formData
          description: The facebook user id of the user friend to be added
          required: true
          type: string
      responses:
        '200':
          description: The information of the added circle user.
          schema:
            $ref: '#/definitions/circle_user'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/circles/{id}/users/{user_id}':
    delete:
      tags:
         - circles
      description: deletes a specific circle. Returns OK if successful
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the circle that contain the user
          required: true
          type: integer
          format: int32
        - name: user_id
          in: path
          description: ID of the user to be removed from the circle
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  /bookmarks:
    get:
      tags:
         - bookmarks
      description: Get the bookmarks of the user.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
      responses:
        '200':
          description: The list of bookmarks of the user.
          schema:
            type: array
            items:
              $ref: '#/definitions/bookmark'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - bookmarks
      description: Creates new bookmark for the user. Returns all current bookmarks of the user.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: colour
          in: formData
          description: The colour of the bookmark
          required: true
          type: string
        - name: verseId
          in: formData
          description: The verse id that the bookmark attached.
          required: true
          type: integer
          format: int16

      responses:
        '200':
          description: The list of bookmarks after creation.
          schema:
            $ref: '#/definitions/bookmark'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  /verse_visit:
    get:
      tags:
         - history
      description: Get verse history of the user. Translations are provided according to author ID.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string

        - name: author
          in: query
          description: Author ID
          required: false
          type: integer
        - name: start
          in: query
          description: Since from date
          required: false
          type: integer
        - name: limit
          in: query
          description: max result
          required: false
          type: integer
      responses:
        '200':
          description: List of translation with their visit time.
          schema:
            type: array
            items:
              $ref: '#/definitions/verse_visit'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - history
      description: Creates new verse_visit for the user to indicate that user has visited the verse.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: verse_id
          in: formData
          description: ID of the verse that the user has visited.
          required: true
          type: integer
          format: int16

      responses:
        '200':
          description:  success message. - OK.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  /verselists:
    get:
      tags:
         - verselists
      description: Get the verselist list of the user.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
      responses:
        '200':
          description: The list of verselists of the user.
          schema:
            type: array
            items:
              $ref: '#/definitions/verselist'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - verselists
      description: Creates new verselist for the user. Returns added verselist or ERROR verselist_EXISTS if verselist with that name already exists.
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: name
          in: formData
          description: The name of the verselist
          required: true
          type: string
      responses:
        '200':
          description: The information of the added verselist after creation.
          schema:
            $ref: '#/definitions/verselist'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/verselists/{id}':
    get:
      tags:
         - verselists
      description: Get the information of the given verse list.
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: The id of the verselist
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: The properties of the verselist.
          schema:
            $ref: '#/definitions/verselist'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    delete:
      tags:
         - verselists
      description: deletes a specific verselist. returns OK if successful
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the verselist to be deleted
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    put:
      tags:
         - verselists
      description: 'Updates the verselist for the user. returns the verselist whose name is updated. if verselist with given name exists, returns ERROR verselist_EXISTS'
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the verselist to be deleted
          required: true
          type: integer
          format: int32
        - name: name
          in: formData
          description: The name of the verselist
          required: true
          type: string
      responses:
        '200':
          description: The properties of the verselist.
          schema:
            $ref: '#/definitions/verselist'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/verselists/{id}/verses':
    get:
      tags:
         - verselists
      description: Get the verses in the verselist .
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: The id of the verselist
          required: true
          type: integer
          format: int32
        - name: author_id
          in: query
          description: The id of the author for translation
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: The list of verses the verselist for selected author.
          schema:
            type: array
            items:
              $ref: '#/definitions/translation'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    delete:
      tags:
         - verselists
      description: deletes a specific verse. Returns OK if successful
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the verselist of the user that contain verses
          required: true
          type: integer
          format: int32
        - name: verse_id_set
          in: query
          description: List of verse IDs to be removed from the verselist
          required: true
          type: array
          items:
            type: integer
            format: int32
      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
    post:
      tags:
         - verselists
      description: add a specific verse to verselist. Returns OK if successful
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system
          required: true
          type: string
        - name: id
          in: path
          description: ID of the verselist of the user that contain verses
          required: true
          type: integer
          format: int32
        - name: verse_id_set
          in: formData
          description: List of verse IDs to be added to verselist
          required: true
          type: array
          items:
            type: integer
            format: int32
      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
  '/sitemap':
    get:
      tags:
         - sitemap
      description: Get the sitemap.
      produces:
        - text/xml
      responses:
        '200':
          description: The list of verses the verselist for selected author.
          schema:
            type: array
            items:
              $ref: '#/definitions/sitemap'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/feed/circle/{circle}':
    get:
      tags:
         - feed
      description: Provides the feed for given circle
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system.
          required: true
          type: string
        - name: circle
          in: path
          description: 'The circle that own the posts. There are special circles; All circles of the user:-2'
          required: true
          type: string
        - name: start
          in: query
          description: 'start time (seconds from 1970) for limitation. 0 means NOW. This value should be set to time of last record on previous page. Default:0'
          required: false
          type: integer
          format: int16
        - name: limit
          in: query
          description: 'max number of records from start point  for limitation. >=0. 10 by default. max 100.'
          required: false
          type: integer
          format: int8
        - name: orderby
          in: query
          description: 'order criteria. the value should be updated or created. It provides the records descenden update time or created time order. Default: created'
          required: false
          type: string
      responses:
        '200':
          description: 'User Study list. A user study content may be an annotation or inference.'
          schema:
            type: array
            items:
              $ref: '#/definitions/user_study'

        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'

  '/feed/user':
    get:
      tags:
        - feed
      description: Provides the feed for given user
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system. If not exist, response contains only public posts.
          required: true
          type: string
        - name: username
          in: query
          description: 'The username that own the posts. It is optional with user_id'
          required: false
          type: string
        - name: user_id
          in: query
          description: 'The user_id that own the posts. It is optional with user_id'
          required: false
          type: string
        - name: start
          in: query
          description: 'start time (seconds from 1970) for limitation. 0 means NOW. This value should be set to time of last record on previous page.'
          type: integer
          format: int16
        - name: limit
          in: query
          description: 'max number of records from start point  for limitation. >=0. 10 by default. max 100.'
          type: integer
          format: int8
        - name: orderby
          in: query
          description: 'order criteria. the value should be updated or created. It provides the records descenden update time or created time order. Default: created'
          required: false
          type: string
      responses:
        '200':
          description: 'User Study list. A user study content may be an annotation or inference.'
          schema:
            type: array
            items:
              $ref: '#/definitions/user_study'
        default:
          description: unexpected error
          schema:
            type: array
            items:
              $ref: '#/definitions/errorModel'

  '/users/recommendations':
    get:
      tags:
         - users
      description: Provides the recommended users for adding to circle
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system.
          required: true
          type: string
        - name: start
          in: query
          description: 'start record. Default:0'
          required: false
          type: integer
          format: int8
        - name: limit
          in: query
          description: 'max number of records from start record for limitation. >=0. 10 by default. max 100. If it is 0, only 3 best recommendations provided (worker,popular,facebook friend)'
          required: false
          type: integer
          format: int8

      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

  '/users/recommendations/hide':
    post:
      tags:
         - users
      description: Adds exception to recommendation list
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - name: access_token
          in: header
          description: Access token for the system.
          required: true
          type: string
        - name: user_id
          in: formData
          description: 'user_id that will be hidden'
          required: true
          type: integer
          format: int32

      responses:
        '200':
          description: 200 - OK response.
          schema:
            $ref: '#/definitions/responseMessage'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'

definitions:
  translation:
    required:
      - id
      - verseId
      - content
      - author_id
    properties:
      id:
        type: integer
        format: int32
      author_id:
        type: integer
        format: int64
      verseId:
        type: integer
        format: int32
      content:
        type: string
      version:
        type: integer
        format: int8
  chapter:
    required:
      - id
      - name_tr
      - name_en
    properties:
      id:
        type: integer
        format: int8
      name_tr:
        type: string
      name_en:
        type: string
  verse:
    required:
      - id
      - translations
    properties:
      id:
        type: integer
        format: int32
      translations:
        type: array
        items:
          $ref: '#/definitions/translation'
  author:
    required:
      - id
      - title
      - name
      - language
      - color
    properties:
      id:
        type: integer
        format: int64
      title:
        type: string
      name:
        type: string
      language:
        type: string
      color:
        type: integer
        format: int16
  annotation:
    required:
      - id
      - verse_id
      - translation_id
      - quote
      - content
      - colour
      - translation_version
      - start
      - end
      - start_offset
      - end_offset
      - tags
      - right_to_comment
      - vote_counts
      - comment_count
    properties:
      id:
        type: integer
        format: int64
      verse_id:
        type: string
      translation_id:
        type: string
      quote:
        type: string
      content:
        type: string
      colour:
        type: string
      translation_version:
        type: integer
        format: int8
      start:
        type: string
      end:
        type: string
      start_offset:
        type: integer
        format: int32
      end_offset:
        type: integer
        format: int8
      tags:
        type: array
        items:
          $ref: '#/definitions/tag'
      right_to_comment:
        type: integer
        format: int4
      vote_counts:
        $ref: '#/definitions/vote_counts'
      comment_count:
        type: integer

  annotation_with_permissions:
    required:
      - id
      - verse_id
      - translation_id
      - quote
      - content
      - colour
      - translation_version
      - start
      - end
      - start_offset
      - end_offset
      - tags
      - right_to_comment
      - vote_counts
      - comment_count
      - permissions
    properties:
      id:
        type: integer
        format: int64
      verse_id:
        type: string
      translation_id:
        type: string
      quote:
        type: string
      content:
        type: string
      colour:
        type: string
      translation_version:
        type: integer
        format: int8
      start:
        type: string
      end:
        type: string
      start_offset:
        type: integer
        format: int32
      end_offset:
        type: integer
        format: int8
      tags:
        type: array
        items:
          $ref: '#/definitions/tag'
      right_to_comment:
        type: integer
        format: int4
      vote_counts:
        $ref: '#/definitions/vote_counts'
      comment_count:
        type: integer
      permissions:
        $ref: '#/definitions/annotation_permissions'

  annotation_comment:
    required:
      - id
      - parent_id
      - content
      - comments
      - created
      - updated
      - vote_counts
      - comment_count
    properties:
      id:
        type: integer
        format: int64
      parent_id:
        type: integer
        format: int64
      content:
        type: string
      comments:
        type: array
        items:
          $ref: '#/definitions/annotation_comment'
      created:
        type: string
      updated:
        type: string
      vote_counts:
        $ref: '#/definitions/vote_counts'
      comment_count:
        type: integer
  inference:
    required:
      - id
      - user_id
      - title
      - image
      - content
      - tags
      - created
      - right_to_comment
      - references
      - vote_counts
      - comment_count
    properties:
      id:
        type: integer
        format: int64
      user_id:
        type: integer
        format: int64
      title:
        type: string
      image:
        description: the name of the image file for the inference.
        type: string
      content:
        type: string
      tags:
        type: array
        items:
          $ref: '#/definitions/tag'
      right_to_comment:
        type: integer
        format: int4
      created:
        type: string
      references:
        type: array
        items:
          type: integer
      vote_counts:
        $ref: '#/definitions/vote_counts'
      comment_count:
        type: integer

  inference_comment:
    required:
      - id
      - parent_id
      - content
      - comments
      - created
      - updated
      - vote_counts
      - comment_count
    properties:
      id:
        type: integer
        format: int64
      parent_id:
        type: integer
        format: int64
      content:
        type: string
      comments:
        type: array
        items:
          $ref: '#/definitions/inference_comment'
      created:
        type: string
      updated:
        type: string
      vote_counts:
        $ref: '#/definitions/vote_counts'
      comment_count:
        type: integer
  tag:
    required:
      - id
      - name
    properties:
      id:
        type: integer
        format: int32
      name:
        type: string
  verse_link_mark:
    required:
      - verse
      - link_type
    properties:
      verse:
        type: integer
        format: int32
      link_type:
        type: string
  verse_links:
    required:
      - incoming
      - outgoing
      - context
    properties:
      incoming:
        type: array
        items:
          $ref: '#/definitions/translation'
      outgoing:
        type: array
        items:
          $ref: '#/definitions/translation'
      context:
        type: array
        items:
          $ref: '#/definitions/translation'
  circle:
    required:
      - id
      - name
      - user_count
    properties:
      id:
        type: integer
        format: int32
      name:
        type: string
      user_count:
        type: integer
        format: int16
  sitemap:
    properties:
      data:
        type: array
        items:
          $ref: '#/definitions/link'
  link:
    properties:
      url:
        type: string

  circle_user:
    required:
      - user_id
      - fbId
      - name
      - photo
      - username
    properties:
      user_id:
        type: integer
        format: int32
      fbId:
        type: string
      name:
        type: string
      photo:
        type: string
      username:
        type: string

  verselist:
    required:
      - id
      - name
      - verse_count
    properties:
      id:
        type: integer
        format: int32
      name:
        type: string
      verse_count:
        type: integer
        format: int16

  user_access:
    required:
      - token
      - user
    properties:
      user:
        $ref: '#/definitions/user'
      token:
        type: string
  user_search_result:
    required:
      - users
    properties:
      users:
        type: array
        items:
          $ref: '#/definitions/user'
  user:
    required:
      - id
      - fbId
      - name
      - photo
      - username
    properties:
      id:
        type: integer
        format: int32
      fbId:
        type: string
      name:
        type: string
      photo:
        type: string
      username:
        type: string

  user_statistics:
    required:
      - id
      - fbId
      - name
      - photo
      - created
      - username
      - annotation_count
      - inference_cont
      - circle_friend_count
      - follower_count

    properties:
      id:
        type: integer
        format: int32
      fbId:
        type: string
      name:
        type: string
      photo:
        type: string
      username:
        type: string
      annotation_count:
        type: integer
        format: int32
      inference_cont:
        type: integer
        format: int32
      circle_friend_count:
        type: integer
        format: int32
      follower_count:
        type: integer
        format: int32
      created:
        type: integer
        format: int32


  errorModel:
    required:
      - code
      - message
    properties:
      code:
        type: integer
        format: int32
      message:
        type: string
  responseMessage:
    required:
      - code
      - message
    properties:
      code:
        type: integer
        format: int32
      message:
        type: string
  permission:
    required:
      - id
      - name
    properties:
      id:
        type: integer
        format: int32
      name:
        type: string
  annotation_permissions:
    required:
      - canViewCircles
      - canViewUsers
      - canCommentCircles
      - canCommentUsers
    properties:
      canViewCircles:
        type: array
        items:
          $ref: '#/definitions/permission'
      canViewUsers:
        type: array
        items:
          $ref: '#/definitions/permission'
      canCommentCircles:
        type: array
        items:
          $ref: '#/definitions/permission'
      canCommentUsers:
        type: array
        items:
          $ref: '#/definitions/permission'
  verse_tags:
    required:
      - verse_id
      - tags
    properties:
      verse_id:
        type: integer
      tags:
        type: array
        items:
          type: string
  inference_permissions:
    required:
      - canViewCircles
      - canViewUsers
      - canCommentCircles
      - canCommentUsers
    properties:
      canViewCircles:
        type: array
        items:
          $ref: '#/definitions/permission'
      canViewUsers:
        type: array
        items:
          $ref: '#/definitions/permission'
      canCommentCircles:
        type: array
        items:
          $ref: '#/definitions/permission'
      canCommentUsers:
        type: array
        items:
          $ref: '#/definitions/permission'
  bookmark:
    required:
      - userId
      - verseId
      - colour
      - created
    properties:
      userId:
        type: integer
      verseId:
        type: integer
      colour:
        type: string
      created:
        type: string

  verse_visit:
    required:
      - translation
      - duration
      - created
    properties:
      translation:
        $ref: '#/definitions/translation'
      duration:
        type: integer
      created:
        type: integer

  user_study:
    required:
      - id
      - study_type
      - owner_id
      - owner_name
      - anno_verse_id
      - anno_author_id
      - anno_translation_id
      - anno_quote
      - anno_colour
      - anno_start_offset
      - anno_end_offset
      - inf_title
      - inf_image
      - content
      - tags
      - right_to_comment
      - created
      - updated
      - vote_counts
      - comment_count

    properties:
      id:
        type: integer
        format: int64
      study_type:
        type: string
        description: 'inference or highlight'
      owner_id:
        type: integer
        format: int32
      owner_name:
        type: string
      anno_verse_id:
        type: integer
        format: int32
      anno_author_id:
        type: integer
        format: int64
      anno_translation_id:
        type: integer
        format: int32
      anno_quote:
        type: string
      anno_colour:
        type: string
      anno_start_offset:
        type: integer
        format: int32
      anno_end_offset:
        type: integer
        format: int8
      inf_title:
        type: string
      inf_image:
        type: string
      content:
        type: string
      tags:
        type: array
        items:
          $ref: '#/definitions/tag'
      right_to_comment:
        type: integer
        format: int4
      created:
        type: integer
        format: int32
      updated:
        type: integer
        format: int32
      vote_counts:
        $ref: '#/definitions/vote_counts'
      comment_count:
        type: integer


  user_vote:
    required:
      - vote
      - user
    properties:
      user:
        $ref: '#/definitions/user'
      vote:
        type: string
  
  vote_counts:
    required:
      - like
      - dislike
    properties:
      like:
        type: integer
      dislike:
        type: integer  

  word_normal:
    required:
      - word_id
      - chapter
      - verse_id
      - word_order
      - arabic
      - transcript_turkish
      - turkish
      - root_arabic
      - root_transcript
      - transcript_english
      - english
    properties:
      word_id:
        type: integer
        format: int32
      chapter:
        type: integer
        format: int8
      verse:
        type: integer
        format: int8
      word_order:
        type: integer
        format: int8
      arabic:
        type: string
      transcript_turkish:
        type: string
      turkish:
        type: string
      root_arabic:
        type: string
      root_transcript:
        type: string
      transcript_english:
        type: string
      english:
        type: string

  word_detailed:
    required:
      - word_id
      - verse_id
      - chapter
      - verse
      - word_order
      - arabic
      - transcript
      - arabic_enhanced
      - transcript_turkish
      - turkish
      - turkish2
      - root_arabic
      - root_transcript
      - root_english
      - transcript_english
      - english
      - letters
      - numeric_values
      - X4
      - X5
    properties:
      word_id:
        type: integer
        format: int32
      verse_id:
        type: integer
        format: int8
      chapter:
        type: integer
        format: int8
      verse:
        type: integer
        format: int8
      word_order:
        type: integer
        format: int8
      arabic:
        type: string
      transcript:
        type: string
      arabic_enhanced:
        type: string
      transcript_turkish:
        type: string
      turkish:
        type: string
      turkish2:
        type: string
      root_arabic:
        type: string
      root_transcript:
        type: string
      root_english:
        type: string
      transcript_english:
        type: string
      english:
        type: string
      letters:
        type: string
      numeric_values:
        type: string
      X4:
        type: string
      X5:
        type: string

  word_translations:
    required:
      - words
      - translations
    properties:
      words:
        type: array
        items:
           $ref: '#/definitions/word_normal'
      translations:
        type: array
        items:
          $ref: '#/definitions/translation'