Post data format
When posting the answer to a question, it must be posted to the URL that was included with the question data. The format of the data in the POST request must be the same as that specified by the POST URL. For example, when the format=json query parameter is specified, the POST and response data must be in the JSON format.
XML
The XML posted for responses is the same format as the Player XML, except the SavePoint name is not present as it is implied by the URL to which the POST is submitted. When the Navigation element is omitted, a default of Next is assumed.
This is an example of the post data format XML:
<Page>
<Question QuestionName="Name">
<Response>
<Value>John</Value>
</Response>
</Question>
<Navigation Type="Next" IsSelected="true"/>
</Page>
The Interview Web Service adds the URL’s Savepoint information to the XML before passing it to the session engine. The engine will be used, and the Session Token for the PostInterviewEvent() call, are retrieved from the URL.
JSON
The expected JSON format is the equivalent JSON XML representation. For example:
{
"Page": {
"Question": {
"QuestionName": "Name",
"Response": { "Value": "John" }
},
"Navigation": {
"Type": "Next",
"IsSelected": "true"
}
}
}
This JSON example will be converted to XML, and a SavePoint attribute will be added.
HTML
The expected HTML POST data looks like this:
_QName=John &_NNext=Next
Only the question response and the navigation need to be posted to the server as information on the engine, project, session token, and save point are encoded in the URL.
This HTML POST data will be converted to XML and the URL’s SavePoint attribute will be added.
See also