Platform API‎ > ‎

Output Types

Each service is defined to have 1 or more named output types which can be selected by specifying the appropriate media type in the client's accept header. Additionally, services with more than one output type will also support a query parameter called output. The value of this parameter is the lowercase name of the desired output type (see table, below).

Clients that specify the output parameter will always receive that output type regardless of the Accept headers they send.

In the documentation for each service the list of output types is always given in preferred order.


Determining the Output Format

Services determines the output type to be used in a response in the following order:

  1. output parameter matches one of the service's output types
  2. output parameter is supplied but does not match one of the service's output types - a 400 Bad Request response is given
  3. Media type in the Accept header matches one of the service's output types, tested in preferred order
  4. */* in the Accept header - the first output type in the output type list is used
  5. No Accept header - the first output type in the output type list is used
  6. No other matches - a 406 Not Acceptable response is given


Standard Named Output Types

The following table summarizes the named output types supported in the Platform. Consult the API Documentation for the relevant services to check whether a specific output type is supported.

NameDescriptionResponse Content TypeAccept HeaderOutput Parameter
HTMLThe HTML response consists of an XHTML document and can be obtained either by specifying mime types of text/html or application/xhtml+xml in the request's accept header or by supplying an "output" query parameter with a value of "html". The response is sent with a content type header equal to the one matched in the accept header or text/html if the output parameter was specified.text/html orapplication/xhtml+xml(see description)text/html orapplication/xhtml+xmlhtml orxhtml
RDFThe response consists of an RDF/XML documentapplication/rdf+xmlapplication/rdf+xmlrdf
XMLThe response consists of an XML documentapplication/xmlapplication/xmlxml
RSSThe response consists of an RSS 1.0 documentapplication/rss+xmlapplication/rss+xmlrss1
JSONThe response consists of a JavaScript Object Notation (JSON) documentapplication/jsonapplication/jsonjson
JavaScriptJSONP response where JSON is wrapped in a user supplied callback function  application/javascriptapplication/javascript
 or */*
json (plus the user supplied callback value)
TurtleTerse Triple Languagetext/turtletext/turtleturtle
N-TriplesN-Triplestext/plaintext/plainntriples

Note: for backwards compatibility, where the text/turtle media type is listed, the deprecated application/x-turtle media type is also supported, though it is given a lower weighting during content negotiation