Authentication first steps

Authentication first steps

#%RAML 1.0
title: DámeMatiku
version: v1
baseUri: http://api.damematiku.cz

securitySchemes:
  oauth_2_0:
    description: |
        Dropbox supports OAuth 2.0 for authenticating all API requests.
    type: OAuth 2.0
    describedBy:
        headers:
            Authorization:
                description: |
                   Used to send a valid OAuth 2 access token. Do not use
                   with the "access_token" query string parameter.
                type: string
        queryParameters:
            access_token:
                description: |
                   Used to send a valid OAuth 2 access token. Do not use together with
                   the "Authorization" header
                type: string
        responses:
            401:
                description: |
                    Bad or expired token. This can happen if the user or the site
                    revoked or expired an access token. To fix, you should re-
                    authenticate the user.
            403:
                description: |
                    Bad OAuth request (wrong consumer key, bad nonce, expired
                    timestamp...). Unfortunately, re-authenticating the user won't help here.
    settings:
      authorizationUri: http://www.damematiku.cz/1/oauth2/authorize
      accessTokenUri: https://api.damematiku.cz/1/oauth2/token
      authorizationGrants: [ code, token ]

/tags:
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              [
                {
                  "id": "zs",
                  "title": "ZS",
                  "subtags": []
                }
              ]

/search:
  get:
    queryParameters:
      q:
        description: Search query
        type: string
        required: true
    responses:
      200:
        body:
          application/json:
            example: |
              [
                {
                  "type": "section",
                  "id": 12,
                  "title": "Section 1",
                  "chapters": [
                    {
                      "id": 124,
                      "title": "Some chapter"
                    }
                  ]
                },
                {
                  "type": "chapter",
                  "id": 123,
                  "title": "Chapter about 'search query'"
                }
              ]

/subjects/{subjectId}/sections:
  get:
    queryParameters:
      tags:
        description: Selected tags to filter by
        type: array
        required: false
    responses:
      200:
        body:
          application/json:
            example: |
              [
                {
                  "id": 12,
                  "title": "Section 1",
                  "chapters": [
                    {
                      "id": 124,
                      "title": "Some chapter"
                    }
                  ]
                }
              ]
/chapters/{chapterId}:
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "id": 123,
                "title": "Some chapter",
                "description": "HTML description.",
                "videos": [
                  {
                    "id": 153,
                    "title": "Some chapter",
                    "author": {
                      "id": 1325,
                      "name": "Lord Voldemort",
                      "reputation": 10000,
                      "avatarUrl": "http://someurl.com/img.png"
                    },
                    "youtubeId": "13kbnrfv01",
                    "votes": -3,
                    "myVote": "up"
                  }
                ],
                "sponsor": {
                  "name": "Some company",
                  "logoUrl": "http://someurl.com/logo.png",
                  "link": "http://someurl.com"
                },
                "nextChapter": {
                  "id": 124,
                  "title": "Another chapter"
                },
                "previousChapter": {
                  "id": 125,
                  "title": "Some another chapter"
                }
              }
  post:

/videos:
  /featured:
    get:
      responses:
        200:
          body:
            application/json:
              example: |
                [
                  {
                    "id": 153,
                    "title": "Some chapter",
                    "author": {
                      "id": 1325,
                      "name": "Lord Voldemort",
                      "reputation": 10000,
                      "avatarUrl": "http://someurl.com/img.png"
                    },
                    "youtubeId": "13kbnrfv01",
                    "votes": -3,
                    "myVote": "up"
                  }
                ]
  /{videoId}:
    get:
      responses:
        200:
          body:
            application/json:
              example: |
                {
                  "id": 153,
                  "title": "Some chapter",
                  "author": {
                    "id": 1325,
                    "name": "Lord Voldemort",
                    "reputation": 10000,
                    "avatarUrl": "http://someurl.com/img.png"
                  },
                  "youtubeId": "13kbnrfv01",
                  "votes": -3,
                  "myVote": "up",
                  "description": "HTML description.",
                  "disqusPageId": "12141"
                }

    /upvote:
      post:
        responses:
          200:
          401:
          403:
    /downvote:
      post:
        responses:
          200:
          401:
          403:

/authors/{authorId}:
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "id": 1325,
                "name": "Lord Voldemort",
                "reputation": 10000,
                "avatarUrl": "http://someurl.com/img.png",
                "videos": [
                  {
                    "id": 153,
                    "title": "Some chapter",
                    "youtubeId": "13kbnrfv01",
                    "votes": -3,
                    "myVote": "up"
                  }
                ]
              }
  /follow:
    post:
      responses:
        200:
        401:
        403:
  /unfollow:
    post:
      responses:
        200:
        401:
        403:

/users:
  /create-account-google-auth:
    post:
      queryParameters:
        client_id:
        client_secret:
      body:
        application/x-www-form-urlencoded:
          properties:
            device_id:
            googleIdToken:
              type: string
              description: A valid Google ID token.
            userType:
              description: "'student', 'teacher' or 'other'"
              type: string

#%RAML 1.0
title: DámeMatiku
version: v1
baseUri: http://api.damematiku.cz
types:
  TestType:
    type: object
    properties:
      id: number
      optional?: string
      expanded:
        type: object
        properties:
          count: number
/tags:
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              [
                {
                  "id": "zs",
                  "title": "ZS",
                  "subtags": []
                }
              ]

/search:
  get:
    queryParameters:
      q:
        description: Search query
        type: string
        required: true
    responses:
      200:
        body:
          application/json:
            example: |
              [
                {
                  "type": "section",
                  "id": 12,
                  "title": "Section 1",
                  "chapters": [
                    {
                      "id": 124,
                      "title": "Some chapter"
                    }
                  ]
                },
                {
                  "type": "chapter",
                  "id": 123,
                  "title": "Chapter about 'search query'"
                }
              ]

/subjects/{subjectId}/sections:
  get:
    queryParameters:
      tags:
        description: Selected tags to filter by
        type: array
        required: false
    responses:
      200:
        body:
          application/json:
            example: |
              [
                {
                  "id": 12,
                  "title": "Section 1",
                  "chapters": [
                    {
                      "id": 124,
                      "title": "Some chapter"
                    }
                  ]
                }
              ]
/chapters/{chapterId}:
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "id": 123,
                "title": "Some chapter",
                "description": "HTML description.",
                "videos": [
                  {
                    "id": 153,
                    "title": "Some chapter",
                    "author": {
                      "id": 1325,
                      "name": "Lord Voldemort",
                      "reputation": 10000,
                      "avatarUrl": "http://someurl.com/img.png"
                    },
                    "youtubeId": "13kbnrfv01",
                    "votes": -3,
                    "myVote": "up"
                  }
                ],
                "sponsor": {
                  "name": "Some company",
                  "logoUrl": "http://someurl.com/logo.png",
                  "link": "http://someurl.com"
                },
                "nextChapter": {
                  "id": 124,
                  "title": "Another chapter"
                },
                "previousChapter": {
                  "id": 125,
                  "title": "Some another chapter"
                }
              }
  post:

/videos:
  /featured:
    get:
      responses:
        200:
          body:
            application/json:
              example: |
                [
                  {
                    "id": 153,
                    "title": "Some chapter",
                    "author": {
                      "id": 1325,
                      "name": "Lord Voldemort",
                      "reputation": 10000,
                      "avatarUrl": "http://someurl.com/img.png"
                    },
                    "youtubeId": "13kbnrfv01",
                    "votes": -3,
                    "myVote": "up"
                  }
                ]
  /{videoId}:
    get:
      responses:
        200:
          body:
            application/json:
              example: |
                {
                  "id": 153,
                  "title": "Some chapter",
                  "author": {
                    "id": 1325,
                    "name": "Lord Voldemort",
                    "reputation": 10000,
                    "avatarUrl": "http://someurl.com/img.png"
                  },
                  "youtubeId": "13kbnrfv01",
                  "votes": -3,
                  "myVote": "up",
                  "description": "HTML description.",
                  "disqusPageId": "12141"
                }

    /upvote:
      post:
        responses:
          200:
          401:
          403:
    /downvote:
      post:
        responses:
          200:
          401:
          403:

/authors/{authorId}:
  get:
    responses:
      200:
        body:
          application/json:
            example: |
              {
                "id": 1325,
                "name": "Lord Voldemort",
                "reputation": 10000,
                "avatarUrl": "http://someurl.com/img.png",
                "videos": [
                  {
                    "id": 153,
                    "title": "Some chapter",
                    "youtubeId": "13kbnrfv01",
                    "votes": -3,
                    "myVote": "up"
                  }
                ]
              }
  /follow:
    post:
      responses:
        200:
        401:
        403:
  /unfollow:
    post:
      responses:
        200:
        401:
        403:
/users:
  /create-account-google-auth:
    post:
      queryParameters:
        client_id:
        client_secret:
      body:
        application/x-www-form-urlencoded:
          properties:
            device_id:
            googleIdToken:
              type: string
              description: A valid Google ID token.
            userType:
              description: "'student', 'teacher' or 'other'"
              type: string


Updating text

Updating text

#%RAML 1.0
---
title: Reports API
baseUri: https://www.mybring.com/reports/api
types:
  DashboardData:
    type: object
    properties:
      kolliNumber:
        type: string
        required: true
        description: Represents a package number
      shipmentNumber:
        type: string
        required: true
        description: Represents a shipment number
      recipientName:
        type: string
        required: true
        description: Represents a recipient name
      lastStatus:
        type: string
        required: true
        description: Represents the lastStatus
      lastEvent:
        type: string
        required: false
        description: Represents the lastEvent
      senderReference:
        type: string
        required: false
        description: Represents the senderReference
      recipientMobileNumber:
        type: string
        required: false
        description: Represents the recipient Mobile Number
      productCode:
        type: string
        required: false
        description: Represents the productCode
      productName:
        type: string
        required: true
        description: Represents the productName
      countryCode:
        type: string
        required: true
        enum: [ "DK", "FI","NO", "SE"]
        description: Represents the country code
      shipmentGroupType:
        type: string
        required: true
        enum: [ "REMAINING_FOR_DELIVERY", "LOADED_TO_CAR", "ATTEMPTED_DELIVERY", "AT_PICKUP_POINT", "SUCCESSFULLY_DELIVERED"]
        description: Represents the shipmentGroup by status

documentation:
- title: Introduction
  content: |
    The Reports API is used to generate shipment reports, the same set of reports that are available in mybring.

    Each Mybring user is associated with a set of customers and has access to specific set of report types for which they can generate a report.

    The following steps (which will be API calls) enables you to generate a report:

    1. Get the customers associated with the mybring user.
    2. Get the report types allowed for a customer.
    3. Initiate report creation and get report ID. The Report ID is initially used to monitor reports creation progress, later to get the actual report (XML or Excel file).
    4. After initiating report creation, you can check the status if the job. I.e. if it is in progress, completed or failed. When status is completed, a URL for fetching the actual report is returned.
    5. The report can then be downloaded.

    For all the above APIs we need to identify and authenticate the user. This is done by passing the following header information. These are described in Reference section:

    - Mybring username (email address)
    - API Key

    All these APIs are available in json and xml formats.

- title: How to use
  content: |
    The Reports API is a logged-in service and you need to get an API-key and authenticate before being able to use the API.

    The two first steps in the process is only necessary to find customer numbers and report types for the user. You can save these IDs, and perform the generation-step without verifying the IDs. The response may get added information, so implementation should ignore new elements added to the response.

    1. Get customer IDs
    2. Get list of available reports
    3. Generate report
    4. Check status of report
    5. Download report
    6. Get list of invoice numbers for given customer or group

- title:
  content: |
    #### List of available invoice sources
    For specified invoice report 4 different types of report can be returned depending on the invoice source. Those are

    Cargo Domestic and Sea :
      - AMPHORA_DOMESTIC
      - AMPHORA_SEA

    Cargo International and Sysped :
      - AMPHORA_BCI
      - SYSPED

    Parcels :
      - PARCEL_DOMESTIC

    Frigo :
      - TIMPEX

- title: Authentication
  content: |
    The Reports API requires authentication for all its endpoints.

    ### Before you start
    Before you can begin using the new API you'll have to do the following:

    * [Sign up for a Mybring account](https://www.mybring.com/signup/register/user) if you do not already have one. If you're already registered in Mybring, head to the [settings and API](https://www.mybring.com/useradmin/account/settings/api) page to get your API key.
    * [Generate an API key](/api/#authentication) for your user

    ### Get your API key from Mybring
    To make API requests you will need an API key. Click the link below, which sends you to your "Settings and API" page in Mybring profile administration. Scroll down to the "API key" section. Your generated API key which you will use to authenticate your requests can be found here.

    Get API key

    ### Add authentication headers
    A description of the headers can be found in [Getting Started / Authentication](/api/#authentication).

    | 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.

/generate{mediaTypeExtension}:
  displayName: List available customers
  description: |
    List available customers for the provided API credentials.
  uriParameters:
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available customers
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available customers
                value: !include examples/list_customers.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available customers
                value: !include examples/list_customers.xml

/generate/{customerId}{mediaTypeExtension}:
  displayName: List available reports for a customer
  description: |
    Each customer has a set of reports available. This endpoint lists all available reports for a given customer.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available reports for a customer
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available reports
                value: !include examples/list_reports.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available reports
                value: !include examples/list_reports.xml

/generate/{customerId}/{reportTypeId}{mediaTypeExtension}:
  displayName: Generate a report
  description: |
    To generate a report do a GET to the supplied URL, and include the parameters described in the previous response. You need not invoke the two first steps for every report generation if customer id and report type are known.

    This is asynchronous request. So the GET-call will return 202, telling the caller the that the request for a report is put on the queue. The URL to query to get the status for the request if provided as an HTTP header and also in the response.

    The example below shows how to generate a PARCELS-DELIVERED report for PARCELS_NORWAY-00012341234 in the period 01.07.2014 to 01.08.2014.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    reportTypeId:
      description: A report type ID from the 'list of available reports' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Generate a report
    queryParameters:
      parameterName:
        description: The different report types have different params. The params are doucmented in the list of available reports, for example `fromDate` and `toDate`.
        type: string
        required: true
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      202:
        displayName: Successful response
        headers:
          Location:
            description: URL to get status of the generated report
            required: true
            type: string
            example: https://www.mybring.com/reports/api/report/db285042-6e8d-4563-94ca-eb1100706a73/status/
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows successful reports generation response with URL
                value: !include examples/generate_report.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows successful reports generation response with URL
                value: !include examples/generate_report.xml

/report/{reportId}/status{mediaTypeExtension}:
  displayName: Check the status of a report
  description: |
    Since the generation of reports may take several minutes, we supply a status address to check the status of the report generation. The status page will display `NOT_DONE`, until the report is ready to be downloaded. When the report is ready, URLs to download the report will be in the response
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Check the status of a report
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report status
        description: Examples show different statuses.
        body:
          application/json:
            examples:
              successful:
                displayName: Report status done
                description: The example below shows reports status done
                value: !include examples/status_done.json
              successful_notDone:
                displayName: Report status not done
                description: The example below shows reports generated status
                value: !include examples/status_not_done.json
              successful_failed:
                displayName: Report status failed
                description: The example below shows reports generation failed status
                value: !include examples/status_failed.json
          application/xml:
            examples:
              successful:
                displayName: Report status done
                description: The example below shows reports status not done
                value: !include examples/status_done.xml
              successful_notDone:
                displayName: Report status not done
                description: The example below shows reports generated status
                value: !include examples/status_not_done.xml
              successful_failed:
                displayName: Report status failed
                description: The example below shows reports generation failed status
                value: !include examples/status_failed.xml

/report/{reportId}{mediaTypeExtension}:
  displayName: Get report
  description: |
    Returns the generated report.
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .xls, .xml ]
      description: Use .xls to get Excel file or .xml to get XML file.
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report
        description: |
          Examples show the MetaData included in successful(200) response for specified invoice report vs other reports.
        body:
          application/xml:
            examples:
              successful_invoice:
                displayName: Successful with invoice details
                description: The example below shows empty report with invoice details under metadata section of Report response
                value: !include examples/empty_invoice_report.xml
              successful:
                displayName: Successful
                description: The example below shows empty report without invoice details
                value: !include examples/empty_report.xml

/invoices/{customerOrGroupId}{mediaTypeExtension}:
  displayName: List invoice numbers
  description: |
    Gets the list of invoice numbers for a customer id or a customer group. By default it shows last 65 days of invoices, with the possibilty to access 365 days data by providing from date and to date.
  uriParameters:
    customerOrGroupId:
      description: Id for customer or customer group. Customer group id should have the prefix `GROUP_`.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    queryParameters:
            fromDate:
              description: Start date for fetching invoices in format dd.mm.yyyy.
              required: false
              example: 01.01.2019
            toDate:
              description: End date for fetching invoices in format dd.mm.yyyy.
              type: string
              required: false
              example: 30.06.2019
    responses:
      200:
        displayName: Successful response
        description:
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include examples/list_invoices.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include examples/list_invoices.xml

/overview/{apiCustomerNumber}/summary{mediaTypeExtension}:
  displayName: Reports overview statistics summary
  description: |
    Gives total cost and volume of shipments from Parcel, Cargo and  Parcel International service customers with reports with financial access.
  uriParameters:
    apiCustomerNumber:
      description: |
             Unique API Customer Number from *Parcel, Cargo and  Parcel International* service by considering below rules

**For Non Agreement Converted customer:**  use the possible *"API customer number"*
Possible values:

 - Main customer number
 -CARGO-xxxxx
 - PARCELS_NORWAY_INTERNATIONAL-xxxxx
 - PARCELS_SWEDEN-xxxxx
 - PARCELS_DENMARK-xxxxx
 - PARCELS_FINLAND-xxxxx

**For Agreement converted customer:** *"```ServiceType|Main Customer Number```"*
Possible values:

 - CARGO|Main customer number
 - PARCEL|Main customer number

      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json ]
      description: Use .json to specify application/json
  get:
    description: Gives reports overview statistics
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows overview summary
                value: !include examples/overview_summary.json
              successfulNordics:
                displayName: Successful without cost details
                description: The example below shows overview summary for parcel internationals customers which dont have economy details as of now.
                value: !include examples/overview_summary_without_cost.json

/dashboard/{apiCustomerNumber}/count:
  displayName: Provides count of shipments for key events
  description: |
    Gives count of shipment for key event for Parcel, Cargo and  Parcel International service customers with reports access.
  uriParameters:
    apiCustomerNumber:
      description: |
             Unique API Customer Number from *Parcel, Cargo and  Parcel International* service by considering below rules

**For Non Agreement Converted customer:**  use the possible *"API customer number"*
Possible values:

 - Main customer number
 -CARGO-xxxxx
 - PARCELS_NORWAY_INTERNATIONAL-xxxxx
 - PARCELS_SWEDEN-xxxxx
 - PARCELS_DENMARK-xxxxx
 - PARCELS_FINLAND-xxxxx

**For Agreement converted customer:** *"```ServiceType|Main Customer Number```"*
Possible values:

 - CARGO|Main customer number
 - PARCEL|Main customer number

      type: string
      required: true
  get:
    description: Provides count of shipments for key events
    headers:
      X-MyBring-API-Uid:
        description: Your Mybring login ID
      X-MyBring-API-Key:
        description: Your user's API key
      X-Bring-Client-URL:
        description: A URL that sort of identifies where you're using the APIs.
    queryParameters:
      requestedForDate:
        description: Date for which shipment count is required in format dd.mm.yyyy.
        required: true
        example: 24.03.2020
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows shipment count for key events
                value: !include examples/dashboard_count.json

/dashboard/{apiCustomerNumber}/dashboardRowData:
  displayName: Provides count of shipments with details for key events.
  description: |
    Gives count of shipment for key event with details for Parcel, Cargo and  Parcel International service customers with reports access.
  uriParameters:
    apiCustomerNumber:
      description: |
             Unique API Customer Number from *Parcel, Cargo and  Parcel International* service by considering below rules

**For Non Agreement Converted customer:**  use the possible *"API customer number"*
Possible values:

 - Main customer number
 -CARGO-xxxxx
 - PARCELS_NORWAY_INTERNATIONAL-xxxxx
 - PARCELS_SWEDEN-xxxxx
 - PARCELS_DENMARK-xxxxx
 - PARCELS_FINLAND-xxxxx

**For Agreement converted customer:** *"```ServiceType|Main Customer Number```"*
Possible values:

 - CARGO|Main customer number
 - PARCEL|Main customer number

      type: string
      required: true
  get:
    description: Provides shipment counts with details for key events.
    headers:
      X-MyBring-API-Uid:
        description: Your Mybring login ID
      X-MyBring-API-Key:
        description: Your user's API key
      X-Bring-Client-URL:
        description: A URL that sort of identifies where you're using the APIs.
    queryParameters:
      requestedForDate:
        description: Date for which shipment details is required in format dd.mm.yyyy.
        required: true
        example: 24.03.2020
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            type: DashboardData
            examples:
              successful:
                displayName: Successful
                description: The example below shows shipment count with details for the key events
                value: !include examples/dashboard_row_details.json

#%RAML 1.0
---
title: Reports API
baseUri: https://www.mybring.com/reports/api
types:
  DashboardData:
    type: object
    properties:
      kolliNumber:
        type: string
        required: true
        description: Represents a package number
      shipmentNumber:
        type: string
        required: true
        description: Represents a shipment number
      recipientName:
        type: string
        required: true
        description: Represents a recipient name
      lastStatus:
        type: string
        required: true
        description: Represents the lastStatus
      lastEvent:
        type: string
        required: false
        description: Represents the lastEvent
      senderReference:
        type: string
        required: false
        description: Represents the senderReference
      recipientMobileNumber:
        type: string
        required: false
        description: Represents the recipient Mobile Number
      productCode:
        type: string
        required: false
        description: Represents the productCode
      productName:
        type: string
        required: true
        description: Represents the productName
      countryCode:
        type: string
        required: true
        enum: [ "DK", "FI","NO", "SE"]
        description: Represents the country code
      shipmentGroupType:
        type: string
        required: true
        enum: [ "REMAINING_FOR_DELIVERY", "LOADED_TO_CAR", "ATTEMPTED_DELIVERY", "AT_PICKUP_POINT", "SUCCESSFULLY_DELIVERED"]
        description: Represents the shipmentGroup by status

documentation:
- title: Introduction
  content: |
    The Reports API is used to generate shipment reports, the same set of reports that are available in mybring.

    Each Mybring user is associated with a set of customers and has access to specific set of report types for which they can generate a report.

    The following steps (which will be API calls) enables you to generate a report:

    1. Get the customers associated with the mybring user.
    2. Get the report types allowed for a customer.
    3. Initiate report creation and get report ID. The Report ID is initially used to monitor reports creation progress, later to get the actual report (XML or Excel file).
    4. After initiating report creation, you can check the status if the job. I.e. if it is in progress, completed or failed. When status is completed, a URL for fetching the actual report is returned.
    5. The report can then be downloaded.

    For all the above APIs we need to identify and authenticate the user. This is done by passing the following header information. These are described in Reference section:

    - Mybring username (email address)
    - API Key

    All these APIs are available in json and xml formats.

- title: How to use
  content: |
    The Reports API is a logged-in service and you need to get an API-key and authenticate before being able to use the API.

    The two first steps in the process is only necessary to find customer numbers and report types for the user. You can save these IDs, and perform the generation-step without verifying the IDs. The response may get added information, so implementation should ignore new elements added to the response.

    1. Get customer IDs
    2. Get list of available reports
    3. Generate report
    4. Check status of report
    5. Download report
    6. Get list of invoice numbers for given customer or group

- title:
  content: |
    #### List of available invoice sources
    For specified invoice report 4 different types of report can be returned depending on the invoice source. Those are

    Cargo Domestic and Sea :
      - AMPHORA_DOMESTIC
      - AMPHORA_SEA

    Cargo International and Sysped :
      - AMPHORA_BCI
      - SYSPED

    Parcels :
      - PARCEL_DOMESTIC

    Frigo :
      - TIMPEX

- title: Authentication
  content: |
    The Reports API requires authentication for all its endpoints.

    ### Before you start
    Before you can begin using the new API you'll have to do the following:

    * [Sign up for a Mybring account](https://www.mybring.com/signup/register/user) if you do not already have one. If you're already registered in Mybring, head to the [settings and API](https://www.mybring.com/useradmin/account/settings/api) page to get your API key.
    * [Generate an API key](/api/#authentication) for your user

    ### Get your API key from Mybring
    To make API requests you will need an API key. Click the link below, which sends you to your "Settings and API" page in Mybring profile administration. Scroll down to the "API key" section. Your generated API key which you will use to authenticate your requests can be found here.

    Get API key

    ### Add authentication headers
    A description of the headers can be found in [Getting Started / Authentication](/api/#authentication).

    | 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.

/generate{mediaTypeExtension}:
  displayName: List available customers
  description: |
    List available customers for the provided API credentials.
  uriParameters:
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available customers
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available customers
                value: !include examples/list_customers.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available customers
                value: !include examples/list_customers.xml

/generate/{customerId}{mediaTypeExtension}:
  displayName: List available reports for a customer
  description: |
    Each customer has a set of reports available. This endpoint lists all available reports for a given customer.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available reports for a customer
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available reports
                value: !include examples/list_reports.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows list of available reports
                value: !include examples/list_reports.xml

/generate/{customerId}/{reportTypeId}{mediaTypeExtension}:
  displayName: Generate a report
  description: |
    To generate a report do a GET to the supplied URL, and include the parameters described in the previous response. You need not invoke the two first steps for every report generation if customer id and report type are known.

    This is asynchronous request. So the GET-call will return 202, telling the caller the that the request for a report is put on the queue. The URL to query to get the status for the request if provided as an HTTP header and also in the response.

    The example below shows how to generate a PARCELS-DELIVERED report for PARCELS_NORWAY-00012341234 in the period 01.07.2014 to 01.08.2014.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    reportTypeId:
      description: A report type ID from the 'list of available reports' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Generate a report
    queryParameters:
      parameterName:
        description: The different report types have different params. The params are doucmented in the list of available reports, for example `fromDate` and `toDate`.
        type: string
        required: true
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      202:
        displayName: Successful response
        headers:
          Location:
            description: URL to get status of the generated report
            required: true
            type: string
            example: https://www.mybring.com/reports/api/report/db285042-6e8d-4563-94ca-eb1100706a73/status/
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows successful reports generation response with URL
                value: !include examples/generate_report.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows successful reports generation response with URL
                value: !include examples/generate_report.xml

/report/{reportId}/status{mediaTypeExtension}:
  displayName: Check the status of a report
  description: |
    Since the generation of reports may take several minutes, we supply a status address to check the status of the report generation. The status page will display `NOT_DONE`, until the report is ready to be downloaded. When the report is ready, URLs to download the report will be in the response
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Check the status of a report
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report status
        description: Examples show different statuses.
        body:
          application/json:
            examples:
              successful:
                displayName: Report status done
                description: The example below shows reports status done
                value: !include examples/status_done.json
              successful_notDone:
                displayName: Report status not done
                description: The example below shows reports generated status
                value: !include examples/status_not_done.json
              successful_failed:
                displayName: Report status failed
                description: The example below shows reports generation failed status
                value: !include examples/status_failed.json
          application/xml:
            examples:
              successful:
                displayName: Report status done
                description: The example below shows reports status not done
                value: !include examples/status_done.xml
              successful_notDone:
                displayName: Report status not done
                description: The example below shows reports generated status
                value: !include examples/status_not_done.xml
              successful_failed:
                displayName: Report status failed
                description: The example below shows reports generation failed status
                value: !include examples/status_failed.xml

/report/{reportId}{mediaTypeExtension}:
  displayName: Get report
  description: |
    Returns the generated report.
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .xls, .xml ]
      description: Use .xls to get Excel file or .xml to get XML file.
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report
        description: |
          Examples show the MetaData included in successful(200) response for specified invoice report vs other reports.
        body:
          application/xml:
            examples:
              successful_invoice:
                displayName: Successful with invoice details
                description: The example below shows empty report with invoice details under metadata section of Report response
                value: !include examples/empty_invoice_report.xml
              successful:
                displayName: Successful
                description: The example below shows empty report without invoice details
                value: !include examples/empty_report.xml

/invoices/{customerOrGroupId}{mediaTypeExtension}:
  displayName: List invoice numbers
  description: |
    Gets the list of invoice numbers for a customer id or a customer group. By default it shows last 65 days of invoices, with the possibilty to access 365 days data by providing from date and to date.
  uriParameters:
    customerOrGroupId:
      description: Id for customer or customer group. Customer group id should have the prefix `GROUP_`.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    queryParameters:
            fromDate:
              description: Start date for fetching invoices in format dd.mm.yyyy.
              required: false
              example: 01.01.2019
            toDate:
              description: End date for fetching invoices in format dd.mm.yyyy.
              type: string
              required: false
              example: 30.06.2019
    responses:
      200:
        displayName: Successful response
        description:
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include examples/list_invoices.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                description: The example below shows an list of invoices
                value: !include examples/list_invoices.xml

/overview/{apiCustomerNumber}/summary{mediaTypeExtension}:
  displayName: Reports overview statistics summary
  description: |
    Gives total cost and volume of shipments from Parcel, Cargo and  Parcel International service customers with reports with financial access.
  uriParameters:
    apiCustomerNumber:
      description: |
             Unique API Customer Number of applicable service categories by considering below rules

* For Non Agreement Converted customer:  use the possible *"API customer number"*

* For Agreement converted customer: *"```ServiceType|Main Customer Number```"*
      type: string
      required: true
      enum: [ Main customer number,
              CARGO-xxxxx,
              PARCELS_NORWAY_INTERNATIONAL-xxxxx,PARCELS_SWEDEN-xxxxx,PARCELS_DENMARK-xxxxx,PARCELS_FINLAND-xxxxx]
      example: CARGO|12345, CARGO_INTERNATIONAL|12345, PARCEL|12345
    mediaTypeExtension:
      enum: [ .json ]
      description: Use .json to specify application/json
  get:
    description: Gives reports overview statistics
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows overview summary
                value: !include examples/overview_summary.json
              successfulNordics:
                displayName: Successful without cost details
                description: The example below shows overview summary for parcel internationals customers which dont have economy details as of now.
                value: !include examples/overview_summary_without_cost.json

/dashboard/{apiCustomerNumber}/count:
  displayName: Provides count of shipments for key events
  description: |
    Gives count of shipment for key event for Parcel, Cargo and  Parcel International service customers with reports access.
  uriParameters:
    apiCustomerNumber:
      description: |
             Unique API Customer Number of applicable service categories by considering below rules

* For Non Agreement Converted customer:  use the possible *"API customer number"*

* For Agreement converted customer: *"```ServiceType|Main Customer Number```"*
      type: string
      required: true
      enum: [ Main customer number,
              CARGO-xxxxx,
              PARCELS_NORWAY_INTERNATIONAL-xxxxx,PARCELS_SWEDEN-xxxxx,PARCELS_DENMARK-xxxxx,PARCELS_FINLAND-xxxxx]
      example: CARGO|12345, CARGO_INTERNATIONAL|12345, PARCEL|12345
  get:
    description: Provides count of shipments for key events
    headers:
      X-MyBring-API-Uid:
        description: Your Mybring login ID
      X-MyBring-API-Key:
        description: Your user's API key
      X-Bring-Client-URL:
        description: A URL that sort of identifies where you're using the APIs.
    queryParameters:
      requestedForDate:
        description: Date for which shipment count is required in format dd.mm.yyyy.
        required: true
        example: 24.03.2020
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                description: The example below shows shipment count for key events
                value: !include examples/dashboard_count.json

/dashboard/{apiCustomerNumber}/dashboardRowData:
  displayName: Provides count of shipments with details for key events.
  description: |
    Gives count of shipment for key event with details for Parcel, Cargo and  Parcel International service customers with reports access.
  uriParameters:
    apiCustomerNumber:
      description: |
             Unique API Customer Number of applicable service categories by considering below rules

* For Non Agreement Converted customer:  use the possible *"API customer number"*

* For Agreement converted customer: *"```ServiceType|Main Customer Number```"*
      type: string
      required: true
      enum: [ Main customer number,
              CARGO-xxxxx,
              PARCELS_NORWAY_INTERNATIONAL-xxxxx,PARCELS_SWEDEN-xxxxx,PARCELS_DENMARK-xxxxx,PARCELS_FINLAND-xxxxx]
      example: CARGO|12345, CARGO_INTERNATIONAL|12345, PARCEL|12345
  get:
    description: Provides shipment counts with details for key events.
    headers:
      X-MyBring-API-Uid:
        description: Your Mybring login ID
      X-MyBring-API-Key:
        description: Your user's API key
      X-Bring-Client-URL:
        description: A URL that sort of identifies where you're using the APIs.
    queryParameters:
      requestedForDate:
        description: Date for which shipment details is required in format dd.mm.yyyy.
        required: true
        example: 24.03.2020
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            type: DashboardData
            examples:
              successful:
                displayName: Successful
                description: The example below shows shipment count with details for the key events
                value: !include examples/dashboard_row_details.json


remove unused file

remove unused file

#%RAML 0.8
title: Pelis
version: 1.0
baseUri: http://pelis.com.ar/api
mediaType: application/json
protocols: [HTTP]
securitySchemes:
  - oauth_2_0:
      type: OAuth 2.0
      describedBy:
        headers:
          Authorization:
            description: |
              Used to send a valid OAuth 2 access token. Do not use together with
              the "access_token" queryParameters string parameter.
            type: string
        queryParameters:
          access_token:
            description: |
              Used to send a valid OAuth 2 access token. Do not use together with
              the "Authorization" header
            type: string
      settings:
        authorizationUri: https://localhost:8081/oauth/authorize
        accessTokenUri: https://localhost:8081/oauth/access_token
        authorizationGrants: [ code, token ]
        scopes:
          - read
          - write
/peliculas:
  get:
    description: obtiene todas las películas del catálogo
    responses:
      200:
        body:
          schema: |
            { "$schema": "http://json-schema.org/draft-03/schema",
              "type": "array",
              "description": "movies",
              "items":
                {
                  "type": "object",
                  "properties": {
                    "id": { "type": "integer" },
                    "name": { "type": "string"},
                    "director": { "type": "string"},
                    "genre": { "type": "string" },
                    "cast":{ "type": "string" },
                    "duration":{ "type": "number" },
                    "storyline":{ "type": "string" },
                    "language":{ "type": "string" },
                    "rented":{ "type": "boolean" }
                }
              }
            }
          example: |
            [
              {
                 "id" : "1",
                 "name": "Big Fish",
                 "director": "Tim Burton",
                 "genre": "Drama, Fantasy",
                 "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
                 "language": "English",
                 "rented": false
              },
              {
                 "id" : "2",
                 "name": "Midnight in Paris",
                 "director": "Woody Allen",
                 "genre": "Comedy",
                 "cast": "Owen Wilson, Rachel McAdams, Kathy Bates",
                 "language": "English",
                 "rented": false
              },
              {
                 "id" : "3",
                 "name": "Relatos Salvajes",
                 "director": "Damián Szifrón",
                 "genre": "Comedy, Drama",
                 "cast": " Ricardo Darín, Oscar Martínez, Leonardo Sbaraglia",
                 "language": "Spanish",
                 "rented": true
              }
            ]
  post:
    description: adds a movie to the catalogue
    securedBy: [ oauth_2_0 ]
    body:
      application/json:
        schema: |
          {
            "$schema": "http://json-schema.org/draft-03/schema",
            "type": "object",
            "description": "a movie",
            "properties": {
            "id": { "type": "integer"},
            "name": { "type": "string"},
            "director": { "type": "string"},
            "genre": { "type": "string" },
            "cast":{ "type": "string" },
            "duration":{ "type": "number" },
            "storyline":{ "type": "string" },
            "language":{ "type": "string" }
            }
          }
        example: |
          {
            "id" : "1",
            "name": "Big Fish",
            "director": "Tim Burton",
            "genre": "Drama, Fantasy",
            "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
            "language": "English"
          }
  /{id}:
    get:
      description: get the info of a movie
      responses:
        200:
          body:
            application/json:
              schema: |
                {
                  "$schema": "http://json-schema.org/draft-03/schema",
                  "type": "object",
                  "description": "a movie",
                  "properties": {
                    "id": { "type": "integer"},
                    "name": { "type": "string"},
                    "director": { "type": "string"},
                    "genre": { "type": "string" },
                    "cast":{ "type": "string" },
                    "duration":{ "type": "number" },
                    "storyline":{ "type": "string" },
                    "language":{ "type": "string" },
                    "rented":{ "type": "boolean" }
                  }
                }
              example: |
                {
                  "id" : "1",
                  "name": "Big Fish",
                  "director": "Tim Burton",
                  "genre": "Drama, Fantasy",
                  "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
                  "language": "English",
                  "rented": false
                }
    put:
      description: update the info of a movie
      body:
        application/json:
          schema: |
            {
              "$schema": "http://json-schema.org/draft-03/schema",
              "type": "object",
              "description": "a movie",
              "properties": {
              "id": { "type": "integer"},
              "name": { "type": "string"},
              "director": { "type": "string"},
              "genre": { "type": "string" },
              "cast":{ "type": "string" },
              "duration":{ "type": "number" },
              "storyline":{ "type": "string" },
              "language":{ "type": "string" }
              }
            }
          example: |
            {
              "name": "Big Fish",
              "director": "Tim Burton",
              "genre": "Drama, Fantasy",
              "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
              "language": "English"
            }
    delete:
      description: remove a movie from the catalogue
      responses:
        200:
          description: movie deleted
        404:
          description: movie not found
    /rent:
      description: rent a movie
      put:
        securedBy: [ oauth_2_0 ]
        responses:
          201:
            description: succesfully rented
          202:
            description: movie already rented
          404:
            description: movie not found
    /return:
      description: return a movie
      put:
        securedBy: [ oauth_2_0 ]
        responses:
          201:
            description: succesfully returned
          404:
            description: movie not found
  /wishlist:
    get:
      description: gets the current user movies wishlist
      securedBy: [ oauth_2_0 ]
      responses:
        200:
          body:
            schema: |
              { "$schema": "http://json-schema.org/draft-03/schema",
                "type": "array",
                "description": "movies",
                "items":
                  {
                    "type": "object",
                    "properties": {
                      "id": { "type": "integer" },
                      "name": { "type": "string"},
                      "director": { "type": "string"},
                      "genre": { "type": "string" },
                      "cast":{ "type": "string" },
                      "duration":{ "type": "number" },
                      "storyline":{ "type": "string" },
                      "language":{ "type": "string" },
                      "rented":{ "type": "boolean" }
                  }
                }
              }
            example: |
              [
                {
                   "id" : "1",
                   "name": "Big Fish",
                   "director": "Tim Burton",
                   "genre": "Drama, Fantasy",
                   "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
                   "language": "English",
                   "rented": false
                },
                {
                   "id" : "2",
                   "name": "Midnight in Paris",
                   "director": "Woody Allen",
                   "genre": "Comedy",
                   "cast": "Owen Wilson, Rachel McAdams, Kathy Bates",
                   "language": "English",
                   "rented": false
                }
              ]
    /{id}:
      post:
        description: add a movie to the current user movies wishlist
        securedBy: [ oauth_2_0 ]
      delete:
        description: removes a movie from the current user movies wishlist
        securedBy: [ oauth_2_0 ]
  /rented:
    get:
      description: gets the user rented movies
      responses:
        200:
          body:
            schema: |
              { "$schema": "http://json-schema.org/draft-03/schema",
                "type": "array",
                "description": "movies",
                "items":
                  {
                    "type": "object",
                    "properties": {
                      "id": { "type": "integer" },
                      "name": { "type": "string"},
                      "director": { "type": "string"},
                      "genre": { "type": "string" },
                      "cast":{ "type": "string" },
                      "duration":{ "type": "number" },
                      "storyline":{ "type": "string" },
                      "language":{ "type": "string" },
                      "rented":{ "type": "boolean" }
                  }
                }
              }
            example: |
              [
                {
                   "id" : "3",
                   "name": "Relatos Salvajes",
                   "director": "Damián Szifrón",
                   "genre": "Comedy, Drama",
                   "cast": " Ricardo Darín, Oscar Martínez, Leonardo Sbaraglia",
                   "language": "Spanish",
                   "rented": true
                }
              ]
  /available:
    get:
      description: get all movies that are not currently rented
      responses:
        200:
          body:
            schema: |
              { "$schema": "http://json-schema.org/draft-03/schema",
                "type": "array",
                "description": "movies",
                "items":
                  {
                    "type": "object",
                    "properties": {
                      "id": { "type": "integer" },
                      "name": { "type": "string"},
                      "director": { "type": "string"},
                      "genre": { "type": "string" },
                      "cast":{ "type": "string" },
                      "duration":{ "type": "number" },
                      "storyline":{ "type": "string" },
                      "language":{ "type": "string" },
                      "rented":{ "type": "boolean" }
                  }
                }
              }
            example: |
              [
                {
                   "id" : "1",
                   "name": "Big Fish",
                   "director": "Tim Burton",
                   "genre": "Drama, Fantasy",
                   "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
                   "language": "English",
                   "rented": false
                },
                {
                   "id" : "2",
                   "name": "Midnight in Paris",
                   "director": "Woody Allen",
                   "genre": "Comedy",
                   "cast": "Owen Wilson, Rachel McAdams, Kathy Bates",
                   "language": "English",
                   "rented": false
                },
                {
                   "id" : "3",
                   "name": "Relatos Salvajes",
                   "director": "Damián Szifrón",
                   "genre": "Comedy, Drama",
                   "cast": " Ricardo Darín, Oscar Martínez, Leonardo Sbaraglia",
                   "language": "Spanish",
                   "rented": true
                }
              ]
/search:
  get:
    description: search movies by name or director
    queryParameters:
      name:
        description: Name of the movie
        type: string
      director:
        description: Director of the movie
        type: string
      año:
        description: año en que salió la pelicula
    responses:
      200:
        body:
          schema: |
            { "$schema": "http://json-schema.org/draft-03/schema",
              "type": "array",
              "description": "movies",
              "items":
                {
                  "type": "object",
                  "properties": {
                    "id": { "type": "integer" },
                    "name": { "type": "string"},
                    "director": { "type": "string"},
                    "genre": { "type": "string" },
                    "cast":{ "type": "string" },
                    "duration":{ "type": "number" },
                    "storyline":{ "type": "string" },
                    "language":{ "type": "string" },
                    "rented":{ "type": "boolean" }
                }
              }
            }
          example: |
            [
              {
                 "id" : "1",
                 "name": "Big Fish",
                 "director": "Tim Burton",
                 "genre": "Drama, Fantasy",
                 "cast": "Ewan McGregor, Albert Finney, Billy Crudup",
                 "language": "English",
                 "rented": false
              },
              {
                 "id" : "2",
                 "name": "Midnight in Paris",
                 "director": "Woody Allen",
                 "genre": "Comedy",
                 "cast": "Owen Wilson, Rachel McAdams, Kathy Bates",
                 "language": "English",
                 "rented": false
              },
              {
                 "id" : "3",
                 "name": "Relatos Salvajes",
                 "director": "Damián Szifrón",
                 "genre": "Comedy, Drama",
                 "cast": " Ricardo Darín, Oscar Martínez, Leonardo Sbaraglia",
                 "language": "Spanish",
                 "rented": true
              }
            ]


fixed errors in launcher RAML

fixed errors in launcher RAML

#%RAML 0.8
title: "GestaltLauncher"
version: "1.0.0"
baseUri: "https://launcher.galacticfog.com:80"
securitySchemes:
  - basic:
      type: Basic Authentication
securedBy: [ null ]
schemas:
    -
        "GestaltAppDeployment": '{"type":"object","title":"GestaltAppDeployment","properties":{"id":{"type":"integer","required":true,"title":"id"},"status":{"type":"string","required":true,"title":"status"}}}'
        "GestaltProvider": '{"type":"object","title":"GestaltProvider","properties":{"id":{"type":"integer","required":true,"title":"id"},"name":{"type":"string","required":true,"title":"name"},"description":{"type":"string","required":true,"title":"description"},"type":{"type":"string","required":true,"title":"type"}}}'
"/providers":
    displayName: "Providers"
    description: "Operations on providers"
    get:
        displayName: "ListProviders"
        description: "List providers"
    post:
        displayName: "RegisterProvider"
        description: "Register a new provider"
    "/{providerId}":
        displayName: "Provider"
        description: "Operations on a single provider"
        uriParameters:
            "providerId":
                displayName: "providerId"
                description: "Provider ID"
                type: integer
                required: true
                repeat: false
        get:
            displayName: "GetProvider"
            description: "Get information on a specified provider"
        delete:
            displayName: "DeleteProvider"
            description: "Delete a specified provider"
"/deployments/{deploymentUUID}":
    uriParameters:
        "deploymentUUID":
            displayName: "deploymentUUID"
            description: "Deployment UUID"
            type: string
            required: true
            repeat: false
    displayName: "Deployment"
    description: "Operations on a deployment"
    get:
        description: "Get deployment info"
        responses:
            "200":
                description: "Returns information on a deployment"
                body:
                    "application/json":
                        schema: "GestaltAppDeployment"
            "404":
                description: "Specified deployment does not exist"
    "/kill":
        post:
            description: "Kill an application deployment"
            responses:
                "202":
                    description: "The kill request was accepted and will be processed asynchronously"
    "/delete":
        post:
            description: "Delete an application deployment"
            responses:
                "202":
                    description: "The delete request was accepted and will be processed asynchronously"
"/scale/{nodeUUID}":
    uriParameters:
        "nodeUUID":
            displayName: "nodeUUID"
            description: "Node UUID"
            type: string
            required: true
            repeat: false
    post:
      description: "Scale the specified node to a given number of instances"
      responses:
          "202":
              description: "The scaling request was accepted and will be processed asynchronously"
      queryParameters:
          "numInstances":
              displayName: "numInstances"
              description: "Target number of instances for the specified node"
              type: integer
              required: true
              repeat: false
"/migrate/{deploymentUUID}":
    uriParameters:
        "deploymentUUID":
            displayName: "deploymentUUID"
            description: "Deployment UUID"
            type: string
            required: true
            repeat: false
    post:
        description: "Migrate the specified deployment to a given provider"
        queryParameters:
            "providerId":
                displayName: "providerId"
                description: "ID of the provider to which the deployment should be migrated"
                type: integer
                required: true
                repeat: false
        responses:
            "202":
                description: "The migrate request was accepted and will be processed asynchronously"

#%RAML 0.8
title: "GestaltLauncher"
version: "1.0.0"
baseUri: "https://launcher.galacticfog.com:80"
securitySchemes:
  - basic:
      type: Basic Authentication
securedBy: [ null ]
schemas:
    -
        "GestaltAppDeployment": '{"type":"object","title":"GestaltAppDeployment","properties":{"id":{"type":"integer","required":true,"title":"id"},"status":{"type":"string","required":true,"title":"status"}}}'
        "GestaltProvider": '{"type":"object","title":"GestaltProvider","properties":{"id":{"type":"integer","required":true,"title":"id"},"name":{"type":"string","required":true,"title":"name"},"description":{"type":"string","required":true,"title":"description"},"type":{"type":"string","required":true,"title":"type"}}}'
"/providers":
    displayName: "Providers"
    description: "Operations on providers"
    get:
        displayName: "ListProviders"
        description: "List providers"
    post:
        displayName: "RegisterProvider"
        description: "Register a new provider"
    "/{providerId}":
        displayName: "Provider"
        description: "Operations on a single provider"
        uriParameters:
            "providerId":
                displayName: "providerId"
                description: "Provider ID"
                type: integer
                required: true
                repeat: false
        get:
            displayName: "GetProvider"
            description: "Get information on a specified provider"
        delete:
            displayName: "DeleteProvider"
            description: "Delete a specified provider"
"/deployments/{deploymentUUID}":
    uriParameters:
        "deploymentUUID":
            displayName: "deploymentUUID"
            description: "Deployment UUID"
            type: string
            required: true
            repeat: false
    displayName: "Deployment"
    description: "Operations on a deployment"
    get:
        description: "Get deployment info"
        responses:
            "200":
                description: "Returns information on a deployment"
                body:
                    "application/json":
                        schema: "GestaltAppDeployment"
            "404":
                description: "Specified deployment does not exist"
    "/kill":
        post:
            description: "Kill an application deployment"
            responses:
                "202":
                    description: "The kill request was accepted and will be processed asynchronously"
    "/delete":
        post:
            description: "Delete an application deployment"
            responses:
                "202":
                    description: "The delete request was accepted and will be processed asynchronously"
"/scale/{nodeUUID}":
    uriParameters:
        "nodeUUID":
            displayName: "nodeUUID"
            description: "Node UUID"
            type: string
            required: true
            repeat: false
    queryParameters:
        "numInstances":
            displayName: "numInstances"
            description: "Target number of instances for the specified node"
            type: integer
            required: true
            repeat: false
    post:
        description: "Scale the specified node to a given number of instances"
        responses:
            "202":
                description: "The scaling request was accepted and will be processed asynchronously"
"/migrate/{deploymentUUID}":
    uriParameters:
        "deploymentUUID":
            displayName: "deploymentUUID"
            description: "Deployment UUID"
            type: string
            required: true
            repeat: false
    queryParameters:
        "providerId":
            displayName: "providerId"
            description: "ID of the provider to which the deployment should be migrated"
            type: integer
            required: true
            repeat: false
    post:
        description: "Migrate the specified deployment to a given provider"
        responses:
            "202":
                description: "The migrate request was accepted and will be processed asynchronously"