Create a DAT document from an answer file

With the DAT you can generate documents without the viewer. Simply POST to /api/assemble route with a Content-Type: application/json and a post body with the format:

{

    "fileDataUrl": "[path to template]",
    "guideId": "",
    "answers":  "[answersjson]"

}

[path to template] is the path to the template which is usually the path to the A2J Guided Interview (R)

[answersjson] is the answers in json format. This is generated by the viewer in the parameter AnswerKeyJSON

If the default template is present, a POST with sample post body

 

{
    "fileDataUrl": "../guides/default",
    "guideId": "",
    "answers":  "{\"user gender\":{\"name\":\"User Gender\",\"type\":\"MC\",\"repeating\":false,\"comment\":\"User's gender will be used to display appopriate avatar.\",\"values\":[null,\"Male\"]},\"user avatar\":{\"name\":\"User Avatar\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"client first name te\":{\"name\":\"Client first name TE\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null,\"g\"]},\"client middle name te\":{\"name\":\"Client middle name TE\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null,\"\"]},\"client last name te\":{\"name\":\"Client last name TE\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null,\"g\"]},\"a2j version\":{\"name\":\"A2J Version\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"A2J Author Version\",\"values\":[null]},\"a2j interview id\":{\"name\":\"A2J Interview ID\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"Guide ID\",\"values\":[null]},\"a2j bookmark\":{\"name\":\"A2J Bookmark\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"Current Page\",\"values\":[null]},\"a2j history\":{\"name\":\"A2J History\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"Progress History List (XML)\",\"values\":[null]},\"a2j navigation tf\":{\"name\":\"A2J Navigation TF\",\"type\":\"TF\",\"repeating\":false,\"comment\":\"Allow navigation?\",\"values\":[null]},\"a2j interview incomplete tf\":{\"name\":\"a2j interview incomplete tf\",\"type\":\"TF\",\"values\":[null,false]},\"a2j step 0\":{\"name\":\"A2J Step 0\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 1\":{\"name\":\"A2J Step 1\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 2\":{\"name\":\"A2J Step 2\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 3\":{\"name\":\"A2J Step 3\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 4\":{\"name\":\"A2J Step 4\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 5\":{\"name\":\"A2J Step 5\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 6\":{\"name\":\"A2J Step 6\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 7\":{\"name\":\"A2J Step 7\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 8\":{\"name\":\"A2J Step 8\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 9\":{\"name\":\"A2J Step 9\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 10\":{\"name\":\"A2J Step 10\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 11\":{\"name\":\"A2J Step 11\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"a2j step 12\":{\"name\":\"A2J Step 12\",\"type\":\"Text\",\"repeating\":false,\"comment\":\"\",\"values\":[null]},\"text pick te\":{\"values\":[null,\"Orange\"],\"type\":\"textpick\",\"name\":\"text pick te\"}}"
}

will produce example pdf