REST services support a variety of response formats in order to offer users and developers maximum flexibility. Widely supported data interchange formats such as XML and JSON can be leveraged to create cross-platform and cross-application solutions to meet a variety of use cases.
Response formats for REST services endpoints are
specified with the
The currently-available response formats for all REST endpoints are string-based formats and include XML, JSON, PJSON, and HTML. Please refer to the individual documentation pages under Utility services and Analysis services for the response formats available for each service.
The HTML response format is the default value of the
so; if HTML output is desired, specification of this parameter is not
Additionally, the Callback parameter is useful for making cross-domain REST requests from a client application without requiring an HTTP proxy application, using the HTML IFRAME element, or similar workaround. A simple and working sample of these concepts is provided here.
Do not confuse REST services Summary Reports formats with the REST (service) response formats discussed on this page. Summary Reports formats refer to the actual report documents that are generated by the REST services and become available through URLs which are returned in the REST responses. See Get Report Templates for a list of Summary Reports options and their available report formats. Also, see an example of the TaskResultOutput type for an example of a Summary Reports output URL.
Additionally, do not confuse the TaskResultOutput type with the REST
(service) response formats discussed on this page. TaskResultOutput is a type of
data structure used in REST services to
encapsulate and describe the execution result of a REST request in a REST
response. A client application, which consumes this response, will parse the
data structure for the result. The data associated with TaskResultOutput can be
represented in any of the available REST services
response formats: XML, JSON, PJSON, and HTML.
In many cases, JSON structures are used for specifying REST services parameter values. Unlike the response format options discussed on this page, the parameter values cannot be represented in other formats such as XML.
The following is a list of REST services request examples with the different response format options:
Request Example (1)
Request Example (2)
Request Example (3)
Request Example (4)
Notes: For HTML output, specification of the response format
f) parameter value is not necessary since it is the default value.
The examples include request URIs without valid token parameter values. Include a valid token value to submit. See Get Token for more information on obtaining a token.