Skip to content

Quotes

This resource will return to the user a famous (or not so famous) quoted saying and it's author. The quote can be returned as plain text, JSON, XML, HTML, CLOD or YAML.

Resource

https://rest.omegatower.ninja/toolbox/v1/quotes

Methods Allowed

GET, HEAD

Available Response Representations

200 OK

  • text/plain; charset=UTF-8
  • text/html; charset=UTF-8
  • application/xml
  • application/json
  • application/x-clod
  • application/x-yaml

400 Bad Request

  • text/plain; charset=UTF-8
  • text/html; charset=UTF-8
  • application/xml
  • application/json
  • application/x-clod
  • application/x-yaml

Request Query Parameters

Test Mode

Sending the Test parameter will return to the user in the "test" section all the possible parameters with their current values. This can be used to verify that you are able to successfully connect to the resource. It will be returned formatted as defined by the Output parameter. If none is sent, "false" is assumed.

Output Parameter

This parameter defines how the quotes are to be returned to the user. Values of "text", "verbose", "json", "xml", "html", "clod" or "yaml" are allowed. If none is sent, "text" is assumed.

First Parameter

This parameter defines which will be returned first, the quote or the author. This parameter only has effect when the Output parameter is set to "text". Values of "quote" or "author" are allowed. If none is sent, "quote" is assumed.

Author Parameter

This parameter defines if the author is to be returned. This parameter only has effect when the Output parameter is set to "text". Values of "true" or "false" are allowed. If none is sent, "true" is assumed.

Separator Parameter

This parameter defines what character string is to be sent between the quote and the author. This parameter only has effect when the Output parameter is set to "text". It is a comma delimited list of UTF-8 decimal values. A maximum of 8 values can be sent. Integer values between 32 and 126 inclusive are allowed. UTF-8 decimal code values can be found at the UTF-8 encoding table and Unicode characters web page. If none is sent, "32,45,32" is assumed.

Enclose Parameter

This parameter defines which quote character is to be used to enclose the quote. This parameter only has effect when the Output parameter is set to "text". The values of "quote", "apostrophe" or "none" are allowed. If no value is sent, "quote" is assumed.

Schemas

JSON

quotes-schema.json

{
    "title": "Toolbox Resources Quotes Schema",
    "description": "Version 1.2.0.13",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://toolbox.omegatower.ninja/schemas/v1/quotes-schema.json",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "quotes": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "test": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "parameter_test": {
                            "type": "boolean"
                        },
                        "parameter_output": {
                            "type": "string"
                        },
                        "parameter_first": {
                            "type": "string"
                        },
                        "parameter_author": {
                            "type": "boolean"
                        },
                        "parameter_separator": {
                            "type": "string"
                        },
                        "parameter_enclose": {
                            "type": "string"
                        }
                    }
                },
                "data": {
                    "type": "object",
                    "properties": {
                        "text": {
                            "type": "string"
                        },
                        "author": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false
                },
                "error": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "title": {
                            "type": "string"
                        },
                        "detail": {
                            "type": "string"
                        },
                        "resource_server": {
                            "type": "string"
                        },
                        "type": {
                            "type": "integer"
                        },
                        "source": {
                            "type": "string"
                        }
                    }
                },
                "links": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "about": {
                            "type": "string"
                        },
                        "openapi": {
                            "type": "string"
                        },
                        "swaggerhub": {
                            "type": "string"
                        },
                        "wadl": {
                            "type": "string"
                        },
                        "describedby": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "about",
                        "openapi",
                        "swaggerhub",
                        "wadl"
                    ]
                }
            },
            "required": [
                "test",
                "data",
                "error",
                "links"
            ]
        }
    },
    "required": [
        "quotes"
    ]
}

quotes JSON Schema Diagram

XML

quotes.xsd

<?xml version="1.0" encoding="utf-8"?>
<!-- Toolbox Resources Quotes Schema, Version 1.2.0.13 -->
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="quotes">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="test" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0">
                            <xs:element name="parameter_test" type="xs:boolean" minOccurs="1" maxOccurs="1" />
                            <xs:element name="parameter_output" type="xs:token" minOccurs="1" maxOccurs="1" />
                            <xs:element name="parameter_first" type="xs:token" minOccurs="1" maxOccurs="1" />
                            <xs:element name="parameter_author" type="xs:boolean" minOccurs="1" maxOccurs="1" />
                            <xs:element name="parameter_separator" type="xs:token" minOccurs="1" maxOccurs="1" />
                            <xs:element name="parameter_enclose" type="xs:token" minOccurs="1" maxOccurs="1" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="data" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0">
                            <xs:element name="text" type="xs:string" minOccurs="1" maxOccurs="1" />
                            <xs:element name="author" type="xs:string" minOccurs="1" maxOccurs="1" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0">
                            <xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1" />
                            <xs:element name="detail" type="xs:string" minOccurs="1" maxOccurs="1" />
                            <xs:element name="resource_server" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
                            <xs:element name="type" type="xs:unsignedByte" minOccurs="1" maxOccurs="1" />
                            <xs:element name="source" type="xs:string" minOccurs="1" maxOccurs="1" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="links" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0">
                            <xs:element name="about" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
                            <xs:element name="openapi" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
                            <xs:element name="swaggerhub" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
                            <xs:element name="wadl" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
                            <xs:element name="describedby" type="xs:anyURI" minOccurs="1" maxOccurs="1" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

quotes XML Schema Diagram