remove _embedded from GET /api/evidence example

now returns vanilla json in the *application/json* case

refs #19

#%RAML 0.8
title: OpenBEL API
version: 0.0.2
baseUri: http://next.belframework.org
schemas:
  - evidence-collection: !include http://next.belframework.org/schema/evidence-collection.schema.json
  - evidence:            !include http://next.belframework.org/schema/evidence.schema.json
/api:
  description: The root resource collection.
  get:
    headers:
        Accept:
          displayName: Accept
    responses:
      200:
        body:
          application/hal+json:
            example: |
              {
                "_links": {
                  "item": [
                    {
                      "href": "http://next.belframework.org/api/annotations"
                    },
                    {
                      "href": "http://next.belframework.org/api/evidence"
                    },
                    {
                      "href": "http://next.belframework.org/api/expressions"
                    },
                    {
                      "href": "http://next.belframework.org/api/functions"
                    },
                    {
                      "href": "http://next.belframework.org/api/namespaces"
                    }
                  ]
                }
              }
  /annotations:
    description: Represents the annotation resource collection.
    get:
      description: Retrieves all annotation resources.
    /{annotation}:
      description: Represents a single annotation resource.
      get:
        description: Retrieves an annotation resource.
      /{annotation}/values:
        description: Represents all annotation value resources available on the annotation resource identified by *{annotation}*.
        /{value}:
          description: Represents a single annotation value resources available on the annotation resource identified by *{annotation}* and *{value}*.
          get:
            description:
  /evidence:
    description: |
      Operate on the evidence resource collection.

      *Operations*

      - Filter the evidence resource collection using `GET /evidence` with query parameters.
      - Retrieve an evidence resource using `GET /evidence/{id}`.
      - Create a new evidence resource using `POST /evidence` with a supported content type.
      - Update an existing evidence resource using `PUT /evidence/{id}` with a supported content type.
      - Delete an existing evidence resource using `DELETE /evidence/{id}`.

    post:
      description: |
        Create an evidence resource.

        Include a *profile* parameter in the *Content-Type* header to convey the schema evidence schema for the JSON document.

        *Example*:

        - `Content-Type: application/json; profile=http://next.belframework.org/schema/evidence.schema.json`
      responses:
        201:
          description: |
            *201 Created*

            The evidence resource was created.

            The link to the evidence resource is conveyed is the *Link* header.
        415:
          description: |
            *415 Unsupported Media Type*

            The evidence resource body was not a supported media type..
      body:
        application/json:
          schema: evidence
          example: |
            {
              "evidence": {
                "bel_statement": "a(CHEBI:\"reactive oxygen species\") increases r(HGNC:JUN)",
                "citation": {
                  "type": "PubMed",
                  "name": "Free Radic Biol Med 2000 Feb 1 28(3) 463-99",
                  "id": "10699758"
                },
                "biological_context": {
                  "Species": "9606",
                  "CellLine": "LNCAP cell",
                  "Anatomy": "prostate gland",
                  "Cell": "fibroblast",
                  "Disease": "leukemia"
                },
                "metadata": {
                  "status": "Approved"
                }
              }
            }
    get:
      description: |
        Retrieve the evidence resource collection.

        This collection must be paged using *offset* (defaults to `0`) as the start index and *length* (defaults to `100`) as the number of evidence resources to return.

        This collection can be filtered by specifying one or more *filter* query parameters. A filter query parameter specifies the *category*, *name*, and *value* of the filter and is encoded as a JSON object. For example the citation id filter might be encoded as:

        ```json
          {
            "category": "citation",
            "name": "id",
            "value": "133785101"
          }
        ```

        This collection includes a *facets* array where each facet value is captured individually. For example for the citation id filter the facet object would be encoded as:

        ```json
          {
            "category": "citation",
            "name": "id",
            "value": "133785101",
            "filter": "{\"category\": \"citation\", \"name\": \"id\", \"value\": \"133785101\"}",
            "count": 25
          }
        ```

        The *filter* property value has the same form as the *filter* query parameter. This is intended to support filtering the evidence resource collection by selected facets.
      headers:
        Accept:
          displayName: Accept
          description: |
            The Accept header informs the server which media types the client accepts.
      queryParameters:
        offset:
          type: integer
          description: The evidence resource index that starts a page of the evidence resource collection.
          example: 0
          required: false
        length:
          type: integer
          description: The length of the evidence resource collection to retrieve.
          example: 100
          required: false
        filter:
          type: string
          description: A filter to apply to the evidence resource collection to narrow the resources retrieved.
          example: |
            {"category":"context","name":"Anatomy","value":"prostate gland"}
          required: false
      responses:
        200:
          description: |
            An example path for this resource might be `http://next.belframework.org/api/evidence?offset=0&length=1&filter={%22category%22:%22context%22,%22name%22:%22Anatomy%22,%22value%22:%22prostate%20gland%22}`.
          body:
            application/json:
              schema: evidence-collection
              example: |
                {
                  "evidence": [
                    {
                      "bel_statement": "p(HGNC:CDH1) decreases cat(complex(p(HGNC:ITGAV),p(HGNC:ITGB5)))",
                      "citation": {
                        "type": "Other",
                        "name": "Landes Bioscience - Altered Integrin Expression in Three Common Types of Human Cancer=Breast Cancer",
                        "id": "Landes Bioscience - Altered Integrin Expression in Three Common Types of Human Cancer=Breast Cancer"
                      },
                      "biological_context": {
                        "Species": "9606"
                      },
                      "metadata": {
                        "status": "Review"
                      }
                    }
                  ]
                  "facets": [
                    {
                      "category": "context",
                      "name": "Species",
                      "value": "9606",
                      "filter": "{\"category\":\"context\",\"name\":\"Species\",\"value\":\"9606\"}",
                      "count": 49071
                    },
                    {
                      "category": "context",
                      "name": "Species",
                      "value": "10090",
                      "filter": "{\"category\":\"context\",\"name\":\"Species\",\"value\":\"10090\"}",
                      "count": 19416
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Review",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Review\"}",
                      "count": 18954
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Approved",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Approved\"}",
                      "count": 18947
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Rejected",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Rejected\"}",
                      "count": 18896
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Draft",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Draft\"}",
                      "count": 18784
                    },
                    {
                      "category": "context",
                      "name": "Species",
                      "value": "10116",
                      "filter": "{\"category\":\"context\",\"name\":\"Species\",\"value\":\"10116\"}",
                      "count": 7091
                    },
                    {
                      "category": "context",
                      "name": "Anatomy",
                      "value": "liver",
                      "filter": "{\"category\":\"context\",\"name\":\"Anatomy\",\"value\":\"liver\"}",
                      "count": 2357
                    }
                  ]
                }
    /{identifier}:
      description:
      get:
      put:
        description: |
          Replaces an evidence resource identified by *{identifier}*.

          Include a *profile* parameter in the *Content-Type* header to convey the schema evidence schema for the JSON document.

          *Example*:

          - `Content-Type: application/json; profile=http://next.belframework.org/schema/evidence.schema.json`
        body:
          application/json:
            schema: evidence
            example: |
              {
                "evidence": {
                  "bel_statement": "a(CHEBI:\"reactive oxygen species\") increases r(HGNC:JUN)",
                  "citation": {
                    "type": "PubMed",
                    "name": "Free Radic Biol Med 2000 Feb 1 28(3) 463-99",
                    "id": "10699758"
                  },
                  "biological_context": {
                    "Species": "9606",
                    "CellLine": "LNCAP cell",
                    "Anatomy": "prostate gland",
                    "Cell": "fibroblast",
                    "Disease": "leukemia"
                  },
                  "metadata": {
                    "status": "Approved"
                  }
                }
              }
        responses:
          202:
            description: |
              *202 Accepted*

              The replacement for the evidence resource will be applied.
          404:
            description: |
              *404 Not Found*

              An evidence resource, identified by *{identifier}*, does not exist.
          415:
            description: |
              *415 Unsupported Media Type*

              The evidence resource body was not a supported media type.
      patch:
      delete:
  /expressions/{bel}/completions:
    description: |
      Retrieve completions for the *BEL* expression fragment. The caret position to complete from defaults to the end of *BEL* expression fragment.

      Examples:

        - *aabund* yields functions *microRNAAbundance* and *rnaAbundance*
        - *p(H* yields functions *chaperoneActivity*, *pathology*, *phosphataseActivity* and namespace prefixes *CHEBI*, *CHEBIID*, *HGNC*, *MESHCS*, *MESHD*, *MESHPP*, *SCHEM*
        - *tscript(p(HGNC:* yields namespace values *AKT1*, *AKT2*, etc.

      Custom Caret Position:

      The caret position can be provided to indicate where to complete from.

      Examples:

        - *pro(HGNC:*, *caret_position*: `2` yields functions *biologicalProcess*, *products*, *proteinAbundance*, and *proteinModification*
    uriParameters:
      bel:
        type: string
        description: BEL statement fragment; Completions will be provided for this input.
        required: false
    get:
      description: |
        Retrieve completions for the *BEL* expression fragment. The caret position to complete from defaults to the end of *BEL* expression fragment.

        Examples:

        - *aabund* yields functions *microRNAAbundance* and *rnaAbundance*
        - *p(H* yields functions *chaperoneActivity*, *pathology*, *phosphataseActivity* and namespace prefixes *CHEBI*, *CHEBIID*, *HGNC*, *MESHCS*, *MESHD*, *MESHPP*, *SCHEM*
        - *tscript(p(HGNC:* yields namespace values *AKT1*, *AKT2*, etc.

        Custom Caret Position:

        The caret position can be provided to indicate where to complete from.

        Examples:

        - *pro(HGNC:*, *caret_position*: `2` yields functions *biologicalProcess*, *products*, *proteinAbundance*, and *proteinModification*
      headers:
        Accept:
          displayName: Accept
      queryParameters:
        caret_position:
          type: integer
          description: The position of the caret within the *bel* input. Defaults to the right-most caret_position for *bel* (e.g. length of *bel* input).
          example: 0
          required: false
      responses:
        200:
          body:
            application/json:
              example: |
                [
                  {
                    "completion": {
                      "type": "namespace_prefix",
                      "label": "HGNC",
                      "value": "HGNC:",
                      "highlight": {
                        "start_position": 2,
                        "end_position": 3,
                        "range_type": "inclusive"
                      },
                      "actions": [
                        {
                          "delete": {
                              "start_position": 2,
                              "end_position": 3,
                              "range_type": "inclusive"
                          },
                          "insert": {
                              "position": 2,
                              "value": "HGNC:"
                          },
                          "move_cursor": {
                              "position": 7
                          }
                        }
                      ]
                    }
                  }
                ]
              schema: |
                {
                  "$schema": "http://json-schema.org/draft-04/schema",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "completion"
                    ],
                    "properties": {
                      "completion": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "type",
                          "label",
                          "value",
                          "highlight",
                          "actions"
                        ],
                        "properties": {
                          "type": {
                            "enum": [
                              "function",
                              "namespace_prefix",
                              "namespace_value"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "highlight": {
                            "oneOf": [
                              {
                                "type": "null"
                              },
                              {
                                "type": "object",
                                "required": [
                                  "start_position",
                                  "end_position",
                                  "range_type"
                                ],
                                "properties": {
                                  "start_position": {
                                    "type": "integer"
                                  },
                                  "end_position": {
                                    "type": "integer"
                                  },
                                  "range_type": {
                                    "enum": [
                                      "exclusive",
                                      "inclusive"
                                    ]
                                  }
                                }
                              }
                            ]
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "delete"
                                  ],
                                  "properties": {
                                    "delete": {
                                      "type": "object",
                                      "required": [
                                        "start_position",
                                        "end_position",
                                        "range_type"
                                      ],
                                      "properties": {
                                        "start_position": {
                                          "type": "integer"
                                        },
                                        "end_position": {
                                          "type": "integer"
                                        },
                                        "range_type": {
                                          "enum": [
                                            "exclusive",
                                            "inclusive"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "insert"
                                  ],
                                  "properties": {
                                    "insert": {
                                      "type": "object",
                                      "required": [
                                        "position",
                                        "value"
                                      ],
                                      "properties": {
                                        "position": {
                                          "type": "integer"
                                        },
                                        "value": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "move_cursor"
                                  ],
                                  "properties": {
                                    "move_cursor": {
                                      "type": "object",
                                      "required": [
                                        "position"
                                      ],
                                      "properties": {
                                        "position": {
                                          "type": "integer"
                                        }
                                      }
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
  /functions:
    description: Retrieve the BEL function resource collection.
    get:
      headers:
        Accept:
          displayName: Accept
      responses:
        200:
  /functions/{fx}:
    get:
      headers:
        Accept:
          displayName: Accept
      responses:
        200:
  /namespaces:
  /namespaces/{namespace}:

  /namespaces/{namespace}/equivalents:
    post:
  /namespaces/{namespace}/orthologs:
    post:
  /namespaces/{namespace}/{value}:
  /namespaces/{namespace}/{value}/equivalents/namespaces/{target}:
  /namespaces/{namespace}/{value}/orthologs/namespaces/{target}:
# vim: ft=yaml sw=2 ts=2 sts=2 expandtab:

#%RAML 0.8
title: OpenBEL API
version: 0.0.2
baseUri: http://next.belframework.org
schemas:
  - evidence-collection: !include http://next.belframework.org/schema/evidence-collection.schema.json
  - evidence:            !include http://next.belframework.org/schema/evidence.schema.json
/api:
  description: The root resource collection.
  get:
    headers:
        Accept:
          displayName: Accept
    responses:
      200:
        body:
          application/hal+json:
            example: |
              {
                "_links": {
                  "item": [
                    {
                      "href": "http://next.belframework.org/api/annotations"
                    },
                    {
                      "href": "http://next.belframework.org/api/evidence"
                    },
                    {
                      "href": "http://next.belframework.org/api/expressions"
                    },
                    {
                      "href": "http://next.belframework.org/api/functions"
                    },
                    {
                      "href": "http://next.belframework.org/api/namespaces"
                    }
                  ]
                }
              }
  /annotations:
    description: Represents the annotation resource collection.
    get:
      description: Retrieves all annotation resources.
    /{annotation}:
      description: Represents a single annotation resource.
      get:
        description: Retrieves an annotation resource.
      /{annotation}/values:
        description: Represents all annotation value resources available on the annotation resource identified by *{annotation}*.
        /{value}:
          description: Represents a single annotation value resources available on the annotation resource identified by *{annotation}* and *{value}*.
          get:
            description:
  /evidence:
    description: |
      Operate on the evidence resource collection.

      *Operations*

      - Filter the evidence resource collection using `GET /evidence` with query parameters.
      - Retrieve an evidence resource using `GET /evidence/{id}`.
      - Create a new evidence resource using `POST /evidence` with a supported content type.
      - Update an existing evidence resource using `PUT /evidence/{id}` with a supported content type.
      - Delete an existing evidence resource using `DELETE /evidence/{id}`.

    post:
      description: |
        Create an evidence resource.

        Include a *profile* parameter in the *Content-Type* header to convey the schema evidence schema for the JSON document.

        *Example*:

        - `Content-Type: application/json; profile=http://next.belframework.org/schema/evidence.schema.json`
      responses:
        201:
          description: |
            *201 Created*

            The evidence resource was created.

            The link to the evidence resource is conveyed is the *Link* header.
        415:
          description: |
            *415 Unsupported Media Type*

            The evidence resource body was not a supported media type..
      body:
        application/json:
          schema: evidence
          example: |
            {
              "evidence": {
                "bel_statement": "a(CHEBI:\"reactive oxygen species\") increases r(HGNC:JUN)",
                "citation": {
                  "type": "PubMed",
                  "name": "Free Radic Biol Med 2000 Feb 1 28(3) 463-99",
                  "id": "10699758"
                },
                "biological_context": {
                  "Species": "9606",
                  "CellLine": "LNCAP cell",
                  "Anatomy": "prostate gland",
                  "Cell": "fibroblast",
                  "Disease": "leukemia"
                },
                "metadata": {
                  "status": "Approved"
                }
              }
            }
    get:
      description: |
        Retrieve the evidence resource collection.

        This collection must be paged using *offset* (defaults to `0`) as the start index and *length* (defaults to `100`) as the number of evidence resources to return.

        This collection can be filtered by specifying one or more *filter* query parameters. A filter query parameter specifies the *category*, *name*, and *value* of the filter and is encoded as a JSON object. For example the citation id filter might be encoded as:

        ```json
          {
            "category": "citation",
            "name": "id",
            "value": "133785101"
          }
        ```

        This collection includes a *facets* array where each facet value is captured individually. For example for the citation id filter the facet object would be encoded as:

        ```json
          {
            "category": "citation",
            "name": "id",
            "value": "133785101",
            "filter": "{\"category\": \"citation\", \"name\": \"id\", \"value\": \"133785101\"}",
            "count": 25
          }
        ```

        The *filter* property value has the same form as the *filter* query parameter. This is intended to support filtering the evidence resource collection by selected facets.
      headers:
        Accept:
          displayName: Accept
          description: |
            The Accept header informs the server which media types the client accepts.
      queryParameters:
        offset:
          type: integer
          description: The evidence resource index that starts a page of the evidence resource collection.
          example: 0
          required: false
        length:
          type: integer
          description: The length of the evidence resource collection to retrieve.
          example: 100
          required: false
        filter:
          type: string
          description: A filter to apply to the evidence resource collection to narrow the resources retrieved.
          example: |
            {"category":"context","name":"Anatomy","value":"prostate gland"}
          required: false
      responses:
        200:
          description: |
            An example path for this resource might be `http://next.belframework.org/api/evidence?offset=0&length=1&filter={%22category%22:%22context%22,%22name%22:%22Anatomy%22,%22value%22:%22prostate%20gland%22}`.
          body:
            application/json:
              schema: evidence-collection
              example: |
                {
                  "_embedded": {
                    "evidence": [
                      {
                        "bel_statement": "p(HGNC:CDH1) decreases cat(complex(p(HGNC:ITGAV),p(HGNC:ITGB5)))",
                        "citation": {
                          "type": "Other",
                          "name": "Landes Bioscience - Altered Integrin Expression in Three Common Types of Human Cancer=Breast Cancer",
                          "id": "Landes Bioscience - Altered Integrin Expression in Three Common Types of Human Cancer=Breast Cancer"
                        },
                        "biological_context": {
                          "Species": "9606"
                        },
                        "metadata": {
                          "status": "Review"
                        }
                      }
                    ]
                  },
                  "facets": [
                    {
                      "category": "context",
                      "name": "Species",
                      "value": "9606",
                      "filter": "{\"category\":\"context\",\"name\":\"Species\",\"value\":\"9606\"}",
                      "count": 49071
                    },
                    {
                      "category": "context",
                      "name": "Species",
                      "value": "10090",
                      "filter": "{\"category\":\"context\",\"name\":\"Species\",\"value\":\"10090\"}",
                      "count": 19416
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Review",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Review\"}",
                      "count": 18954
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Approved",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Approved\"}",
                      "count": 18947
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Rejected",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Rejected\"}",
                      "count": 18896
                    },
                    {
                      "category": "metadata",
                      "name": "status",
                      "value": "Draft",
                      "filter": "{\"category\":\"metadata\",\"name\":\"status\",\"value\":\"Draft\"}",
                      "count": 18784
                    },
                    {
                      "category": "context",
                      "name": "Species",
                      "value": "10116",
                      "filter": "{\"category\":\"context\",\"name\":\"Species\",\"value\":\"10116\"}",
                      "count": 7091
                    },
                    {
                      "category": "context",
                      "name": "Anatomy",
                      "value": "liver",
                      "filter": "{\"category\":\"context\",\"name\":\"Anatomy\",\"value\":\"liver\"}",
                      "count": 2357
                    }
                  ]
                }
    /{identifier}:
      description:
      get:
      put:
        description: |
          Replaces an evidence resource identified by *{identifier}*.

          Include a *profile* parameter in the *Content-Type* header to convey the schema evidence schema for the JSON document.

          *Example*:

          - `Content-Type: application/json; profile=http://next.belframework.org/schema/evidence.schema.json`
        body:
          application/json:
            schema: evidence
            example: |
              {
                "evidence": {
                  "bel_statement": "a(CHEBI:\"reactive oxygen species\") increases r(HGNC:JUN)",
                  "citation": {
                    "type": "PubMed",
                    "name": "Free Radic Biol Med 2000 Feb 1 28(3) 463-99",
                    "id": "10699758"
                  },
                  "biological_context": {
                    "Species": "9606",
                    "CellLine": "LNCAP cell",
                    "Anatomy": "prostate gland",
                    "Cell": "fibroblast",
                    "Disease": "leukemia"
                  },
                  "metadata": {
                    "status": "Approved"
                  }
                }
              }
        responses:
          202:
            description: |
              *202 Accepted*

              The replacement for the evidence resource will be applied.
          404:
            description: |
              *404 Not Found*

              An evidence resource, identified by *{identifier}*, does not exist.
          415:
            description: |
              *415 Unsupported Media Type*

              The evidence resource body was not a supported media type.
      patch:
      delete:
  /expressions/{bel}/completions:
    description: |
      Retrieve completions for the *BEL* expression fragment. The caret position to complete from defaults to the end of *BEL* expression fragment.

      Examples:

        - *aabund* yields functions *microRNAAbundance* and *rnaAbundance*
        - *p(H* yields functions *chaperoneActivity*, *pathology*, *phosphataseActivity* and namespace prefixes *CHEBI*, *CHEBIID*, *HGNC*, *MESHCS*, *MESHD*, *MESHPP*, *SCHEM*
        - *tscript(p(HGNC:* yields namespace values *AKT1*, *AKT2*, etc.

      Custom Caret Position:

      The caret position can be provided to indicate where to complete from.

      Examples:

        - *pro(HGNC:*, *caret_position*: `2` yields functions *biologicalProcess*, *products*, *proteinAbundance*, and *proteinModification*
    uriParameters:
      bel:
        type: string
        description: BEL statement fragment; Completions will be provided for this input.
        required: false
    get:
      description: |
        Retrieve completions for the *BEL* expression fragment. The caret position to complete from defaults to the end of *BEL* expression fragment.

        Examples:

        - *aabund* yields functions *microRNAAbundance* and *rnaAbundance*
        - *p(H* yields functions *chaperoneActivity*, *pathology*, *phosphataseActivity* and namespace prefixes *CHEBI*, *CHEBIID*, *HGNC*, *MESHCS*, *MESHD*, *MESHPP*, *SCHEM*
        - *tscript(p(HGNC:* yields namespace values *AKT1*, *AKT2*, etc.

        Custom Caret Position:

        The caret position can be provided to indicate where to complete from.

        Examples:

        - *pro(HGNC:*, *caret_position*: `2` yields functions *biologicalProcess*, *products*, *proteinAbundance*, and *proteinModification*
      headers:
        Accept:
          displayName: Accept
      queryParameters:
        caret_position:
          type: integer
          description: The position of the caret within the *bel* input. Defaults to the right-most caret_position for *bel* (e.g. length of *bel* input).
          example: 0
          required: false
      responses:
        200:
          body:
            application/json:
              example: |
                [
                  {
                    "completion": {
                      "type": "namespace_prefix",
                      "label": "HGNC",
                      "value": "HGNC:",
                      "highlight": {
                        "start_position": 2,
                        "end_position": 3,
                        "range_type": "inclusive"
                      },
                      "actions": [
                        {
                          "delete": {
                              "start_position": 2,
                              "end_position": 3,
                              "range_type": "inclusive"
                          },
                          "insert": {
                              "position": 2,
                              "value": "HGNC:"
                          },
                          "move_cursor": {
                              "position": 7
                          }
                        }
                      ]
                    }
                  }
                ]
              schema: |
                {
                  "$schema": "http://json-schema.org/draft-04/schema",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "completion"
                    ],
                    "properties": {
                      "completion": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "type",
                          "label",
                          "value",
                          "highlight",
                          "actions"
                        ],
                        "properties": {
                          "type": {
                            "enum": [
                              "function",
                              "namespace_prefix",
                              "namespace_value"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "highlight": {
                            "oneOf": [
                              {
                                "type": "null"
                              },
                              {
                                "type": "object",
                                "required": [
                                  "start_position",
                                  "end_position",
                                  "range_type"
                                ],
                                "properties": {
                                  "start_position": {
                                    "type": "integer"
                                  },
                                  "end_position": {
                                    "type": "integer"
                                  },
                                  "range_type": {
                                    "enum": [
                                      "exclusive",
                                      "inclusive"
                                    ]
                                  }
                                }
                              }
                            ]
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "delete"
                                  ],
                                  "properties": {
                                    "delete": {
                                      "type": "object",
                                      "required": [
                                        "start_position",
                                        "end_position",
                                        "range_type"
                                      ],
                                      "properties": {
                                        "start_position": {
                                          "type": "integer"
                                        },
                                        "end_position": {
                                          "type": "integer"
                                        },
                                        "range_type": {
                                          "enum": [
                                            "exclusive",
                                            "inclusive"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "insert"
                                  ],
                                  "properties": {
                                    "insert": {
                                      "type": "object",
                                      "required": [
                                        "position",
                                        "value"
                                      ],
                                      "properties": {
                                        "position": {
                                          "type": "integer"
                                        },
                                        "value": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "move_cursor"
                                  ],
                                  "properties": {
                                    "move_cursor": {
                                      "type": "object",
                                      "required": [
                                        "position"
                                      ],
                                      "properties": {
                                        "position": {
                                          "type": "integer"
                                        }
                                      }
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
  /functions:
    description: Retrieve the BEL function resource collection.
    get:
      headers:
        Accept:
          displayName: Accept
      responses:
        200:
  /functions/{fx}:
    get:
      headers:
        Accept:
          displayName: Accept
      responses:
        200:
  /namespaces:
  /namespaces/{namespace}:

  /namespaces/{namespace}/equivalents:
    post:
  /namespaces/{namespace}/orthologs:
    post:
  /namespaces/{namespace}/{value}:
  /namespaces/{namespace}/{value}/equivalents/namespaces/{target}:
  /namespaces/{namespace}/{value}/orthologs/namespaces/{target}:
# vim: ft=yaml sw=2 ts=2 sts=2 expandtab:


Fix invalid parameter name in RAML

Fix invalid parameter name 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": [
                  {
                    "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"
                    ]
                  }
                }


Include use www.mybring.com instead of mybring.com to avoid ssl issues for a non-supported domain

#%RAML 1.0
---
title: Tracking API
version: v2
baseUri: https://tracking.bring.com/api
types:
  Consignment:
    type: object
    properties:
      consignmentSet:
        type: ConsignmentSet
      apiVersion:
        type: ApiVersion
  ConsignmentSet:
    type: object
    description: ?
    properties:
      consignmentId:
        type: string
      previousConsignmentId:
        type: string
        required: false
      packageSet:
        type: Package[]
      recipientAddress:
        type: Address
      recipientHandlingAddress:
        type: Address
      senderReference:
        type: string
      senderCustomerNumber:
        type: string
      senderCustomerMasterNumber:
        type: string
      senderName:
        type: string
      senderAddress:
        type: Address
      senderCustomerType:
        type: string
      recipientCustomerNumber:
        type: string
      recipientCustomerMasterNumber:
        type: string
      recipientCustomerType:
        type: string
      isPickupNoticeAvailable:
        type: boolean
      consignmentActionSet:
        type: ConsignmentAction
      totalWeightInKgs:
        type: number
      totalVolumeInDm3:
        type: number
  ApiVersion:
    type: object
  ConsignmentAction:
    type: object
    properties:
      actionType:
        type: string
      actionURL:
        type: string
  Package:
    type: object
    properties:
      statusDescription:
        type: string
      descriptions:
        type: string[]
        required: false
      packageNumber:
        type: string
      previousPackageNumber:
        type: string
      productName:
        type: string
      productCode:
        type: string
      productLink:
        type: string
      brand:
        type: string
      lengthInCm:
        type: number
      widthInCm:
        type: number
      heightInCm:
        type: number
      volumeInDm3:
        type: number
      weightInKgs:
        type: number
      pickupCode:
        type: string
      dateOfReturn:
        type: string
      senderName:
        type: string
      senderAddress:
        type: Address
      recipientAddress:
        type: Address
      recipientHandlingAddress:
        type: Address
      eventSet:
        type: Event[]
      additionalServiceSet:
        type: object[]
        required: false
  Event:
    type: object
    properties:
      description: string
      status:
        type: string
      recipientSignature:
        type: NamedElement
      unitId:
        type: string
      unitType:
        type: string
      postalCode:
        type: string
        required: false
      city:
        type: string
        required: false
      countryCode:
        type: string
        required: false
      country:
        type: string
        required: false
      dateIso:
        type: string
      displayDate:
        type: string
      displayTime:
        type: string
      consignmentEvent:
        type: boolean
      insignificant:
        type: boolean
  Address:
    type: object
    properties:
      addressLine1:
        type: string
        required: false
      addressLine2:
        type: string
        required: false
      postalCode:
        type: string
        required: false
      city:
        type: string
        required: false
      countryCode:
        type: string
        required: false
      country:
        type: string
        required: false
  NamedElement:
    type: object
    properties:
      name:
        type: string
        required: false

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 that is publically available from the [Tracking web site](http://tracking.bring.com/).

- title: Formats
  content: |
    The Tracking API generates the following formats:
    - ```XML```
    - ```JSON```
    - ```JSONP```
- title: Versioning
  content: |
    Latest Tracking API version: `v2`

    We encourage you to use the latest version of our API all time.  Of course, we keep the previous version for some time so that you will get enough time to convert your application. This API supports versioning by two means.

    - **Select version by request-header**
      Use the normal URL but add the following request-header:

      | Header | Example |
      |:-------|:--------|
      | `api-version` | `2` |

      **Example request**
      ```curl -H "api-version: 2" https://tracking.bring.com/api/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT```

    - **Select version by URL**
      Use the normal URL, but add **```{v1, v2}```** to the URL. Example:

      | Application | URL example |
      |:-------|:--------|
      | Open tracking | https://tracking.bring.com/api/**v2**/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT |
      | Logged-in tracking | https://www.mybring.com/tracking/api/**v2**/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT |

      You can verify that your request were used correctly by certifying that the response contains an element based on the request type:

      | URI request | Response type | Example |
      |:-------|:--------|:--------|
      | tracking.json | `application/json; charset=utf-8` | `{"apiVersion": "2"}` |
      | tracking.xml | `application/xml;charset=utf-8` | `<ApiVersion>2</ApiVersion>` |

      **Example request**
      ```curl -v https://tracking.bring.com/api/v2/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT```

- title: Authentication
  content: |
    If you are a Mybring user, you can authenticate requests to the Tracking API. Authenticated requests have the following benefits:

    - More information about parcels:
      - Prices
      - Name
      - Address
      - Signatures for proof of develiery
    - Less strict rate limiting

    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 present for authenticating requests, and you have to use the endpoint

        https://www.mybring.com/tracking/api/
- title: JSON API
  content: |
      We follow the [JSON API](http://jsonapi.org/) specification with one
      exception: we allow media type to be specified as `application/json`
      instead of `application/vnd.api+json`.

/{version}/tracking{mediaTypeExtension}:
  displayName: Tracking endpoint
  description: Get information about an existing shipment based on a tracking number, shipment number or reference.
  uriParameters:
    version:
      enum: [ v1, v2 ]
      description: v1 is deprecated and will be removed soon. Use v2 when requesting the tracking API
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Get information about a shipment
    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:
      q:
        description: Reference, package number, shipment number to search for
        type: string
        required: true
        example: TESTPACKAGE-AT-PICKUPPOINT, 370000000000000001
      aktornummer:
        description: Represents a valid customer number registered with Posten
        type: string
        required: false
        example: "12345678901"
      callback:
        description: JSONP callback function name
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        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.

          You can find an XSD for the XML response here: [tracking-v2.xsd](https://tracking.bring.com/schema/api/tracking-v2.xsd).

          A parcel has a number of events connected to it during its travel. Here are a list of current event statuses that can be returned.

          | Event | Description |
          |:-------|:--------|
          | `ARRIVED_DELIVERY` | Arrived Delivery point - This is when a container arrives at recipients address, and can start unloading.
 |
          | `ARRIVED_COLLECTION` | Arrived for collection at pickup point |
          | `ATTEMPTED_DELIVERY` | The package has been attempted delivered at the door. Depending on the service it will be tried again or sent to closest pickup point. |
          | `CUSTOMS` | Package is in customs clearance. |
          | `COLLECTED` | The parcel has been collected at pickup address. |
          | `DELIVERED` | Package has been delivered. |
          | `DELIVERED_SENDER` | Package has been returned to the sender |
          | `DELIVERY_CANCELLED` | Home delivery has been canceled by the customer. |
          | `DELIVERY_CHANGED` | Date for Home delivery has been changed by customer. |
          | `DELIVERY_ORDERED` | Home delivery has been ordered |
          | `DEVIATION` | Deviation in production. Something wrong has happened and there is a probability for delay. |
          | `HANDED_IN` | Package has been handed in to Bring. |
          | `INTERNATIONAL` | Package has been sent from origin country or arrived at destination country.
 |
          | `IN_TRANSIT` | Package is in transit. |
          | `NOTIFICATION_SENT` | Notification for this package has been sent by sms, push and/or mail. This can be informational notifications and action notification like pickup notice. |
          | `PRE_NOTIFIED` | EDI message for the package has been received by Bring. |
          | `READY_FOR_PICKUP` | Package has arrived at pickup point. |
          | `RETURN` | The package has been returned to sender.
 |
          | `TRANSPORT_TO_RECIPIENT` | Package has been loaded for delivery to the recipient. |
          | `TERMINAL` | The package is now registered/arrived at inbound/outbound storage terminal |
          | `UNKNOWN` | Represents unknown / undefined events |

        body:
          application/json:
            type: Consignment
            examples:
              successful:
                displayName: Successful
                description: The example below shows an successful deliverance of a package at a pickup point
                value: !include examples/successful.json
              unsuccessful:
                displayName: Unsuccessful request
                description: Returned upon no search responses being returned for the request itself
                value: !include examples/unsuccessful.json
              notification_received:
                displayName: Unreceived package, with notification regarding EDI
                description: The example below is showing a package that have been EDI notified, but is not received by Bring.
                value: !include examples/notification_received.json
              waiting_at_pup:
                displayName: Waiting at Pickup Point
                description: The example below is showing a package waiting for the recipient to collect it at a pickup point
                value: !include examples/waiting_at_pup.json
              loaded_for_delivery:
                displayName: Package loaded for delivery
                description: The example below is showing a package that has been loaded on a distribution car for delivery to the reciepient.
                value: !include examples/loaded_for_delivery.json
              delivered:
                displayName: Package delivered to customer
                description: The example below is showing a package that has been delivered to the reciepient.
                value: !include examples/delivered.json
          application/xml:
            type: Consignment
            examples:
              successful:
                displayName: Successful
                description: The example below is showing a package that have been EDI notified, but is not received by Bring.
                value: !include examples/successful.xml
              unsuccessful:
                displayName: Unsuccessful request
                description: Returned upon no search responses being returned for the request itself
                value: !include examples/unsuccessful.xml
              notification_received:
                displayName: Unreceived package, with notification regarding EDI
                description: The example below is showing a package that have been EDI notified, but is not received by Bring.
                value: !include examples/notification_received.xml
              waiting_at_pup:
                displayName: Waiting at Pickup Point
                description: The example below is showing a package waiting for the recipient to collect it at a pickup point
                value: !include examples/waiting_at_pup.xml
              loaded_for_delivery:
                displayName: Package loaded for delivery
                description: The example below is showing a package that has been loaded on a distribution car for delivery to the reciepient.
                value: !include examples/loaded_for_delivery.xml
              delivered:
                displayName: Package delivered to customer
                description: The example below is showing a package that has been delivered to the reciepient.
                value: !include examples/delivered.xml

#%RAML 1.0
---
title: Tracking API
version: v2
baseUri: https://tracking.bring.com/api
types:
  Consignment:
    type: object
    properties:
      consignmentSet:
        type: ConsignmentSet
      apiVersion:
        type: ApiVersion
  ConsignmentSet:
    type: object
    description: ?
    properties:
      consignmentId:
        type: string
      previousConsignmentId:
        type: string
        required: false
      packageSet:
        type: Package[]
      recipientAddress:
        type: Address
      recipientHandlingAddress:
        type: Address
      senderReference:
        type: string
      senderCustomerNumber:
        type: string
      senderCustomerMasterNumber:
        type: string
      senderName:
        type: string
      senderAddress:
        type: Address
      senderCustomerType:
        type: string
      recipientCustomerNumber:
        type: string
      recipientCustomerMasterNumber:
        type: string
      recipientCustomerType:
        type: string
      isPickupNoticeAvailable:
        type: boolean
      consignmentActionSet:
        type: ConsignmentAction
      totalWeightInKgs:
        type: number
      totalVolumeInDm3:
        type: number
  ApiVersion:
    type: object
  ConsignmentAction:
    type: object
    properties:
      actionType:
        type: string
      actionURL:
        type: string
  Package:
    type: object
    properties:
      statusDescription:
        type: string
      descriptions:
        type: string[]
        required: false
      packageNumber:
        type: string
      previousPackageNumber:
        type: string
      productName:
        type: string
      productCode:
        type: string
      productLink:
        type: string
      brand:
        type: string
      lengthInCm:
        type: number
      widthInCm:
        type: number
      heightInCm:
        type: number
      volumeInDm3:
        type: number
      weightInKgs:
        type: number
      pickupCode:
        type: string
      dateOfReturn:
        type: string
      senderName:
        type: string
      senderAddress:
        type: Address
      recipientAddress:
        type: Address
      recipientHandlingAddress:
        type: Address
      eventSet:
        type: Event[]
      additionalServiceSet:
        type: object[]
        required: false
  Event:
    type: object
    properties:
      description: string
      status:
        type: string
      recipientSignature:
        type: NamedElement
      unitId:
        type: string
      unitType:
        type: string
      postalCode:
        type: string
        required: false
      city:
        type: string
        required: false
      countryCode:
        type: string
        required: false
      country:
        type: string
        required: false
      dateIso:
        type: string
      displayDate:
        type: string
      displayTime:
        type: string
      consignmentEvent:
        type: boolean
      insignificant:
        type: boolean
  Address:
    type: object
    properties:
      addressLine1:
        type: string
        required: false
      addressLine2:
        type: string
        required: false
      postalCode:
        type: string
        required: false
      city:
        type: string
        required: false
      countryCode:
        type: string
        required: false
      country:
        type: string
        required: false
  NamedElement:
    type: object
    properties:
      name:
        type: string
        required: false

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 that is publically available from the [Tracking web site](http://tracking.bring.com/).

- title: Formats
  content: |
    The Tracking API generates the following formats:
    - ```XML```
    - ```JSON```
    - ```JSONP```
- title: Versioning
  content: |
    Latest Tracking API version: `v2`

    We encourage you to use the latest version of our API all time.  Of course, we keep the previous version for some time so that you will get enough time to convert your application. This API supports versioning by two means.

    - **Select version by request-header**
      Use the normal URL but add the following request-header:

      | Header | Example |
      |:-------|:--------|
      | `api-version` | `2` |

      **Example request**
      ```curl -H "api-version: 2" https://tracking.bring.com/api/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT```

    - **Select version by URL**
      Use the normal URL, but add **```{v1, v2}```** to the URL. Example:

      | Application | URL example |
      |:-------|:--------|
      | Open tracking | https://tracking.bring.com/api/**v2**/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT |
      | Logged-in tracking | https://mybring.com/tracking/api/**v2**/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT |

      You can verify that your request were used correctly by certifying that the response contains an element based on the request type:

      | URI request | Response type | Example |
      |:-------|:--------|:--------|
      | tracking.json | `application/json; charset=utf-8` | `{"apiVersion": "2"}` |
      | tracking.xml | `application/xml;charset=utf-8` | `<ApiVersion>2</ApiVersion>` |

      **Example request**
      ```curl -v https://tracking.bring.com/api/v2/tracking.json?q=TESTPACKAGE-AT-PICKUPPOINT```

- title: Authentication
  content: |
    If you are a Mybring user, you can authenticate requests to the Tracking API. Authenticated requests have the following benefits:

    - More information about parcels:
      - Prices
      - Name
      - Address
      - Signatures for proof of develiery
    - Less strict rate limiting

    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 present for authenticating requests, and you have to use the endpoint

        https://www.mybring.com/tracking/api/
- title: JSON API
  content: |
      We follow the [JSON API](http://jsonapi.org/) specification with one
      exception: we allow media type to be specified as `application/json`
      instead of `application/vnd.api+json`.

/{version}/tracking{mediaTypeExtension}:
  displayName: Tracking endpoint
  description: Get information about an existing shipment based on a tracking number, shipment number or reference.
  uriParameters:
    version:
      enum: [ v1, v2 ]
      description: v1 is deprecated and will be removed soon. Use v2 when requesting the tracking API
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Get information about a shipment
    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:
      q:
        description: Reference, package number, shipment number to search for
        type: string
        required: true
        example: TESTPACKAGE-AT-PICKUPPOINT, 370000000000000001
      aktornummer:
        description: Represents a valid customer number registered with Posten
        type: string
        required: false
        example: "12345678901"
      callback:
        description: JSONP callback function name
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        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.

          You can find an XSD for the XML response here: [tracking-v2.xsd](https://tracking.bring.com/schema/api/tracking-v2.xsd).

          A parcel has a number of events connected to it during its travel. Here are a list of current event statuses that can be returned.

          | Event | Description |
          |:-------|:--------|
          | `ARRIVED_DELIVERY` | Arrived Delivery point - This is when a container arrives at recipients address, and can start unloading.
 |
          | `ARRIVED_COLLECTION` | Arrived for collection at pickup point |
          | `ATTEMPTED_DELIVERY` | The package has been attempted delivered at the door. Depending on the service it will be tried again or sent to closest pickup point. |
          | `CUSTOMS` | Package is in customs clearance. |
          | `COLLECTED` | The parcel has been collected at pickup address. |
          | `DELIVERED` | Package has been delivered. |
          | `DELIVERED_SENDER` | Package has been returned to the sender |
          | `DELIVERY_CANCELLED` | Home delivery has been canceled by the customer. |
          | `DELIVERY_CHANGED` | Date for Home delivery has been changed by customer. |
          | `DELIVERY_ORDERED` | Home delivery has been ordered |
          | `DEVIATION` | Deviation in production. Something wrong has happened and there is a probability for delay. |
          | `HANDED_IN` | Package has been handed in to Bring. |
          | `INTERNATIONAL` | Package has been sent from origin country or arrived at destination country.
 |
          | `IN_TRANSIT` | Package is in transit. |
          | `NOTIFICATION_SENT` | Notification for this package has been sent by sms, push and/or mail. This can be informational notifications and action notification like pickup notice. |
          | `PRE_NOTIFIED` | EDI message for the package has been received by Bring. |
          | `READY_FOR_PICKUP` | Package has arrived at pickup point. |
          | `RETURN` | The package has been returned to sender.
 |
          | `TRANSPORT_TO_RECIPIENT` | Package has been loaded for delivery to the recipient. |
          | `TERMINAL` | The package is now registered/arrived at inbound/outbound storage terminal |
          | `UNKNOWN` | Represents unknown / undefined events |

        body:
          application/json:
            type: Consignment
            examples:
              successful:
                displayName: Successful
                description: The example below shows an successful deliverance of a package at a pickup point
                value: !include examples/successful.json
              unsuccessful:
                displayName: Unsuccessful request
                description: Returned upon no search responses being returned for the request itself
                value: !include examples/unsuccessful.json
              notification_received:
                displayName: Unreceived package, with notification regarding EDI
                description: The example below is showing a package that have been EDI notified, but is not received by Bring.
                value: !include examples/notification_received.json
              waiting_at_pup:
                displayName: Waiting at Pickup Point
                description: The example below is showing a package waiting for the recipient to collect it at a pickup point
                value: !include examples/waiting_at_pup.json
              loaded_for_delivery:
                displayName: Package loaded for delivery
                description: The example below is showing a package that has been loaded on a distribution car for delivery to the reciepient.
                value: !include examples/loaded_for_delivery.json
              delivered:
                displayName: Package delivered to customer
                description: The example below is showing a package that has been delivered to the reciepient.
                value: !include examples/delivered.json
          application/xml:
            type: Consignment
            examples:
              successful:
                displayName: Successful
                description: The example below is showing a package that have been EDI notified, but is not received by Bring.
                value: !include examples/successful.xml
              unsuccessful:
                displayName: Unsuccessful request
                description: Returned upon no search responses being returned for the request itself
                value: !include examples/unsuccessful.xml
              notification_received:
                displayName: Unreceived package, with notification regarding EDI
                description: The example below is showing a package that have been EDI notified, but is not received by Bring.
                value: !include examples/notification_received.xml
              waiting_at_pup:
                displayName: Waiting at Pickup Point
                description: The example below is showing a package waiting for the recipient to collect it at a pickup point
                value: !include examples/waiting_at_pup.xml
              loaded_for_delivery:
                displayName: Package loaded for delivery
                description: The example below is showing a package that has been loaded on a distribution car for delivery to the reciepient.
                value: !include examples/loaded_for_delivery.xml
              delivered:
                displayName: Package delivered to customer
                description: The example below is showing a package that has been delivered to the reciepient.
                value: !include examples/delivered.xml