Updated API docs

Updated API docs

#%RAML 0.8
title: Internal API v1.0
version: 2
baseUri: http://internal.dev/api/v2/

securitySchemes:
  - oauth_2_0:
      description: Most of the API access is secured with OAuth 2.0
      type: OAuth 2.0
      describedBy:
        headers:
          Authorization:
            description: Used to send a valid OAuth 2 access token.
            type: string
        responses:
          401:
            description: FU!
      settings:
        authorizationUri: http://internal.dev/api/v2/oauth/meep
        accessTokenUri: http://internal.dev/api/v2/oauth/access_token
        authorizationGrants: [ owner ]
        scopes:
          - "user"
          - "user:email"
          - "user:follow"
          - "public_repo"
          - "repo"
          - "repo:status"
          - "delete_repo"
          - "notifications"
          - "gist"

traits:
  - paged:
      queryParameters:
        page:
          description: The number of the page to load
          required: false
          type: integer
        per_page:
          description: The number of entities per page
          required: false
          type: integer
  - sortable:
      description: Sort
      queryParameters:
        sort_by:
          description: Specify the name of the column that should be used for sorting. If no column is specified the default sorting will apply.
          required: false
          type: string
        sort_order:
          description: Specify is the sorting should be ascending or descending.
          required: false
          type: string
          enum: [asc, desc]
  - searchable:
      queryParameters:
        search:
          description: A freetext search on most columns.
          required: false
          type: string
  - relations:
      queryParameters:
        relations:
          description: Filter on relations to other entities.
          required: false
          type: string

securedBy: [ oauth_2_0 ]
/economy/{accountingperiod}:
  /masterledger:
    get:
      description: Receives the full master ledger

  /account:
    description: Manage accounting accounts
    get:
      is: [ paged ]
      description: This call returns an list of all accounts
    post:
      description: Creates a new account
      queryParameters:
        account_number:
          description: Account number
          type: integer
          required: true
          example: 3890
        title:
          description: Account title
          type: string
          required: true
          example: Medlemsintäkter
        description:
          description: Account description
          type: string
          example: Innehåller endast medlemsavgifter för årsmedlemskap
    /{account_id}:
      description: Returns an invidual account
      get:
        description: Returns an account specified by account_id
      put:
        description: Updates an account specified by account_id
        queryParameters:
          account_number:
            description: Account number
            type: integer
            example: 3890
          title:
            description: Account title
            type: string
            example: Medlemsintäkter
          description:
            description: Account description
            type: string
            example: Innehåller endast medlemsavgifter för årsmedlemskap
      delete:
        description: Deletes an account specified by account_id

  /costcenter:
    is: [ paged ]
    description: Manage cost centers
    get:
      description: Returns a list of all cost centers
    post:
      description: Create a new cost center
    /{costcenter_id}:
      description: Manage a single cost center
      get:
        description: Returns a single cost center
      put:
        description: Updates a cost center
      delete:
        description: Deletes a cost center

  /instruction:
    is: [ paged ]
    description: Manage accounting instructions
    get:
      description: Returns a list of all accounting instructions
      queryParameters:
        account_id:
          description: Filter instruction with a transaction to or from the specified account_id
          type: integer
    post:
      body:
        application/json:
          schema: |
            {
                "$schema": "http://json-schema.org/draft-03/schema",
                "type": "object",
                "properties": {
                  "last_read_at": {
                    "description": "Describes the last point that notifications were checked. Anything updated since this time will not be updated. Default: Now.",
                    "type": "string"
                  }
                }
            }
      responses:
        205:
          description: Marked as read.
    /{instruction_id}:
      description: Manage a single accounting instructions
      get:
        description: Returns a single accounting instructions
      put:
        description: Updates a accounting instructions
      delete:
        description: Deletes a accounting instructions

  /transaction:
    is: [ paged ]
    description: Manage accounting transactions
    get:
      description: Returns a list of all accounting transactions
      queryParameters:
        account_id:
          description: Filter transactions to or from the specified account_id
          type: integer
    post:
      description: Create
    /{instruction_id}:
      description: Manage a single accounting transactions
      get:
        description: Returns a single accounting transactions
      put:
        description: Updates a accounting transactions
      delete:
        description: Deletes a accounting transactions

  /invoice:
    is: [ paged ]
    description: Manage invoices
    get:
      description: Returns a list of all invoices
    post:
      description: Create invoice
    /{invoice_id}:
      description: Manage a single invoice
      get:
        description: Returns an invoice
      put:
        description: Updates an invoice
      delete:
        description: Deletes an invoice
      /export:
        get:
          description: Export *.odt

  /valuationreport:
    get:
      description: Valuation report
  /resultreport:
    get:
      description: Valuation report

  /file/{external_id}/{filename}:
    get:
      description: Get attached file

/mail:
  description: Mail
  get:
    is: [ paged, sortable, searchable, relations ]
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model
  /send:
    post:
      description: Add E-mail to send queue

/rfid:
  description: RFID
  get:
    is: [ paged, sortable, searchable, relations ]
    description: Get collection
    queryParameters:
      filter_active:
        description: Filters on the "active" column
        required: false
        type: string
        enum: [yes,no,auto]
      filter_tagid:
        description: Filters on the "tagid" column
        required: false
        type: string
        enum: [yes,no,auto]
      filter_startdate:
        description: Filters on the "startdate" column
        required: false
        type: date
      filter_enddate:
        description: Filters on the "enddate" column
        required: false
        type: date
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/subscription:
  description: Subscription
  get:
    is: [ paged, sortable, searchable, relations ]
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/product:
  description: product
  get:
    is: [ paged, sortable, searchable, relations ]
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/group:
  description: Groups
  get:
    is: [ paged, sortable, searchable, relations ]
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/sales:
  description: Sales
  /history:
    description: Sales history
    get:
      is: [ paged, sortable, searchable, relations ]
      description: Get collection
    post:
      description: Create model
    /{entity_id}:
      get:
        description: Read model
      put:
        description: Update model
      delete:
        description: Delete model

/import:
  description: Import

/member:
  description: Manage single member accounts
  get:
    is: [ paged, sortable, searchable, relations ]
    description: Returns a list of all members
  post:
    description: Create a new member
  /{member_id}:
    description: Manage a single member
    get:
      description: Returns a single member
    put:
      description: Updates a member
    delete:
      description: Deletes a member
  /search:
    post:
      description: Fulltext search

#%RAML 0.8
title: Internal API v1.0
version: 2
baseUri: http://internal.dev/api/v2/

securitySchemes:
  - oauth_2_0:
      description: OAuth 2.0
      type: OAuth 2.0
      describedBy:
        headers:
          Authorization:
            description: Used to send a valid OAuth 2 access token.
            type: string
        responses:
          401:
            description: FU!
      settings:
        authorizationUri: http://internal.dev/api/v2/oauth/meep
        accessTokenUri: http://internal.dev/api/v2/oauth/access_token
        authorizationGrants: [ owner ]
        scopes:
          - "user"
          - "user:email"
          - "user:follow"
          - "public_repo"
          - "repo"
          - "repo:status"
          - "delete_repo"
          - "notifications"
          - "gist"

traits:
  - paged:
      queryParameters:
        page:
          description: The number of the page to load
          type: integer
        per_page:
          description: The number of entities per page
          type: integer

securedBy: [ oauth_2_0 ]
/economy/{accountingperiod}:
  /masterledger:
    get:
      description: Receives the full master ledger

  /account:
    description: Manage accounting accounts
    get:
      is: [ paged ]
      description: This call returns an list of all accounts
    post:
      description: Creates a new account
      queryParameters:
        account_number:
          description: Account number
          type: integer
          required: true
          example: 3890
        title:
          description: Account title
          type: string
          required: true
          example: Medlemsintäkter
        description:
          description: Account description
          type: string
          example: Innehåller endast medlemsavgifter för årsmedlemskap
    /{account_id}:
      description: Returns an invidual account
      get:
        description: Returns an account specified by account_id
      put:
        description: Updates an account specified by account_id
        queryParameters:
          account_number:
            description: Account number
            type: integer
            example: 3890
          title:
            description: Account title
            type: string
            example: Medlemsintäkter
          description:
            description: Account description
            type: string
            example: Innehåller endast medlemsavgifter för årsmedlemskap
      delete:
        description: Deletes an account specified by account_id

  /costcenter:
    is: [ paged ]
    description: Manage cost centers
    get:
      description: Returns a list of all cost centers
    post:
      description: Create a new cost center
    /{costcenter_id}:
      description: Manage a single cost center
      get:
        description: Returns a single cost center
      put:
        description: Updates a cost center
      delete:
        description: Deletes a cost center

  /instruction:
    is: [ paged ]
    description: Manage accounting instructions
    get:
      description: Returns a list of all accounting instructions
      queryParameters:
        account_id:
          description: Filter instruction with a transaction to or from the specified account_id
          type: integer
    post:
      body:
        application/json:
          schema: |
            {
                "$schema": "http://json-schema.org/draft-03/schema",
                "type": "object",
                "properties": {
                  "last_read_at": {
                    "description": "Describes the last point that notifications were checked. Anything updated since this time will not be updated. Default: Now.",
                    "type": "string"
                  }
                }
            }
      responses:
        205:
          description: Marked as read.
    /{instruction_id}:
      description: Manage a single accounting instructions
      get:
        description: Returns a single accounting instructions
      put:
        description: Updates a accounting instructions
      delete:
        description: Deletes a accounting instructions

  /transaction:
    is: [ paged ]
    description: Manage accounting transactions
    get:
      description: Returns a list of all accounting transactions
      queryParameters:
        account_id:
          description: Filter transactions to or from the specified account_id
          type: integer
    post:
      description: Create
    /{instruction_id}:
      description: Manage a single accounting transactions
      get:
        description: Returns a single accounting transactions
      put:
        description: Updates a accounting transactions
      delete:
        description: Deletes a accounting transactions

  /invoice:
    is: [ paged ]
    description: Manage invoices
    get:
      description: Returns a list of all invoices
    post:
      description: Create invoice
    /{invoice_id}:
      description: Manage a single invoice
      get:
        description: Returns an invoice
      put:
        description: Updates an invoice
      delete:
        description: Deletes an invoice
      /export:
        get:
          description: Export *.odt

  /valuationreport:
    get:
      description: Valuation report
  /resultreport:
    get:
      description: Valuation report

  /file/{external_id}/{filename}:
    get:
      description: Get attached file

/mail:
  description: Mail
  get:
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model
  /send:
    post:
      description: Add E-mail to send queue

/rfid:
  description: RFID
  get:
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/subscription:
  description: Subscription
  get:
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/product:
  description: product
  get:
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/group:
  description: Groups
  get:
    description: Get collection
  post:
    description: Create model
  /{entity_id}:
    get:
      description: Read model
    put:
      description: Update model
    delete:
      description: Delete model

/sales:
  description: Sales
  /history:
    description: Sales history
    get:
      description: Get collection
    post:
      description: Create model
    /{entity_id}:
      get:
        description: Read model
      put:
        description: Update model
      delete:
        description: Delete model

/import:
  description: Import

/member:
  description: Manage single member accounts
  get:
    description: Returns a list of all members
  post:
    description: Create a new member
  /{member_id}:
    description: Manage a single member
    get:
      description: Returns a single member
    put:
      description: Updates a member
    delete:
      description: Deletes a member
  /search:
    post:
      description: Fulltext search


Update urls

Update urls

#%RAML 0.8
title: Mule Store
version: 1.0.0
baseUri: http://devkit-cookbook.cloudhub.io/rest
schemas:
- ingredient: !include mule-ingredient.schema
- recipe: !include mule-recipe.schema
traits:
- searchable:
    queryParameters:
      query:
        required: false
        description: The Query to be processed
      pageSize:
        required: false
        default:  5
        description: Page to retrieve
      page:
        required: false
        description: Current Page
- secured:
    headers:
      token:
        description: Send this header with the secret token
        example: 71543fa6a11044b0a9f3a8354ddcb00e
resourceTypes:
- entity:
    description: Collection of available <<resourcePathName>> in Jukebox.
    get:
      description: Get a list of <<resourcePathName>>.
      is: [searchable,secured]
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleCollection>>
    post:
      description: Creates a <<resourcePathName|!singularize>>.
      is: [secured]
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleItem>>
- entity-item:
    description: Entity representing a <<resourcePathName|!singularize>>
    get:
      description: |
        Get the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      is: [searchable,secured]
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleItem>>
    put:
      description: |
        Add a new <<resourcePathName|!singularize>>
      is: [secured]
      body:
        application/json:
          example: |
            <<exampleItem>>
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleItem>>
    delete:
      description: |
        Deletes a <<resourcePathName|!singularize>>.
      is: [secured]
      responses:
        200:
           body:
             application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
- bulk-api:
    description: Handle multiple <<entityType>> in a single request
    get:
      description: Deletes a list of <<entityType>>
      is: [secured]
      responses:
        200:
          body:
            application/json:
    post:
      description: Creates a list of <<entityType>>
      responses:
        200:
          body:
            application/json:
    put:
      description: Updates a list of <<entityType>>
      is: [secured]
      responses:
        200:
          body:
            application/json:
    delete:
      description: Deletes a list of <<entityType>>
      is: [secured]
      responses:
        200:
          body:
            application/json:
/ingredient:
  type:
    entity:
      exampleCollection: !include mule-ingredient-collection.sample
      exampleItem: !include mule-ingredient.sample
  /{id}:
    type:
      entity-item:
        exampleItem: !include mule-ingredient.sample
  /bulk:
    type:
      bulk-api:
        entityType: ingredient
/recipe:
  type:
    entity:
      exampleCollection: !include mule-ingredient-collection.sample
      exampleItem: !include mule-ingredient.sample
  /{id}:
    type:
      entity-item:
        exampleItem: !include mule-ingredient.sample
  /bulk:
    type:
      bulk-api:
        entityType: recipe

#%RAML 0.8
title: Mule Store
version: 1.0.0
baseUri: http://server/api/{version}
schemas:
- ingredient: !include mule-ingredient.schema
- recipe: !include mule-recipe.schema
traits:
- searchable:
    queryParameters:
      query:
        required: false
        description: The Query to be processed
      pageSize:
        required: false
        default:  5
        description: Page to retrieve
      page:
        required: false
        description: Current Page
- secured:
    headers:
      token:
        description: Send this header with the secret token
        example: 71543fa6a11044b0a9f3a8354ddcb00e
resourceTypes:
- entity:
    description: Collection of available <<resourcePathName>> in Jukebox.
    get:
      description: Get a list of <<resourcePathName>>.
      is: [searchable,secured]
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleCollection>>
    post:
      description: Creates a <<resourcePathName|!singularize>>.
      is: [secured]
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleItem>>
- entity-item:
    description: Entity representing a <<resourcePathName|!singularize>>
    get:
      description: |
        Get the <<resourcePathName|!singularize>>
        with <<resourcePathName|!singularize>>Id =
        {<<resourcePathName|!singularize>>Id}
      is: [searchable,secured]
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleItem>>
    put:
      description: |
        Add a new <<resourcePathName|!singularize>>
      is: [secured]
      body:
        application/json:
          example: |
            <<exampleItem>>
      responses:
        200:
          body:
            application/json:
              example: |
                <<exampleItem>>
    delete:
      description: |
        Deletes a <<resourcePathName|!singularize>>.
      is: [secured]
      responses:
        200:
           body:
             application/json:
              example: |
                {"message": "<<resourcePathName|!singularize>> not found" }
- bulk-api:
    description: Handle multiple <<entityType>> in a single request
    get:
      description: Deletes a list of <<entityType>>
      is: [secured]
      responses:
        200:
          body:
            application/json:
    post:
      description: Creates a list of <<entityType>>
      responses:
        200:
          body:
            application/json:
    put:
      description: Updates a list of <<entityType>>
      is: [secured]
      responses:
        200:
          body:
            application/json:
    delete:
      description: Deletes a list of <<entityType>>
      is: [secured]
      responses:
        200:
          body:
            application/json:
/ingredient:
  type:
    entity:
      exampleCollection: !include mule-ingredient-collection.sample
      exampleItem: !include mule-ingredient.sample
  /{id}:
    type:
      entity-item:
        exampleItem: !include mule-ingredient.sample
  /bulk:
    type:
      bulk-api:
        entityType: ingredient
/recipe:
  type:
    entity:
      exampleCollection: !include mule-ingredient-collection.sample
      exampleItem: !include mule-ingredient.sample
  /{id}:
    type:
      entity-item:
        exampleItem: !include mule-ingredient.sample
  /bulk:
    type:
      bulk-api:
        entityType: recipe