Additional Output Formats

Version 24.2.9039


Additional Output Formats


In addition to the default JSON format that all resources and actions support, the API also supports the following formats: XML, JSONP, RSS, HTML, CSV, and TSV.

XML

Request the XML (OData Atom) format by adding the $format=atom query parameter or by adding the HTTP Accept header with the value application/xml to the request. See the example request and response below.

Request

http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?$format=atom

Response

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:info="http://arc.cdata.com/ns?RsbOps/v2/" xmlns:d="http://docs.oasis-open.org/odata/ns/data">
  <title type="text">Cars</title>
  <id>http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars/</id>
  <updated>2015-04-23T18:36:20-04:00</updated>
  <entry>
  <title>1000</title><id>http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars('1000')</id>
  <category term="Arc.Cars" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
  <link rel="edit" title="Cars" href="Cars('1000')"/>
  <content type="application/xml">
    <m:properties>
      <d:Id m:type="String">1000</d:Id>
      <d:Model m:type="String">Accord</d:Model>
    </m:properties>
  </content>
  </entry>
</feed>

JSONP

Request the JSONP format by adding the $callback=myCallback query parameter, where myCallback is the name of the function you would like to wrap the JSON result. See the example request and response below.

Request

http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?$callback=myCallback

Response

myCallback(
  {
    "@odata.context": "http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/$metadata#Cars",
    "value": [
      {
        "Id": "1000", 
        "Model": "Accord"
      },
      ...
    ]
  }
);

RSS

Request the RSS format by adding the query parameter @rss to the request. See the example request and response below.

Request

http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?@rss

Response

<rss xmlns:arc="http://arc.cdata.com/ns?RsbOps/v2/" xmlns:ls="http://www.microsoft.com/schemas/rss/core/2005" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:x="http://arc.cdata.com/ns?RsbOps/v2/anonymous/" xmlns:odata="http://arc.cdata.com/ns?RsbOps/v2/anonymous/" xmlns:info="http://arc.cdata.com/ns?RsbOps/v2/anonymous/" xmlns:data="http://arc.cdata.com/ns?RsbOps/v2/anonymous/" version="2.0">
  <channel>
    <description>Retrieves and updates Cars information</description>
    <generator>Arc - http://arc.cdata.com</generator>
    <link>http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?@html</link>
    <title>Cars</title>
    <item xmlns:x="http://arc.cdata.com/ns?RsbOps/v2/anonymous/">
      <x:Id>1000</x:Id>
      <x:Model>Accord</x:Model>
    </item>
  </channel>
</rss>

HTML

Request the API response to be formatted as a simple, unstyled HTML table by adding the query parameter @html to the request. See the example request and response below.

Request

http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?@html

Response

<table>
  <tr><th>Id</th><th>Model</th></tr>
  <tr><td>1000</td><td>Accord</td></tr>

CSV

Request the API response to be formatted as CSV data by adding the query parameter @csv to the request. See the example request and response below.

Request

http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?@csv

Response

Id,Model
1000,Accord

TSV

Request the API response to be formatted as TSV data by adding the query parameter @tsv to the request. See the example request and response below.

Request

http://MyServer:MyPort/connector/MyAPIPortName/api.rsc/Cars?@tsv

Response

Id  Model
1000 Accord