Skip to content

Output Data Types

The Response Body can be returned as plain text, JSON, XML, HTML, CLOD or YAML by using the "output" parameter with each of the resources.

Caution

For technical reasons beyond my control at this time, the Accept header is completely ignored by the resources. If you simply MUST send an Accept header, try '*/*' first. If that doesn't work, 'application/json' should.

Output = "text"

This output type will return a simple text reponse from the resource.

https://rest.omegatower.ninja/toolbox/v1/characters?output=text

Returns:

content-type: text/plain; charset=UTF-8

 !"#$%&'(

Output = "verbose"

This output type will return a textual representation of the complete reponse from the resource.

https://rest.omegatower.ninja/toolbox/v1/quotes?output=verbose

Returns:

content-type: text/plain; charset=UTF-8

Array
(
    [test] => Array
        (
        )

    [data] => Array
        (
            [text] => Any sufficiently advanced bug is indistinguishable from a feature.
            [author] => Rich Kulawiec
        )

    [error] => Array
        (
        )

    [links] => Array
        (
            [about] => https://toolbox.omegatower.ninja/resources/quotes
            [openapi] => https://toolbox.omegatower.ninja/schemas/v1/openapi.yaml
            [swaggerhub] => https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/#/Quotes/QuotesGet/
            [wadl] => https://toolbox.omegatower.ninja/schemas/v1/v1.wadl
        )

)

Output = "json"

This output type will return a JSON representation of the complete reponse from the resource.

https://rest.omegatower.ninja/toolbox/v1/conversions?output=json

Returns:

content-type: application/json

{
    "conversions": {
        "test": {},
        "data": {
            "result": 0.304799996192195
        },
        "error": {},
        "links": {
            "about": "https://toolbox.omegatower.ninja/resources/conversions",
            "openapi": "https://toolbox.omegatower.ninja/schemas/v1/openapi.yaml",
            "swaggerhub": "https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/#/Conversions/ConversionsGet/",
            "wadl": "https://toolbox.omegatower.ninja/schemas/v1/v1.wadl",
            "describedby": "https://toolbox.omegatower.ninja/schemas/v1/conversions-schema.json"
        }
    }
}

Output = "xml"

This output type will return an XML representation of the complete reponse from the resource.

https://rest.omegatower.ninja/toolbox/v1/quotes?output=xml

Returns:

content-type: application/xml

<?xml version="1.0"?>
<quotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://toolbox.omegatower.ninja/schemas/v1/quotes.xsd">
  <test/>
  <data>
    <text>It is a damn poor mind indeed which can't think of at least two ways to spell any word.</text>
    <author>Andrew Jackson</author>
  </data>
  <error/>
  <links>
    <about>https://toolbox.omegatower.ninja/resources/quotes</about>
    <openapi>https://toolbox.omegatower.ninja/schemas/v1/openapi.yaml</openapi>
    <swaggerhub>https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/#/Quotes/QuotesGet/</swaggerhub>
    <wadl>https://toolbox.omegatower.ninja/schemas/v1/v1.wadl</wadl>
    <describedby>https://toolbox.omegatower.ninja/schemas/v1/quotes.xsd</describedby>
  </links>
</quotes>

Output = "html"

This output type will return an HTML representation of the complete reponse from the resource.

https://rest.omegatower.ninja/toolbox/v1/reflections?output=html

Returns:

content-type: text/html; charset=UTF-8

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="application-name" content="Toolbox Resources 1.2.0.13 (https://toolbox.omegatower.ninja/)">
  <link href="https://rest.omegatower.ninja/toolbox/v1/css/style.css" rel="stylesheet" type="text/css">
  <link href="https://toolbox.omegatower.ninja/resources/characters" rel="about" type="text/html">
  <link href="https://rest.omegatower.ninja/toolbox/v1/oas3.yaml" rel="openapi" type="application/x-yaml">
  <link href="https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/1.2.0.13#/Characters/CharactersGet/" rel="swaggerhub" type="text/html">
  <link href="https://rest.omegatower.ninja/toolbox/v1/v1.wadl" rel="wadl" type="vnd.sun.wadl+xml">
  <title>Toolbox Resources Reflections</title>
</head>
<body>
  <table class="outputTable">
    <tr>
      <th>reflections</th>
      <td>
        <table class="outputTable">
          <tr>
            <th>test</th>
            <td></td>
          </tr>
          <tr>
            <th>data</th>
            <td>
              <table class="outputTable">
                <tr>
                  <th>hello</th>
                  <td>Hello, User!</td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <th>error</th>
            <td></td>
          </tr>
          <tr>
            <th>links</th>
            <td>
              <table class="outputTable">
                <tr>
                  <th>about</th>
                  <td>
                    <a href="https://toolbox.omegatower.ninja/resources/reflections" target="_blank">https://toolbox.omegatower.ninja/resources/reflections</a>
                  </td>
                </tr>
                <tr>
                  <th>openapi</th>
                  <td>
                    <a href="https://rest.omegatower.ninja/toolbox/v1/openapi.yaml" target="_blank">https://rest.omegatower.ninja/toolbox/v1/openapi.yaml</a>
                  </td>
                </tr>
                <tr>
                  <th>swaggerhub</th>
                  <td>
                    <a href="https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/#/Reflections/ReflectionsGet/" target="_blank">https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/#/Reflections/ReflectionsGet/</a>
                  </td>
                </tr>
                <tr>
                  <th>wadl</th>
                  <td>
                    <a href="https://rest.omegatower.ninja/toolbox/v1/v1.wadl" target="_blank">https://rest.omegatower.ninja/toolbox/v1/v1.wadl</a>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</body>
</html>

Output = "clod"

This output type will return a CLOD representation of the complete reponse from the resource.

More Information

More information about the CLOD data format can be found here: Concise Logically Organized Data

https://rest.omegatower.ninja/toolbox/v1/conversions?output=clod

Returns:

content-type: application/x-clod

clod|2.0.0.14~instance|0|uuid|fd833342-1494-42b5-88f7-2a13f50c6d57~1|0|conversions|~2|1|test|~3|1|data|~4|3|result|0.30479999619219~5|1|error|~6|1|links|~7|6|about|https://toolbox.omegatower.ninja/resources/conversions~8|6|openapi|https://toolbox.omegatower.ninja/schemas/v1/openapi.yaml~9|6|swaggerhub|https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/1.2.0.13#/Conversions/ConversionsGet/~10|6|wadl|https://toolbox.omegatower.ninja/schemas/v1/v1.wadl~end|0|count|10~

Output = "yaml"

This output type will return a YAML representation of the complete reponse from the resource.

https://rest.omegatower.ninja/toolbox/v1/reflections?output=yaml

Returns:

content-type: application/x-yaml

%YAML 1.2
---
reflections:
  test:
  data:
    hello: "Hello, User!"
  error:
  links:
    about: "https://toolbox.omegatower.ninja/resources/reflections"
    openapi: "https://toolbox.omegatower.ninja/schemas/v1/openapi.yaml"
    swaggerhub: "https://app.swaggerhub.com/apis-docs/OTDP/Toolbox/#/Reflections/ReflectionsGet/"
    wadl: "https://toolbox.omegatower.ninja/schemas/v1/v1.wadl"
...