Get and Post response format
The
format parameter controld the returned response (see
Query parameters). The response data is closely based on the
Player XML schema. The JSON format is a simple data transformation based on the response data. HTML is a question fragment generated by the
HTML Player component.
XML
The XML that is returned by the Interview Web Service differs from Player XML in these ways:
▪The Page element has an additional URL attribute that encodes the engine, project, session token, and save point. This is in the format:
/SPSSMR/Interviewing/api/interview/ENGINE/PROJECT/question/SAVEPOINT
The host name, port, and protocol (HTTP/HTTPS) are not in the URL. The URL is an empty string on the end of interview page.
▪The Project, SessionToken, and SavePoint attributes were removed from the Page element due to the addition of the URL attribute. This includes the Project and SavePoint, and the moving of the SessionToken to a header value.
▪The Renderer attribute was removed from the Page element. The IOM.Info.Renderer property is normally used to control the page renderer for web pages. However, for the Interview Web Service, this is now controlled from the client side via the format query parameter. The Renderer attribute is therefore not applicable, and is not present in the Interview Web Service XML.
▪The Stye element’s Image attribute must be modified when the UseImageCache property is True. The Image attribute must be modified to include the ImageCacheURL, project name, and the original file name.
JSON
The JSON response is generated by a transformation of the returned XML. JSON functions as a mark-up that makes no distinction between elements and attributes. Because the Player XML does not assign attributes and elements the same name, the elements and attributes can simply be mapped into a single property namespace.
HTML
An HTML page is produced by passing the Player XML through the HTML Player renderer. The entire HTML page is sent to the client. The client can extract as much of the response as it needs (for example, the whole form element or just part of the question). The form’s action attribute determines the URL to which responses should be submitted.
For the /surveys/PROJECT URL, the action is always /surveys/PROJECT, which posts the results back to the same URL that generated the page.
For URLs that begin with api, the action is the same URL that was used in the XML and JSON. The end of interview page is the exception in that the action is the /api/surveys/PROJECT URL that was used to initially start the interview. The action does not normally have any effect because the form does not normally contain a submit input. The use of a form tag on the end of interview page is an HTML Player limitation.
See also