/api/interviews/ENGINE/PROJECT/functions/FUNCNAME
This URL is used to invoke a function in the interview routing script and retrieve the result. The arguments for the function calls must be POSTed to the URL:
{
"Arguments": {
"Argument": [
{
"Name": "QuestionFullName",
"Value": "PhoneNumber"
},
{
"Name": "Response",
"Value": "555-443-2234"
}
]
}
}
The arguments can also be posted as XML by specifying format=xml as a query parameter. Only simple data types, and arrays of simple data types, are permitted as arguments. The following example shows an array that contains three strings:
{
"Arguments": {
"Argument": {
"Name": "ChildNames",
"Value": [
"John",
"Mary",
"Joseph"
]
}
}
}
The functions are presented as calls in the interview's routing script and the results are returned in the same format as the request (XML or JSON). Function outputs for simple data types, IOM objects, or arrays of simple data types and IOM objects, are supported:
{
"Return": "True"
}
{
"Return": [
"12.4",
"56.3",
"2.7"
]
}
{
"Return": {
"Category": {
"Name": "Male",
"Style": {
"ElementAlign": "NewLine",
"Indent": "1",
"Control": { "Type": "RadioButton" }
},
"Label": {
"Style": { "ElementAlign": "Right" },
"Text": "Male"
}
}
}
}
IOM objects are supported as they can be easily converted to Player XML fragments (see
Player XML schema).
See also