add default media type

add default media type

#%RAML 0.8
---
title: Knapsack Pro
baseUri: http://api.knapsackpro.com/{version}
version: v1
mediaType: application/json

/build_subsets:
  post:
    description: |
      Endpoint expects partial test suite execution data for particular test build.

      For instance send here data collected after execution half of test suite on the first CI node. Send here also data collected for the second half of the test suite executed on the second CI node.

      We will merge the data automatically to have complete information about particular build.

    queryParameters:
      test_suite_token:
        type: string
        required: true
        example: 4ae170d5806c331bfab123ca1adaadb3
        description: |
          Token for the particular test suite. __Token must be kept private.__

          For instance token for your RSpec test suite. If you have also test written in Cucumber then you will have separate token for Cucumber test suite.
      commit_hash:
        type: string
        required: true
        example: 6e3396177d9f8ca87e2b93b4b0a25babd09d574d
        description: |
          The most recent hash commit in your project.

          You are running tests on the codebase with latest commit pointed to the __commit_hash__.
      branch:
        type: string
        required: true
        example: master
        description: |
          You are running tests on this branch.
      node_total:
        type: integer
        required: true
        example: 4
        description: |
          Total number of CI nodes you have.

          For instance if you want to parallelize your test suite across 4 servers then __node_total__ is 4.
      node_index:
        type: integer
        required: true
        example: 0
        description: |
           Index of current CI node where part of the test suite where executed.

           __node_index__ starts from 0 so in case when __node_total__ is 4 then max __node_index__ is 3.
      test_files:
        type: string
        required: true
        example: |
          [
            {
              "path": "test/fast/a_test.rb",
              "time_execution": 0.2015
            },
            {
              "path": "test/fast/b_test.rb",
              "time_execution": 0.04
            },
            {
              "path": "test/slow/c_test.rb",
              "time_execution": 6.2120
            },
            {
              "path": "test/slow/d_test.rb",
              "time_execution": 4.3703
            }
          ]
        description: |
          JSON array with objects. Each object contains test file path and execution time for the test file.

          Example contains only part of the test suite. The part of tests was executed on the CI node for specified __node_index__.

    responses:
      201:
        body:
          application/json:
            example: Response does not contain any data.
      422:
        body:
          application/json:
            example: |
              // example 1
              {
                "errors": [
                  {
                    "branch": ["parameter is required"]
                  }
                ]
              }

              // example 2
              {
                "errors": [
                  {
                    "node_index": ["must be less than or equal to 1"],
                    "test_files": [
                      {
                        "0": {
                          "time_execution": ["is not a number"]
                        },
                        "1": {
                          "path": ["is too short (minimum is 3 characters)"]
                        }
                      }
                    ]
                  }
                ]
              }

#%RAML 0.8
---
title: Knapsack Pro
baseUri: http://api.knapsackpro.com/{version}
version: v1

/build_subsets:
  post:
    description: |
      Endpoint expects partial test suite execution data for particular test build.

      For instance send here data collected after execution half of test suite on the first CI node. Send here also data collected for the second half of the test suite executed on the second CI node.

      We will merge the data automatically to have complete information about particular build.

    queryParameters:
      test_suite_token:
        type: string
        required: true
        example: 4ae170d5806c331bfab123ca1adaadb3
        description: |
          Token for the particular test suite. __Token must be kept private.__

          For instance token for your RSpec test suite. If you have also test written in Cucumber then you will have separate token for Cucumber test suite.
      commit_hash:
        type: string
        required: true
        example: 6e3396177d9f8ca87e2b93b4b0a25babd09d574d
        description: |
          The most recent hash commit in your project.

          You are running tests on the codebase with latest commit pointed to the __commit_hash__.
      branch:
        type: string
        required: true
        example: master
        description: |
          You are running tests on this branch.
      node_total:
        type: integer
        required: true
        example: 4
        description: |
          Total number of CI nodes you have.

          For instance if you want to parallelize your test suite across 4 servers then __node_total__ is 4.
      node_index:
        type: integer
        required: true
        example: 0
        description: |
           Index of current CI node where part of the test suite where executed.

           __node_index__ starts from 0 so in case when __node_total__ is 4 then max __node_index__ is 3.
      test_files:
        type: string
        required: true
        example: |
          [
            {
              "path": "test/fast/a_test.rb",
              "time_execution": 0.2015
            },
            {
              "path": "test/fast/b_test.rb",
              "time_execution": 0.04
            },
            {
              "path": "test/slow/c_test.rb",
              "time_execution": 6.2120
            },
            {
              "path": "test/slow/d_test.rb",
              "time_execution": 4.3703
            }
          ]
        description: |
          JSON array with objects. Each object contains test file path and execution time for the test file.

          Example contains only part of the test suite. The part of tests was executed on the CI node for specified __node_index__.

    responses:
      201:
        body:
          application/json:
            example: Response does not contain any data.
      422:
        body:
          application/json:
            example: |
              // example 1
              {
                "errors": [
                  {
                    "branch": ["parameter is required"]
                  }
                ]
              }

              // example 2
              {
                "errors": [
                  {
                    "node_index": ["must be less than or equal to 1"],
                    "test_files": [
                      {
                        "0": {
                          "time_execution": ["is not a number"]
                        },
                        "1": {
                          "path": ["is too short (minimum is 3 characters)"]
                        }
                      }
                    ]
                  }
                ]
              }


Small changes for send order

Small changes for send order

#%RAML 0.8
---
title: Warehousing API
baseUri: https://api.bring.com/po/api/v1

documentation:
- title: Introduction
  content: |
    A typical usage pattern for an Warehousing customer type is to create an order in Order Management that will go to the correct warehouse for picking, packing and sending. Then follow up with creating a packing list from the warehouse with transport information. All steps can be followed in Mybring Order Management.

    Warehousing API has several interfaces (SOAP and XML/JSON). Choose the option that fits your needs best (see table below). The XML/JSON interface is the core interface with complete functionality.

    Please note that this API currently doesn't support json on all of its methods yet. Look in the example section to see which are supported.

    ## SOAP

    ### Versioning

    Warehousing API makes an effort to always be backwards compatible regarding data format for requests and responses of the Web Service. To achieve this, a SchemaVersion element is used in the request, indicating which version the client is on and what data-format the client expects in the result.

    We make an effort not to return new elements in the response when an old schema version is specified. When changes in the schema are made, the SchemaVersion is incremented by one. The new schema is used at the same endpoint URL as before and uses the same namespace for its XML elements. A TraceMessage element (info message) in the response is added to inform the client that its schema should be updated. Old schema versions might in the future be unsupported.

    Regarding the XML API (not Web Services), an XML Schema is not used at all. Therefore, clients of the XML API are expected to handle new elements that appear. Nevertheless, the response will be backwards compatible in the sense that elements are not renamed or deleted.

    ### WSDL

    [https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl](https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl)

    [https://api.bring.com/po/api/ws/om-order-v1.wsdl](https://api.bring.com/po/api/ws/om-order-v1.wsdl)

    ## Error handling

    When using the Warehousing API, errors or service unavailability can occur, although we do our utmost to prevent any downtime. Thus it is important to use timeouts and other error handling techniques when making requests to the service.

    How you handle errors depends on the nature of your application, but one strategy for handling such situations is by providing a failover if the shipping guide responds with an error or does not respond at all (timeout).

    See [the list of error codes](#list-error-codes) for hints on how to implement error handling.

- title: Authentication
  content: |
    The Warehousing API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be set for all endpoints documented below.

/omorder:
  displayName: Send an order
  description: |
      Send an order to Warehousing system. There are different types of order supported in Warehousing system.

       - Order / SalesOrder (as an pickorder for Warehousing)
            - Warehousing functionality sends it to Warhousing system for picking and delivery.
       - PurchaseOrder (as an receiving order for Warehousing)
            - Warehousing functionality sends it to Warhousing system for receiving orderinfo.

  post:
    description: Send an order
    queryParameters:
      CreateOrderRequest messageFunction:
          description: Type of order.
"Order"
"OrderResponse"
"SalesOrder"
"NotifyTransport"
"PurchaseOrder"
"ArticleBalance"
"DespatchAdvice"
"ReceivingAdvice"
"PackageList"
"OrderReceipt"
"InventoryReport"
"InventoryReportAd"
"ItemData"
          type: string
          required: true
          example: Order
      MessageSender partyId:
          description: Customer Number which Bring has provided. It cannot be demo customer number.
          type: string
          required: true
          example: 10000000000
      MessageRecipient partyId:
          description: Receiving Bring system. Constant value.
          type: string
          required: true
          example: NO98466118506
      MessageDate:
          description: The date on which message is sent.
          type: dateTime
          required: true
          example: 22.01.2017 11:36:22
      OrderSet updateIndicator:
          description: Type of order data. Original, Update or Deletion
          type: string
          required: true
          example: Original
      Order/orderId:
          description: Ordernumber.
          type: dateTime
          required: true
          example: 101010
      Order/Reference:
          description: Set of references.
          type: sequence
          required: false
      Order/Reference referenceType:
          description: Type of reference coded. https://www.stylusstudio.com/edifact/D04A/1153.htm
          type: String
          required: true
          example: CMR
      Order/Reference ReferenceNo:
          description: Reference.
          type: String
          required: true
          example: 10003455TT
      Order/DateAndTimes Date & Time with subClass DocumentDate:
          description: The date on which order is booked.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/DateAndTimes Date & Time with subClass DeliveryDateRequested:
          description: The date on which order is requested delivered.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/TermsOfDelivery TODConditionCode:
          description: Ordernumber.
          type: dateTime
          required: false
          example: DDP
      TransportService BasicServiceCode:
          description: Transport product for shipment to customer. http://developer.bring.com/api/products/
          type: String
          required: true
          example: SERVICEPAKKE
      TransportService AdditionalService AdditionalServiceCode:
          description: Transport services for shipment to customer. http://developer.bring.com/api/products/
          type: String
          required: false
          example: EVARSLING
      TransportLeg TransportLegType:
          description: TransportLegType id. Default value 30.
          type: String
          required: false
          example: 30
      TransportLeg ModeOfTransport:
          description: Type of transport.
1 = Sea
2 = Train
3 = Road
4 = Air.
          type: String
          required: false
          example: 3
      Party/subClass OrderingParty:
          description: Details of sender. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass DeliveryParty:
          description: Details of recipient. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass Supplier:
          description: Required when sending purchaseorder.Details of supplier. Must have Name, Street, City, CountryCode if used.
          required: false
      Party/subClass PerformingUnit partyId:
          description: Warehouse id for order. Required if order to Warehousing system.
          type: string
          required: true
          example: BERGER
      OrderLineSet:
          description: Set of order items.
          type: sequence
          required: true
      OrderItem/articleLineId:
          description: Line id for this order line.
          type: integer
          required: true
          example: 10
      OrderItem/ArticleId codeListAgencyIdentifier:
          description: Sets type of ArticleId.
"CustomerItemNo"
"VendorItemNo"
"EAN"
If not used ArticleId default is CustomerItemNo.
          type: string
          required: true
          example: VendorItemNo
      OrderItem/ArticleId:
          description: Article number or id.
          type: sequence
          required: true
          example: 123-4000
      OrderItem/ArticleQuantity unitCode:
          description: Unit code for quantity ordered.
          type: string
          required: true
          example: STK
      OrderItem/ArticleQuantity:
          description: Quantity ordered.
          type: float
          required: true
          example: 2.0
      OrderItem/Description usageCode:
          description: Article description type. If description used set to AAA.
          type: string
          required: false
          example: AAA
      OrderItem/Description:
          description: Article description.
          type: string
          required: false
          example: Spear parts with all parts
      OrderItem/ArticleMonetaryAmounts :
          description: Article unit sales price.
          type: float
          required: false
          example: 230.30
      OrderItem/ArticleName:
          description: Article name.
          type: string
          required: false
          example: Spear parts

    body:
        application/xml:
          example: !include examples/create_order.xml
        application/json:
          example: !include examples/create_order.json
    responses:
      200:
        displayName: Success
        description: |
          Successfully created a order.

/omorder/{customerId}/{orderId}:
  displayName: List order information
  description: |
      Get all information on a given order.
  get:
    description: List order information
    responses:
      200:
        displayName: Success
        description: |
          Complete order information including order items.
        body:
          application/xml:
            example: !include examples/retrieve_order.xml
          application/json:
            example: !include examples/retrieve_order.json

/items/{customerId}/{orderId}:
  displayName: List order items
  description: |
      List all item lines on an order.
  get:
    description: List order items
    responses:
      200:
        displayName: Success
        description: |
          List of order items.
        body:
          application/xml:
            example: !include examples/retrieve_orderitems.xml
          application/json:
            example: !include examples/retrieve_orderitems.json

/articlebalance:
  displayName: Create or update article balance list
  post:
    description: Create or update article balance list
    body:
      application/xml:
        example: !include examples/create_articlebalance.xml
    responses:
      200:
        displayName: Success
        description: |
          Successfully created balance list

/articlebalance/{customerId}:
  displayName: Get stock balance and info for all articles
  get:
    description: Get stock balance and info for all articles
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_all.xml
          application/json:
            example: !include examples/retrieve_articlebalance_all.json

/articlebalance/{customerId}/{articleNo}:
  displayName: Get stock balance and info for one article
  get:
    description: Get stock balance and info for one article
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_one.xml
          application/json:
            example: !include examples/retrieve_articlebalance_one.json

/articlebalance/info/{customerId}/{articleSearchString}:
  displayName: Get stock balance and info for all articles matching search string
  get:
    description: Get stock balance and info for all articles matching search string
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_search.xml
          application/json:
            example: !include examples/retrieve_articlebalance_search.json

/errorCodes:
  displayName: List error codes
  get:
    description: List error codes
    responses:
      200:
        displayName: Success
        description: |
          Dynamic list of error codes used in the solution.
        body:
          application/xml:
            example: !include examples/error_codes.xml
          application/json:
            example: !include examples/error_codes.json

#%RAML 0.8
---
title: Warehousing API
baseUri: https://api.bring.com/po/api/v1

documentation:
- title: Introduction
  content: |
    A typical usage pattern for an Warehousing customer type is to create an order in Order Management that will go to the correct warehouse for picking, packing and sending. Then follow up with creating a packing list from the warehouse with transport information. All steps can be followed in Mybring Order Management.

    Warehousing API has several interfaces (SOAP and XML/JSON). Choose the option that fits your needs best (see table below). The XML/JSON interface is the core interface with complete functionality.

    Please note that this API currently doesn't support json on all of its methods yet. Look in the example section to see which are supported.

    ## SOAP

    ### Versioning

    Warehousing API makes an effort to always be backwards compatible regarding data format for requests and responses of the Web Service. To achieve this, a SchemaVersion element is used in the request, indicating which version the client is on and what data-format the client expects in the result.

    We make an effort not to return new elements in the response when an old schema version is specified. When changes in the schema are made, the SchemaVersion is incremented by one. The new schema is used at the same endpoint URL as before and uses the same namespace for its XML elements. A TraceMessage element (info message) in the response is added to inform the client that its schema should be updated. Old schema versions might in the future be unsupported.

    Regarding the XML API (not Web Services), an XML Schema is not used at all. Therefore, clients of the XML API are expected to handle new elements that appear. Nevertheless, the response will be backwards compatible in the sense that elements are not renamed or deleted.

    ### WSDL

    [https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl](https://api.bring.com/po/api/ws/purchaseorder-v1.wsdl)

    [https://api.bring.com/po/api/ws/om-order-v1.wsdl](https://api.bring.com/po/api/ws/om-order-v1.wsdl)

    ## Error handling

    When using the Warehousing API, errors or service unavailability can occur, although we do our utmost to prevent any downtime. Thus it is important to use timeouts and other error handling techniques when making requests to the service.

    How you handle errors depends on the nature of your application, but one strategy for handling such situations is by providing a failover if the shipping guide responds with an error or does not respond at all (timeout).

    See [the list of error codes](#list-error-codes) for hints on how to implement error handling.

- title: Authentication
  content: |
    The Warehousing API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be set for all endpoints documented below.

/omorder:
  displayName: Send an order
  description: |
      Send an order to Warehousing system. There are different types of order supported in Warehousing system.

       - Order / SalesOrder (as an pickorder for Warehousing)
            - Warehousing functionality sends it to Warhousing system for picking and delivery.
       - PurchaseOrder (as an receiving order for Warehousing)
            - Warehousing functionality sends it to Warhousing system for receiving orderinfo.

  post:
    description: Send an order
    queryParameters:
      CreateOrderRequest messageFunction:
          description: Type of order.
"Order"
"OrderResponse"
"SalesOrder"
"NotifyTransport"
"PurchaseOrder"
"ArticleBalance"
"DespatchAdvice"
"ReceivingAdvice"
"PackageList"
"OrderReceipt"
"InventoryReport"
"InventoryReportAd"
"ItemData"
          type: string
          required: true
          example: Order
      MessageSender partyId:
          description: Customer Number which Bring has provided. It cannot be demo customer number.
          type: string
          required: true
          example: 10000000000
      MessageRecipient partyId:
          description: Receiving Bring system. Constant value.
          type: string
          required: true
          example: NO98466118506
      MessageDate:
          description: The date on which message is sent.
          type: dateTime
          required: true
          example: 22.01.2017 11:36:22
      OrderSet updateIndicator:
          description: Type of order data. Original, Update or Deletion
          type: string
          required: true
          example: Original
      Order/orderId:
          description: Ordernumber.
          type: dateTime
          required: true
          example: 101010
      Order/Reference:
          description: Set of references.
          type: sequence
          required: false
      Order/Reference referenceType:
          description: Type of reference coded. https://www.stylusstudio.com/edifact/D04A/1153.htm
          type: String
          required: true
          example: CMR
      Order/Reference ReferenceNo:
          description: Reference.
          type: String
          required: true
          example: 10003455TT
      Order/DateAndTimes Date & Time with subClass DocumentDate:
          description: The date on which order is booked.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/DateAndTimes Date & Time with subClass DeliveryDateRequested:
          description: The date on which order is requested delivered.
          type: dateTime
          required: true
          example: Date 22.01.2017 Time 11:36:22
      Order/TermsOfDelivery TODConditionCode:
          description: Ordernumber.
          type: dateTime
          required: false
          example: DDP
      TransportService BasicServiceCode:
          description: Transport product for shipment to customer. http://developer.bring.com/api/products/
          type: String
          required: true
          example: SERVICEPAKKE
      TransportService AdditionalService AdditionalServiceCode:
          description: Transport services for shipment to customer. http://developer.bring.com/api/products/
          type: String
          required: false
          example: EVARSLING
      TransportLeg TransportLegType:
          description: TransportLegType id. Default value 30.
          type: String
          required: false
          example: 30
      TransportLeg ModeOfTransport:
          description: Type of transport.
1 = Sea
2 = Train
3 = Road
4 = Air.
          type: String
          required: false
          example: 3
      Party/subClass OrderingParty:
          description: Details of sender. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass DeliveryParty:
          description: Details of recipient. Must have Name, Street, City, CountryCode.
          required: true
      Party/subClass Supplier:
          description: Details of supplier. Must have Name, Street, City, CountryCode if used.
          required: false
      Party/subClass PerformingUnit partyId:
          description: Warehouse id for order. Required if order to Warehousing system.
          type: string
          required: true
          example: BERGER
      OrderLineSet:
          description: Set of order items.
          type: sequence
          required: true
      OrderItem/articleLineId:
          description: Line id for this order line.
          type: integer
          required: true
          example: 10
      OrderItem/ArticleId codeListAgencyIdentifier:
          description: Sets type of ArticleId.
"CustomerItemNo"
"VendorItemNo"
"EAN"
If not used ArticleId default is CustomerItemNo.
          type: string
          required: true
          example: VendorItemNo
      OrderItem/ArticleId:
          description: Article number or id.
          type: sequence
          required: true
          example: 123-4000
      OrderItem/ArticleQuantity unitCode:
          description: Unit code for quantity ordered.
          type: string
          required: true
          example: STK
      OrderItem/ArticleQuantity:
          description: Quantity ordered.
          type: float
          required: true
          example: 2.0
      OrderItem/Description usageCode:
          description: Article description type. If description used set to AAA.
          type: string
          required: false
          example: AAA
      OrderItem/Description:
          description: Article description.
          type: string
          required: false
          example: Spear parts with all parts
      OrderItem/ArticleName:
          description: Article name.
          type: string
          required: false
          example: Spear parts

    body:
        application/xml:
          example: !include examples/create_order.xml
        application/json:
          example: !include examples/create_order.json
    responses:
      200:
        displayName: Success
        description: |
          Successfully created a order.

/omorder/{customerId}/{orderId}:
  displayName: List order information
  description: |
      Get all information on a given order.
  get:
    description: List order information
    responses:
      200:
        displayName: Success
        description: |
          Complete order information including order items.
        body:
          application/xml:
            example: !include examples/retrieve_order.xml
          application/json:
            example: !include examples/retrieve_order.json

/items/{customerId}/{orderId}:
  displayName: List order items
  description: |
      List all item lines on an order.
  get:
    description: List order items
    responses:
      200:
        displayName: Success
        description: |
          List of order items.
        body:
          application/xml:
            example: !include examples/retrieve_orderitems.xml
          application/json:
            example: !include examples/retrieve_orderitems.json

/articlebalance:
  displayName: Create or update article balance list
  post:
    description: Create or update article balance list
    body:
      application/xml:
        example: !include examples/create_articlebalance.xml
    responses:
      200:
        displayName: Success
        description: |
          Successfully created balance list

/articlebalance/{customerId}:
  displayName: Get stock balance and info for all articles
  get:
    description: Get stock balance and info for all articles
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_all.xml
          application/json:
            example: !include examples/retrieve_articlebalance_all.json

/articlebalance/{customerId}/{articleNo}:
  displayName: Get stock balance and info for one article
  get:
    description: Get stock balance and info for one article
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_one.xml
          application/json:
            example: !include examples/retrieve_articlebalance_one.json

/articlebalance/info/{customerId}/{articleSearchString}:
  displayName: Get stock balance and info for all articles matching search string
  get:
    description: Get stock balance and info for all articles matching search string
    responses:
      200:
        displayName: Success
        description: |
        body:
          application/xml:
            example: !include examples/retrieve_articlebalance_search.xml
          application/json:
            example: !include examples/retrieve_articlebalance_search.json

/errorCodes:
  displayName: List error codes
  get:
    description: List error codes
    responses:
      200:
        displayName: Success
        description: |
          Dynamic list of error codes used in the solution.
        body:
          application/xml:
            example: !include examples/error_codes.xml
          application/json:
            example: !include examples/error_codes.json


Update displayName for tracking

Update displayName for tracking

#%RAML 0.8
---
title: Tracking API
baseUri: http://sporing.bring.no

securitySchemes:
- mybring_headers:
    description: |
      The API supports using Mybring headers for authenticating requests.
    type: x-headers
    describedBy:
      headers:
        X-MyBring-API-Uid:
          displayName: Mybring user id
          required: true
          example: mybring-user@example.com
        X-MyBring-API-Key:
          displayName: Mybring API key
          required: true
          example: f00f000f-00f0-f0f0-f0f0-f0f0f0f0ff0
        X-Bring-Client-URL:
          displayName: client url
          required: true
          example: https://example.com/shop
      responses:
        400:
          description: Authentication failed.

documentation:
- title: Introduction
  content: |
      The tracking API provides the opportunity to track shipments by reference, package or shipment number. It is an easy way to display details and the status of shipments. The information available in this API is the same information available from the [Tracking web site](http://tracking.bring.com/). Response is available as either XML or JSON.

/sporing{mediaTypeExtension}:
  displayName: Tracking endpoint
  securedBy: [mybring_headers, null]
  description: |
      For testing you can use "TESTPACKAGE-AT-PICKUPPOINT" as the tracking number to generate test results. For real tracking this must be a valid number.
  uriParameters:
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Get information about a shipment
    queryParameters:
      q:
        description: Reference, package number, shipment number to search for
        type: string
        required: true
        example: TESTPACKAGE-AT-PICKUPPOINT
      callback:
        description: JSONP callback function name
        type: string
        required: false
    headers:
      X-Testing-A-Header:
        description: This is just a test to see how it renders
        type: integer
        required: false
        minimum: 1
        maximum: 100
        example: 42

    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/testpackage.json
          application/xml:
            example: !include examples/testpackage.xml
            schema: !include schemas/sporing-v1.xsd

#%RAML 0.8
---
title: Tracking API
baseUri: http://sporing.bring.no

securitySchemes:
- mybring_headers:
    description: |
      The API supports using Mybring headers for authenticating requests.
    type: x-headers
    describedBy:
      headers:
        X-MyBring-API-Uid:
          displayName: Mybring user id
          required: true
          example: mybring-user@example.com
        X-MyBring-API-Key:
          displayName: Mybring API key
          required: true
          example: f00f000f-00f0-f0f0-f0f0-f0f0f0f0ff0
        X-Bring-Client-URL:
          displayName: client url
          required: true
          example: https://example.com/shop
      responses:
        400:
          description: Authentication failed.

documentation:
- title: Introduction
  content: |
      The tracking API provides the opportunity to track shipments by reference, package or shipment number. It is an easy way to display details and the status of shipments. The information available in this API is the same information available from the [Tracking web site](http://tracking.bring.com/). Response is available as either XML or JSON.

/sporing{mediaTypeExtension}:
  displayName: /sporing.json or /sporing.xml
  securedBy: [mybring_headers, null]
  description: |
      For testing you can use "TESTPACKAGE-AT-PICKUPPOINT" as the tracking number to generate test results. For real tracking this must be a valid number.
  uriParameters:
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Get information about a shipment
    queryParameters:
      q:
        description: Reference, package number, shipment number to search for
        type: string
        required: true
        example: TESTPACKAGE-AT-PICKUPPOINT
      callback:
        description: JSONP callback function name
        type: string
        required: false
    headers:
      X-Testing-A-Header:
        description: This is just a test to see how it renders
        type: integer
        required: false
        minimum: 1
        maximum: 100
        example: 42

    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/testpackage.json
          application/xml:
            example: !include examples/testpackage.xml
            schema: !include schemas/sporing-v1.xsd


Fix silly mistake in semester's example in RAML

#%RAML 0.8
title: CTU Sirius API
version: v1
baseUri: https://sirius.fit.cvut.cz/api/{version}
securedBy: [access_token]
securitySchemes:
  - access_token:
      description: |
        All Sirius read-only resources are secured by an access token. The token is either
        associated with an username (personal) or is set as global. This authorization
        scheme uses the same query parameter as OAuth 2.0, and will be later
        replaced by OAuth 2.0.
      type: x-access-token
      describedBy:
        queryParameters:
          access_token:
            description: |
              Used to send a valid access token.
            type: string
        responses:
          401:
            description: |
              Missing or invalid token. Authorization token was not specified or is not valid.
traits:
  - paged:
      usage: Retreive further pages in collection
      description: Use `offset` and `limit` to paginate the records.
      queryParameters:
        limit:
          description: The number of entries in collection to return
          type: number
          default: 10
          maximum: 100
        offset:
          description: Offset of the first entry in collection
          type: number
          default: 0
  - dateScoped:
      queryParameters:
        from:
          description: Return events from this date
          type: date
        to:
          description: Return events up to this date
          type: date
  - filterable:
      queryParameters:
        event_type:
          description: Filter by event's type
          type: string
          enum: [ assessment, course_event, exam, laboratory, lecture, tutorial ]
  - includable:
      queryParameters:
        include:
          description: Include linked resources per JSON API
          type: string
          example: people
  - secured:
      description: Marks resource as secured. You need to be authenticated and authorized to access it.
      queryParameters:
        access_token:
          description: Authentication and authorization is required. You need to set your `access_token` in URL.
          type: string
          example: 07a855e0-6920-11e4-a40a-0002a5d5c51b
          required: true
resourceTypes:
  - events-collection:
      get:
        is: [ paged, dateScoped, secured, filterable ]
        responses:
          200:
            body:
              application/json:
                example: |
                    {
                      "meta": {
                        "count": 2,
                        "offset": 0,
                        "limit": 20
                      },
                      "events": [
                        {
                          "id": 42,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-23T07:30:00.000+02:00",
                          "ends_at": "2014-04-23T11:00:00.000+02:00",
                          "deleted" : false,
                          "capacity": 24,
                          "event_type": "tutorial",
                          "parallel": "106",
                          "links": {
                            "room": "T9:350",
                            "course": "MI-RUB",
                            "teachers": [
                              "skocdopet"
                            ],
                            "students": [
                              "szolatib",
                              "vomackar"
                            ],
                            "applied_exceptions": [ 10, 15 ]
                          }
                        },
                        {
                          "id": 43,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-24T09:15:00.000+02:00",
                          "ends_at": "2014-04-24T10:45:00.000+02:00",
                          "deleted" : false,
                          "capacity": 196,
                          "event_type": "lecture",
                          "parallel": "1",
                          "links": {
                            "room": "T9:155",
                            "course": "MI-W20",
                            "teachers": [
                              "kuchajar",
                              "vitvatom"
                            ],
                            "students": [
                              "jirutjak"
                            ]
                          }
                        }
                      ]
                    }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/125
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
          404:
            description: There are no events within the current scope
  - event:
      get:
        is: [ secured ]
        responses:
          200:
            body:
              application/json:
                example: |
                  {
                    "events": {
                      "id": 42,
                      "name": null,
                      "sequence_number": 12,
                      "starts_at": "2014-04-23T07:30:00.000+02:00",
                      "ends_at": "2014-04-23T11:00:00.000+02:00",
                      "deleted" : false,
                      "capacity": 24,
                      "event_type": "tutorial",
                      "parallel": "106",
                      "links": {
                        "room": "T9:350",
                        "course": "MI-RUB",
                        "teachers": [
                          "skocdopet"
                        ],
                        "students": [
                          "szolatib",
                          "vomackar"
                        ],
                        "applied_exceptions": [ 10, 15 ]
                      }
                    }
                  }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
/events:
  type: events-collection
  get:
    description: "Get all events without any scope"
  /{eventId}:
    type: event
/people/{username}/events:
  type: events-collection
  description: Get a calendar for a person
  uriParameters:
    username:
      description: person's unique username
      required: true
      pattern: "[a-z0-9]{3,8}"
      example: vomackar
/rooms/{kosId}/events:
  type: events-collection
  description: Get a calendar for a room
  uriParameters:
    kosId:
      description: |
        Common room identification used by KOS, for details see [the documentation](https://rozvoj.fit.cvut.cz/Main/znaceni-mistnosti#HKOSEDzna10DenED-102).
      required: true
      pattern: "[A-Z0-9]{2}:([A-Z0-9]+-)?[a-z0-9]+"
      example: "TH:A-1333"
/courses/{courseCode}/events:
  type: events-collection
  description: Get events instances for a given course
  uriParameters:
    courseCode:
      description: |
        Course code, faculty specific.
      required: true
      example: BI-PA1
/schedule_exceptions:
  description: Manage schedule exceptions
  is: [ paged ]
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "schedule_exceptions": [
                  {
                    "id": 1,
                    "type": "CANCEL",
                    "name": "Den české státnosti",
                    "scope": {
                      "starts_at": "2014-09-28T00:00:00.000+02:00",
                      "ends_at": "2014-09-29T00:00:00.000+02:00",
                      "faculty": null,
                      "semester": null,
                      "courses": null,
                      "timetable_slots": null
                    }
                  },
                  {
                    "id": 11,
                    "type": "CANCEL"
                    "name": "Děkanský den FIT",
                    "note": "Výuka odpadá",
                    "scope": {
                      "starts_at": "2015-04-30T00:00:00Z",
                      "ends_at": "2015-05-01T00:00:00Z",
                      "faculty": 18000,
                      "semester": "B142",
                      "courses": null,
                      "timetable_slots": null
                    }
                  }
                ],
                "meta": {
                  "count": 2,
                  "offset": 0,
                  "limit": 20
                }
              }
  /{id}:
    uriParameters:
      id:
        description: ID of the schedule exception
        required: true
    get:
      responses:
        200:
          body:
            application/json:
              example: |
                {
                  "schedule_exceptions": {
                    "id": 7,
                    "type": "ROOM_CHANGE",
                    "name": "MI-MPI - přednáška 24. 9. 2014 přesunuta do T9:105",
                    "scope": {
                      "starts_at": "2014-09-24T00:00:00.000+02:00",
                      "ends_at": "2014-09-25T00:00:00.000+02:00",
                      "faculty": 18000,
                      "semester": "B141",
                      "courses": null,
                      "timetable_slots": [ 392651000 ]
                    },
                    "options": {
                      "room_id": "T9:105"
                    }
                  }
                }
/semesters:
  is: [ paged, secured ]
  get:
    description: Get all semesters per faculties.
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "semesters": [
                  {
                    "id": "18000-B142",
                    "semester": "B142",
                    "faculty": 18000,
                    "starts_at": "2015-02-16",
                    "ends_at": "2015-09-21",
                    "exams_start_at": "2015-05-18",
                    "exams_end_at": "2015-06-27",
                    "teaching_ends_at": "2015-05-16",
                    "first_week_parity": "even",
                    "hour_duration": 45,
                    "hour_starts": [
                      "07:30", "08:15", "09:15", "10:00", "11:00", "11:45",
                      "12:45", "13:30", "14:30", "15:15", "16:15", "17:00",
                      "18:00", "18:45", "19:45"
                    ]
                  }
                ],
                "meta": {
                  "count": 4,
                  "offset": 0,
                  "limit": 1
                }
              }
  /{faculty_semester}:
    is: [ secured ]
    uriParameters:
      faculty_semester:
        description: Faculty code and semester code connected with a dash.
        pattern: "[0-9]{5}-[AB][0-9]{2}[12]"
        example: 18000-B142
        required: true
    get:
      description: Get a semester on a faculty.
      responses:
        200:
          body:
            application/json:
              example: |
                {
                  "semesters": {
                    "id": "18000-B142",
                    "semester": "B142",
                    "faculty": 18000,
                    "starts_at": "2015-02-16",
                    "ends_at": "2015-09-21",
                    "exams_start_at": "2015-05-18",
                    "exams_end_at": "2015-06-27",
                    "teaching_ends_at": "2015-05-16",
                    "first_week_parity": "even",
                    "hour_duration": 45,
                    "hour_starts": [
                      "07:30", "08:15", "09:15", "10:00", "11:00", "11:45",
                      "12:45", "13:30", "14:30", "15:15", "16:15", "17:00",
                      "18:00", "18:45", "19:45"
                    ]
                  }
                }

#%RAML 0.8
title: CTU Sirius API
version: v1
baseUri: https://sirius.fit.cvut.cz/api/{version}
securedBy: [access_token]
securitySchemes:
  - access_token:
      description: |
        All Sirius read-only resources are secured by an access token. The token is either
        associated with an username (personal) or is set as global. This authorization
        scheme uses the same query parameter as OAuth 2.0, and will be later
        replaced by OAuth 2.0.
      type: x-access-token
      describedBy:
        queryParameters:
          access_token:
            description: |
              Used to send a valid access token.
            type: string
        responses:
          401:
            description: |
              Missing or invalid token. Authorization token was not specified or is not valid.
traits:
  - paged:
      usage: Retreive further pages in collection
      description: Use `offset` and `limit` to paginate the records.
      queryParameters:
        limit:
          description: The number of entries in collection to return
          type: number
          default: 10
          maximum: 100
        offset:
          description: Offset of the first entry in collection
          type: number
          default: 0
  - dateScoped:
      queryParameters:
        from:
          description: Return events from this date
          type: date
        to:
          description: Return events up to this date
          type: date
  - filterable:
      queryParameters:
        event_type:
          description: Filter by event's type
          type: string
          enum: [ assessment, course_event, exam, laboratory, lecture, tutorial ]
  - includable:
      queryParameters:
        include:
          description: Include linked resources per JSON API
          type: string
          example: people
  - secured:
      description: Marks resource as secured. You need to be authenticated and authorized to access it.
      queryParameters:
        access_token:
          description: Authentication and authorization is required. You need to set your `access_token` in URL.
          type: string
          example: 07a855e0-6920-11e4-a40a-0002a5d5c51b
          required: true
resourceTypes:
  - events-collection:
      get:
        is: [ paged, dateScoped, secured, filterable ]
        responses:
          200:
            body:
              application/json:
                example: |
                    {
                      "meta": {
                        "count": 2,
                        "offset": 0,
                        "limit": 20
                      },
                      "events": [
                        {
                          "id": 42,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-23T07:30:00.000+02:00",
                          "ends_at": "2014-04-23T11:00:00.000+02:00",
                          "deleted" : false,
                          "capacity": 24,
                          "event_type": "tutorial",
                          "parallel": "106",
                          "links": {
                            "room": "T9:350",
                            "course": "MI-RUB",
                            "teachers": [
                              "skocdopet"
                            ],
                            "students": [
                              "szolatib",
                              "vomackar"
                            ],
                            "applied_exceptions": [ 10, 15 ]
                          }
                        },
                        {
                          "id": 43,
                          "name": null,
                          "sequence_number": 12,
                          "starts_at": "2014-04-24T09:15:00.000+02:00",
                          "ends_at": "2014-04-24T10:45:00.000+02:00",
                          "deleted" : false,
                          "capacity": 196,
                          "event_type": "lecture",
                          "parallel": "1",
                          "links": {
                            "room": "T9:155",
                            "course": "MI-W20",
                            "teachers": [
                              "kuchajar",
                              "vitvatom"
                            ],
                            "students": [
                              "jirutjak"
                            ]
                          }
                        }
                      ]
                    }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/125
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
          404:
            description: There are no events within the current scope
  - event:
      get:
        is: [ secured ]
        responses:
          200:
            body:
              application/json:
                example: |
                  {
                    "events": {
                      "id": 42,
                      "name": null,
                      "sequence_number": 12,
                      "starts_at": "2014-04-23T07:30:00.000+02:00",
                      "ends_at": "2014-04-23T11:00:00.000+02:00",
                      "deleted" : false,
                      "capacity": 24,
                      "event_type": "tutorial",
                      "parallel": "106",
                      "links": {
                        "room": "T9:350",
                        "course": "MI-RUB",
                        "teachers": [
                          "skocdopet"
                        ],
                        "students": [
                          "szolatib",
                          "vomackar"
                        ],
                        "applied_exceptions": [ 10, 15 ]
                      }
                    }
                  }
              text/calendar:
                example: |
                  BEGIN:VCALENDAR
                  VERSION:2.0
                  CALSCALE:GREGORIAN
                  BEGIN:VEVENT
                  DTSTAMP:20140702T140133Z
                  UID:https://sirius.fit.cvut.cz/events/123
                  DTSTART:20140312T101500
                  DTEND:20140312T114500
                  CLASS:PUBLIC
                  CREATED:20140410T182546
                  LAST-MODIFIED:20140410T182546
                  LOCATION:T9:130
                  SUMMARY:MI-PSL 2. cvičení
                  END:VEVENT
                  END:VCALENDAR
/events:
  type: events-collection
  get:
    description: "Get all events without any scope"
  /{eventId}:
    type: event
/people/{username}/events:
  type: events-collection
  description: Get a calendar for a person
  uriParameters:
    username:
      description: person's unique username
      required: true
      pattern: "[a-z0-9]{3,8}"
      example: vomackar
/rooms/{kosId}/events:
  type: events-collection
  description: Get a calendar for a room
  uriParameters:
    kosId:
      description: |
        Common room identification used by KOS, for details see [the documentation](https://rozvoj.fit.cvut.cz/Main/znaceni-mistnosti#HKOSEDzna10DenED-102).
      required: true
      pattern: "[A-Z0-9]{2}:([A-Z0-9]+-)?[a-z0-9]+"
      example: "TH:A-1333"
/courses/{courseCode}/events:
  type: events-collection
  description: Get events instances for a given course
  uriParameters:
    courseCode:
      description: |
        Course code, faculty specific.
      required: true
      example: BI-PA1
/schedule_exceptions:
  description: Manage schedule exceptions
  is: [ paged ]
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "schedule_exceptions": [
                  {
                    "id": 1,
                    "type": "CANCEL",
                    "name": "Den české státnosti",
                    "scope": {
                      "starts_at": "2014-09-28T00:00:00.000+02:00",
                      "ends_at": "2014-09-29T00:00:00.000+02:00",
                      "faculty": null,
                      "semester": null,
                      "courses": null,
                      "timetable_slots": null
                    }
                  },
                  {
                    "id": 11,
                    "type": "CANCEL"
                    "name": "Děkanský den FIT",
                    "note": "Výuka odpadá",
                    "scope": {
                      "starts_at": "2015-04-30T00:00:00Z",
                      "ends_at": "2015-05-01T00:00:00Z",
                      "faculty": 18000,
                      "semester": "B142",
                      "courses": null,
                      "timetable_slots": null
                    }
                  }
                ],
                "meta": {
                  "count": 2,
                  "offset": 0,
                  "limit": 20
                }
              }
  /{id}:
    uriParameters:
      id:
        description: ID of the schedule exception
        required: true
    get:
      responses:
        200:
          body:
            application/json:
              example: |
                {
                  "schedule_exceptions": {
                    "id": 7,
                    "type": "ROOM_CHANGE",
                    "name": "MI-MPI - přednáška 24. 9. 2014 přesunuta do T9:105",
                    "scope": {
                      "starts_at": "2014-09-24T00:00:00.000+02:00",
                      "ends_at": "2014-09-25T00:00:00.000+02:00",
                      "faculty": 18000,
                      "semester": "B141",
                      "courses": null,
                      "timetable_slots": [ 392651000 ]
                    },
                    "options": {
                      "room_id": "T9:105"
                    }
                  }
                }
/semesters:
  is: [ paged, secured ]
  get:
    description: Get all semesters per faculties.
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "semesters": [
                  {
                    "semesters": {
                      "id": "18000-B142",
                      "semester": "B142",
                      "faculty": 18000,
                      "starts_at": "2015-02-16",
                      "ends_at": "2015-09-21",
                      "exams_start_at": "2015-05-18",
                      "exams_end_at": "2015-06-27",
                      "teaching_ends_at": "2015-05-16",
                      "first_week_parity": "even",
                      "hour_duration": 45,
                      "hour_starts": [
                        "07:30", "08:15", "09:15", "10:00", "11:00", "11:45", "12:45", "13:30",
                        "14:30", "15:15", "16:15", "17:00", "18:00", "18:45", "19:45"
                      ]
                    }
                  }
                ],
                "meta": {
                  "count": 4,
                  "offset": 0,
                  "limit": 1
                }
              }
  /{faculty_semester}:
    is: [ secured ]
    uriParameters:
      faculty_semester:
        description: Faculty code and semester code connected with a dash.
        pattern: "[0-9]{5}-[AB][0-9]{2}[12]"
        example: 18000-B142
        required: true
    get:
      description: Get a semester on a faculty.
      responses:
        200:
          body:
            application/json:
              example: |
                {
                  "semesters": {
                    "id": "18000-B142",
                    "semester": "B142",
                    "faculty": 18000,
                    "starts_at": "2015-02-16",
                    "ends_at": "2015-09-21",
                    "exams_start_at": "2015-05-18",
                    "exams_end_at": "2015-06-27",
                    "teaching_ends_at": "2015-05-16",
                    "first_week_parity": "even",
                    "hour_duration": 45,
                    "hour_starts": [
                      "07:30", "08:15", "09:15", "10:00", "11:00", "11:45", "12:45", "13:30",
                      "14:30", "15:15", "16:15", "17:00", "18:00", "18:45", "19:45"
                    ]
                  }
                }