<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
]>

<!-- $Id: draft-mst-lgapi.xml,v 1.54 2016/05/18 18:26:20 stubbim Exp $
     $Source: /home/CVSROOT/lookingglass-api/docs/rfc/draft-mst-lgapi.xml,v $
     This XML file is based on looking_glass_api__internet_draft.tex rev 1.33
-->

<!-- 
     This draft will be published as  draft-mst-lgapi-04
-->

<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- OPTIONS, known as processing instructions (PIs) go here. -->
<!-- For a complete list and description of PIs,
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable PIs that most I-Ds might want to use. -->
<?rfc strict="yes" ?> <!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC): -->
<?rfc toc="yes"?> <!-- generate a ToC -->
<?rfc tocdepth="2"?> <!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references: -->
<?rfc symrefs="yes"?> <!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?> <!-- sort the reference entries alphabetically -->
<!-- control vertical white space: 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?> <!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?> <!-- keep one blank line between list items -->
<!-- end of popular PIs -->

<rfc category="info" docName="draft-mst-lgapi-04" ipr="trust200902">


<front>
  <title>Looking Glass API</title>

  <author initials="M." surname="Stubbig" fullname="Markus Stubbig">
    <organization>Independent</organization>
    <address>
      <postal>
        <street></street>
        <country>Germany</country>
      </postal>
      <email>stubbig.ietf@gmail.com</email>
    </address>
  </author>

  <date day="18" month="May" year="2016" />

  <keyword>Looking Glass</keyword>
  <keyword>API</keyword>

  <abstract>
    <t>This document introduces an application programming interface (API) to the web-based "Network Looking Glass" software. Its purpose is to provide application programmers uniform access to the Looking Glass service and to analyze standardized response.</t>

    <t>The API interface is supposed to provide the same level of information as web-based interfaces, but in a computer-readable format.</t>
  </abstract>
</front>

<middle>
  <section title="Introduction">
    <t>Many Internet service providers (ISPs) and Internet exchange points (IXPs) offer a complimentary web page to the general public, which gives insights to the backbone routing table, BGP neighbor information, or offered routes.</t>

    <t>The visitor may also execute a ping or traceroute command to a random target address. Some ISPs even offer information about their multicast routing table including the mtrace command. The amount and type of offered information is not limited.</t>

    <t>The service is mostly used for the purpose of troubleshooting and is known under the term of "Looking Glass". The development of various Looking Glass software has led to different systems in usage, syntax, style, and in offered information. The difference is of minor interest to human users, but accessing a Looking Glass web page by script is complicated, inefficient, and error-prone.</t>

    <t>Accessing a Looking Glass service by script is required for repeating tasks. It could be a monitoring system which validates link availability or bandwidth usage.</t>

    <t>This leads to the requirement of a unified access method to the information provided by a Looking Glass. This document is a proposal of an application programmers interface (API), which provides a common schema, list of arguments, and options when accessing a Looking Glass service.</t>
    <t>The transport protocol of choice is encrypted HTTP, the style of operation is REST, and the response format is JSON <xref target="RFC7159"></xref>.</t>

    <t>The Looking Glass API is described as a language-independent concept. Consequently, any programming language, which satisfies API commands listed in the following chapters, is acceptable.</t>

    <section title="Background">
      <t>The requirement of a uniform access to a Looking Glass service becomes important when multiple Looking Glasses are part of a monitoring system. Implementing a web client and HTTP-parser for every kind of web-based Looking Glass is a time consuming workaround, however, the Looking Glass API is a much more viable, compatible, and scalable solution.</t>
    </section>

    <section title="Terminology">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</t>
    </section>

    <section title="Syntax Notation">
      <t>This specification uses the JavaScript Object Notation (JSON) of <xref target="RFC7159"></xref> arranged as JSend <xref target="JSend"></xref> compliant response.</t>
    </section>

    <section title="Examples">
      <t>All URLs in this documentation use the reserved sample domain of "example.net" as defined in <xref target="RFC6761"></xref> section 6.5.</t>
      <t>IPv4 addresses use the documenational block of 192.0.2.0/24 <xref target="RFC5737"></xref> and IPv6 addresses reside in the reserved prefix of 2001:DB8::/32 <xref target="RFC3849"></xref>. BGP Autonomous System numbers are chosen from the private AS range defined in <xref target="RFC6996"></xref>.</t>
      <t>The printed examples skip some required parameters for reasons of simplicity.</t>
    </section>
  </section>

  <section title="Operation">
    <t>An API client issues a query using the HTTP GET method to request a specific resources from the API server. The resource is a URI and can be informational or a command execution. The client must present all necessary parameters for the API server to execute the command on the selected router. Every API call is stateless and independent of the previous one.</t>

    <t>The "API call" is a request from the client, which specifies a pre-defined operation ("API function") that the server will execute on a selected router. The "command" is a task executed on the router and initiated by the server on behalf of the client. The type and scope of all commands is defined and limited by the server. The client MUST NOT be able to execute random commands on the targeting router. There MUST NOT be any direct communication between the client and the router.</t>

    <t>After the execution of the command on the selected router has finished, the server replies to the client if the operation has either succeeded, failed or timed out. The response is sent to the API client in JSON format. The communication protocol used between the server and router is not specified by this document; any method (e.g. Telnet, SSH, NETCONF, YANG, serial console) is acceptable.</t>

    <t>All parameters and its values are case insensitive.</t>


    <section title="Method Parameters">
      <t>Method parameters are mandatory components of the URI and placed in the "path" section in terms of <xref target="RFC7320"></xref>. Basically, the method parameters specify the API call and determine which command the client wants executed on the selected router.</t> 
    </section>

    <section title="Query Parameters">
      <t>Query parameters are optional components of the URI and placed in the "query" section in terms of <xref target="RFC7320"></xref>. Generally, the query parameters are additional instructions for the requested command.</t>

      <t><list style="hanging" hangIndent="3">
        <t hangText="protocol">
          <vspace/>Restrict the command and method parameters to use the specified protocol and version. Protocol is selected as "Address Family Identifier" <xref target="IANA-AFN"></xref> <xref target="RFC2858"></xref> and optional "Subsequent Address Family Identifier" <xref target="IANA-SAFI"></xref> separated by comma.

<!-- http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml -->
<!-- http://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml -->

          <vspace/>Default value is 1,1  (IP version 4, unicast).
          <vspace/>JSON data type is String.
          <vspace/>Examples:
          <list style='symbols'>
            <t>protocol=2,1  (IP version 6, unicast)</t>
            <t>protocol=26   (MPLS, no SAFI used)</t>
          </list>
        </t>

        <t hangText="router">
          <vspace/>Run the command on the router identified by its name. This is not necessarily the routers hostname as long as the Looking Glass software recognizes it.
          <vspace/>Default value is the first router in the list of available routers.
          <vspace/>JSON data type is String.
          <vspace/>Example: router=rbgn06.example.net
        </t>

        <t hangText="routerid">
          <vspace/>Run the command on this router identified by its position in the list of available routers.
          <vspace/>Default value is "0".
          <vspace/>JSON data type is Number.
          <vspace/>Example: routerid=8
        </t>

        <t hangText="random">
          <vspace/>Append a random string to prevent the client (or an intermediate proxy) from caching the response. The API server must ignore its value.
          <vspace/>No default value.
          <vspace/>JSON data type is String.
          <vspace/>Example: random=517A93B50
        </t>

        <t hangText="runtime">
          <vspace/>Stop executing the command after the runtime limit (in seconds) is exceeded. A value of 0 disables the limit.
          <vspace/>Default value is "30".
          <vspace/>JSON data type is Number.
          <vspace/>Example: runtime=60
        </t>

        <t hangText="format">
          <vspace/>Request the server to provide the output (if any) in the selected format. Specify multiple formats separated by comma in descending order of preference. See <xref target="router-details"></xref> for more details.
          <vspace/>Default value is "text/plain" (raw/unformatted output).
          <vspace/>JSON data type is String.
          <vspace/>Example: format=application/yang,text/plain
        </t>
      </list></t>
    </section>

    <section title="Response">
      <t>The HTTP response header SHOULD set an appropriate HTTP status code as defined in <xref target="RFC7231"></xref> and MUST set the Content-Type to "application/json".</t>

      <t>The HTTP body contains details and error descriptions. The response text MUST comply with the JSON syntax specification JSend <xref target="JSend"></xref>, which is briefly explained in appendix JSend. Consequently every response MUST contain a "status" field of either "success", "fail", or "error", that are explained in the following sections.</t>

      <section title="Success" anchor="response_success">
        <t>A successful response MUST set the "status" field to "success". It MUST also contain a "data" object including the following information:</t>
        <t><list style="hanging" hangIndent="3">
          <t hangText="performed_at">
            <vspace blankLines="0" />
            combined date and time in UTC <xref target="iso8601">ISO 8601</xref> indicating when the operation finished. This information MUST be present.</t>
          <t hangText="runtime">
            <vspace blankLines="0" />
            amount of seconds (wallclock) used to run the command. This information MUST be present.</t>
          <t hangText="router">
            <vspace blankLines="0" />
            the name of the router, that executed the command. This information MAY be present.</t>
          <t hangText="output">
            <vspace blankLines="0" />
            output of the command in a format that was requested by the client or defaults to raw output as it appeared on the routers command line interface (CLI). It might even be blank if the command did not produce any output. This information SHOULD be present.</t>
          <t hangText="format">
            <vspace blankLines="0" />
            selected output format by the server. The client might request multiple formats, so that the "Looking Glass" server has to choose the best option and tell the client which format was selected. This information SHOULD be present (or defaults to "text/plain" if missing).
          </t>
       </list></t>

       <t>Adding more information to the response is permitted and MUST be placed inside the "data" object.</t>
       <t>The HTTP status code SHOULD be 200.</t>

       <t>
         <figure>
           <preamble>Example:</preamble>
           <artwork align="left"><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/json
{
  "status" : "success",
  "data" : {
    "router" : "route-server.lookingglass.example.net"
    "performed_at" : "2014-10-15T17:15:34Z",
    "runtime" : 2.63,
    "output" : [
      "full raw output from the observing router..."
    ],
    "format" : "text/plain"
  }
}]]></artwork>
          </figure>
        </t>
      </section>

      <section title="Fail">
        <t>A status of "fail" indicates that the selected command was executed on the router but failed to succeed. The response message MUST set the "status" field to "fail" and MUST contain the "data" object with command-specific content, that is listed in <xref target="response_success"/>.</t>

        <t>The HTTP status code SHOULD be 200.</t>
        <t>
          <figure>
           <preamble>Example:</preamble>
           <artwork align="left"><![CDATA[
HTTP/2.0 200 OK
{
  "status" : "fail",
  "data" : {
    "performed_at" : "2014-10-18T20:04:37Z",
    "runtime" : 10.37,
    "output" : [
      "Sending 5, 100-byte ICMP Echos to 192.0.2.5",
      ".....",
      "Success rate is 0 percent (0/5)"
    ],
    "format" : "text/plain",
    "router" : "route-server.lookingglass.example.net"
  }
}
]]></artwork>
          </figure>
        </t>
      </section>

      <section title="Error">
        <t>The status "error" represents an error which occurred in processing the request or the command timed out. The response message MUST set the "status" field to "error" and MUST contain the "message" key, that keeps a meaningful message, explaining what went wrong.</t>
        <t>The response MAY contain the "data" key, with required values listed in <xref target="response_success"/>. It MAY also include a "code" field, that carries a numeric code corresponding to the error.</t>

        <t>The HTTP status code SHOULD be 400 in case of a client-side error, 500 in case of a server-side error or 502 for errors occurring on the target router. Code 504 SHOULD be used when a command timed out.</t>

        <t>
          <figure>
           <preamble>Example:</preamble>
           <artwork align="left"><![CDATA[
HTTP/1.1 400 Bad Request
{
  "status" : "error",
  "message" : "Unrecognized host or address."
}
]]></artwork>
          </figure>
        </t>
      </section>
    </section>
  </section>


  <section title="API functions">
    <t>The Looking Glass API provides functions that are either mandatory or optional to implement. The same principle applies to the web-based Looking Glass.</t>
    <t>It is not possible for any API function to modify the server's state. Therefore, all HTTP methods are GET operations.</t>
    <t>Variables are templated and expanded in harmony of <xref target="RFC6570"></xref>.</t>

    <section title="Diagnostic commands">
      <section title="Ping">
        <t>Send echo messages to validate the reachability of a remote host and measure round-trip time. The "ping" command MAY use the ICMP protocol, but any protocol that satisfies the requirement is acceptable.</t>
        <t>Implementation of the ping command is mandatory.</t>
        <t>Syntax: https://lg.example.net/api/v1/ping/{addr}</t>
        <t>
          <figure>
           <preamble>Example:</preamble>
           <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/ping/2001:DB8::35?protocol=2,1
]]></artwork>
          </figure>
        </t>
      </section>

      <section title="Traceroute">
        <t>Trace path from the executing router to the destination host and list all intermediate hops.</t>
        <t>Implementation of the traceroute command is optional.</t>
        <t>Syntax: https://lg.example.net/api/v1/traceroute/{addr}</t>
        <t>
          <figure>
            <preamble>Example:</preamble>
            <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/traceroute/192.0.2.1?routerid=5
]]></artwork>
          </figure>
        </t>
      </section>
    </section>

    <section title="Informational commands">
      <section title="show route">
        <t>Retrieve information about a specific subnet from the routing table.</t>
        <t>Implementation of the "show route" command is mandatory.</t>
        <t>Syntax: https://lg.example.net/api/v1/show/route/{addr}</t>
        <t>
          <figure>
            <preamble>Example:</preamble>
            <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/show/route/2001:DB8::/48?protocol=2,1
]]></artwork>
          </figure>
        </t>
      </section>

      <section title="show bgp">
        <!-- Cisco IOS: show bgp ipv4|6 unicast {addr} -->
        <t>Display matching record from BGP routing table. This SHOULD include networks, next hop and MAY include metric, local preference, path list, weight, etc.</t>
        <t>Implementation of the "show bgp" command is optional.</t>
        <t>Syntax: https://lg.example.net/api/v1/show/bgp/{addr}</t>
        <t>
          <figure>
            <preamble>Example:</preamble>
            <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/show/bgp/192.0.2.0/24
]]></artwork>
          </figure>
        </t>
      </section>

      <section title="show bgp summary">
        <!-- Cisco IOS: show bgp ipv4|6 unicast summary -->
        <t>Print a summary of BGP neighbor status. This MAY include neighbor BGP ID, autonomous system number, duration of peering, number of received prefixes, etc.</t>
        <t>Implementation of the "show bgp summary" command is optional.</t>
        <t>Syntax: https://lg.example.net/api/v1/show/bgp/summary</t>
        <t>
          <figure>
            <preamble>Example:</preamble>
            <artwork align="left"><![CDATA[
https://example.net/api/v1/show/bgp/summary?protocol=2&routerid=3
]]></artwork>
          </figure>
        </t>
      </section>

      <section title="show bgp neighbors">
        <!-- Cisco IOS: show bgp ipv4|6 unicast neighbors {addr} advertised-routes|routes -->
        <t>Provide detailed information on BGP neighbor connections. Available details MAY include neighbor BGP ID, advertised networks, learned networks, autonomous system number, capabilities, protocol, statistics, etc.</t>
        <t>Implementation of the "show bgp neighbors" command is optional.</t>
        <t>Syntax: https://lg.example.net/api/v1/show/bgp/neighbors/{addr}</t>
        <t>
          <figure>
            <preamble>Example:</preamble>
            <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/show/bgp/neighbors/192.0.2.226
]]></artwork>
          </figure>
        </t>
      </section>
    </section>

    <section title="Administrative commands">
      <t>The following administrative commands MUST be included in the implementation.</t>

      <section title="router list">
        <t>The command provides a full list of routers that are available for command execution. This list includes the router ID and its name. It is equivalent to the common "router" HTML drop-down form element and contains the same information.</t>
        <t>Syntax: https://lg.example.net/api/v1/routers</t>
        <t>
          <figure>
            <preamble>Example response:</preamble>
            <artwork align="left">
{
  "status" : "success",
  "data" : {
    "routers" : [
      "route-server.lookingglass.example.net",
      "customer-edge.lookingglass.example.net",
      "provider-edge.lookingglass.example.net"
    ],
    "performed_at" : "2014-10-19T20:07:01Z",
    "runtime" : 0.73
  }
}
</artwork>
          </figure>
        </t>
      </section>

      <section anchor="router-details" title="router details">
        <t>List additional information about the selected router, specified by its router ID. The response MUST contain the routers hostname and router ID. The response MAY contain more details like output format, country code, city, administrative contact, vendor and model.</t>
        <t>Available output formats are specified by Internet media type as of <xref target="RFC6838"></xref> and listed in <xref target="IANA-MT"></xref>. If the routers supports multiple formats, they are separated by comma.</t>
        <t>The router might provide output formats, that are not yet registered or listed in <xref target="IANA-MT"></xref>. <xref target="RFC6838">RFC6838</xref> provides a tree for unregistered subtypes. For example, output in NETCONF format could use "text/x.netconf".</t>
        <t>Missing output format defaults to "text/plain", which is a copy of the raw command-line output.</t>
        <t>Syntax: https://lg.example.net/api/v1/routers/{number}</t>
        <t>
          <figure>
            <preamble>Example query:</preamble>
            <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/routers/1
]]></artwork>
          </figure>
        </t>
        <t>
          <figure>
            <preamble>Example response:</preamble>
            <artwork align="left"><![CDATA[
{
  "status" : "success",
  "data" : {
    "id" : 1,
    "name" : "customer-edge.lookingglass.example.net",
    "format" : "text/plain,text/x.netconf",
    "country" : "de",
    "autonomous_system" : 64512
  }
}
]]></artwork>
          </figure>
        </t>
      </section>

      <section title="commands">
        <t>This function provides a full list of commands that are available for execution. The list includes mandatory, optional, and additional (<xref target="commands_extensible"/>) commands. It is equivalent to the "command" HTML drop-down or radio-button form element and contains the same information.</t>
        <t>The list is formatted as "commands" array containing one object per command. This object contains informative strings about the current command: href, arguments, description and command.</t>
        <t>Syntax: https://lg.example.net/api/v1/commands</t>
        <t>
          <figure>
            <preamble>Example response:</preamble>
            <artwork align="left"><![CDATA[
{
  "status" : "success",
  "data" : {
    "commands" : [
      {
        "href" : "https://lg.example.net/api/v1/show/route",
        "arguments" : "{addr}",
        "description" : "Print records from IP routing table",
        "command" : "show route"
      },
      {
        "href" : "https://lg.example.net/api/v1/traceroute",
        "arguments" : "{addr}",
        "description" : "Trace route to destination host",
        "command" : "traceroute"
      }
    ]
  }
}
]]></artwork>
          </figure>
        </t>
      </section>
    </section>

    <section title="Extensible commands" anchor="commands_extensible">
      <t>The list of commands MAY be expanded as long as the principles of this document are observed.</t>
      <t>For example, a Looking Glass provider may not be offering BGP-related commands because of an OSPF-based network.</t>
      <t>
        <figure>
        <preamble>The sample command might be:</preamble>
          <artwork align="left"><![CDATA[
https://lg.example.net/api/v1/show/ospf/database
]]></artwork>
        </figure>
      </t>
    </section>
  </section>



  <section title="Miscellaneous">
    <t>The network traffic sent by a "Looking Glass" is not appropriate when measuring Service Level Agreements or validating Quality of Service setting.</t>
    <t>If a monitoring system uses the Looking Glass API for reachability checks, it SHOULD NOT rely on the HTTP status codes but on the "status" message field inside the HTTP body.</t>
  </section>


  <section anchor="IANA" title="IANA Considerations">
    <t>none</t>
  </section>

  <section title="Security Consideration">
    <t>The use of HTTPS is REQUIRED to ensure a high level of security, privacy, and confidentiality during transit.</t>

    <section title="Abuse Potential">
      <t>The main goal of the Looking Glass API is the automated usage of the Looking Glass service. This allows the scripting of API calls, which could be used as a distributed Denial of Service (DDoS) attack. Interestingly, the attacked system recognizes the attack originating from various ISPs core network.</t>
      <t>It is RECOMMENDED that implementers of the Looking Glass API take steps to mitigate the above described abuse. The strategy can include blocking or rate-limiting by client IP address or target IP network.</t>
    </section>

    <section title="Authentication">
      <t>Authentication is not a requirement because the current Looking Glass web services are usable without authentication. Requests to the proposed API service MAY be authenticated by any method. The decision is up to the implementers security requirements.</t>
    </section>

    <section title="Minimal information">
      <t>Some of the described commands provide a detailed insight into the providers network. It is therefore up to the implementer's security policy to dismiss commands that are marked as "optional" or restrict commands that are marked as "mandatory".</t>
    </section>
  </section>
</middle>



<back>
  <references title='Normative References'>
    <?rfc include="reference.RFC.2858"?>
    <?rfc include="reference.RFC.6570"?>
    <?rfc include="reference.RFC.7159"?>
    <?rfc include="reference.RFC.7231"?>

    <reference anchor="JSend" target="http://labs.omniti.com/labs/jsend">
      <front>
        <title>JSend</title>
        <author>
          <organization>OmniTI Labs</organization>
        </author>
        <date year="2013" />
      </front>
    </reference>

    <reference anchor="IANA-AFN" target="https://www.iana.org/assignments/address-family-numbers/">
      <front>
        <title>Address Family Numbers</title>
        <author>
          <organization>IANA</organization>
        </author>
        <date year="2015" />
      </front>
    </reference>

    <reference anchor="IANA-SAFI" target="http://www.iana.org/assignments/safi-namespace/">
      <front>
        <title>Subsequent Address Family Identifier (SAFI) Parameters</title>
        <author>
          <organization>IANA</organization>
        </author>
        <date year="2015" />
      </front>
    </reference>

    <reference anchor="IANA-MT" target="http://www.iana.org/assignments/media-types/media-types.xhtml">
      <front>
        <title>Media Types</title>
        <author>
          <organization>IANA</organization>
        </author>
        <date year="2015" />
      </front>
    </reference>
  </references>

  <references title='Informative References'>
    <?rfc include="reference.RFC.2119"?>
    <?rfc include="reference.RFC.3849"?>
    <?rfc include="reference.RFC.5737"?>
    <?rfc include="reference.RFC.6761"?>
    <?rfc include="reference.RFC.6838"?>
    <?rfc include="reference.RFC.6996"?>
    <?rfc include="reference.RFC.7320"?>

    <reference anchor="iso8601" target="http://www.iso.org/iso/iso8601">
      <front>
        <title>Date and time format--ISO 8601</title>
        <author>
          <organization>International Organization for Standardization</organization>
        </author>
        <date year="2006" />
      </front>
    </reference>
  </references>

  <section title="JSend">
    <t>According to <xref target="JSend"></xref>, "JSend is a specification that lays down some rules for how JSON responses from web servers should be formatted. JSend focuses on application-level (as opposed to protocol- or transport-level) messaging which makes it ideal for use in REST-style applications and APIs."</t>
    <t>A basic JSend-compliant response MUST contain a "status" key and SHOULD contain "data", "message" and "code" keys dependent on the status value. The following table lists the required and optional keys.</t>
    <texttable anchor="jsend_keys" title="Type and keys in JSend response">
      <ttcol align="left">Type</ttcol>
      <ttcol align="left">Required keys</ttcol>
      <ttcol align="left">Optional keys</ttcol>

      <c>success</c>
      <c>status, data</c>
      <c></c>

      <c>fail</c>
      <c>status, data</c>
      <c></c>

      <c>error</c>
      <c>status, message</c>
      <c>code, data</c>
    </texttable>
  </section>
</back>

</rfc>
