Summary


auth

input:

key = [auth_key]

output sample:

Object
{ "api_ssessid": "[session_id]" }

error {}:

Object
{ "error": "[error_message]" }

logout

input:

api.ssessid = [session_id]

output sample:

Object
{ "result": true }

error:

Object
{ "result": false }

get_lang_data

input:

api.ssessid = [session_id] lang.uid = [lang_uid]

output sample:

Object
{ "uid": "1", "name": "English", "code": "en", // used in URL "rtl": "0" // right-to-left }

error:

Object
{ "error": "[error_message]" }

get_forms_list

input:

api.ssessid = [session_id]

output sample:

Array
[ Object
{ "uid": "69385", "default_lid": "9", "create_date": "2014-05-10", // date in format: yyyy-mm-dd "create_time": "16:30:49", // time in format: HH:mm:ss "create_time_dst": "1", // Daylight Saving Time "update_date": "2014-05-10", "update_time": "17:16:21", "update_time_dst": "1", "status": "1", "name": "lang bug fix", "_answer_periods": Array
[ Object
{ "period_uid": "68554", "begin_answer": "0", "end_answer": "0", "limit_answers": "0", "status": "0" }
]
},
Object
{ "uid": "69384", "default_lid": "9", "create_date": "2014-03-15", // date in format: yyyy-mm-dd "create_time": "17:08:19", // time in format: HH:mm:ss "create_time_dst": "0", // Daylight Saving Time "update_date": "2014-09-27", "update_time": "18:21:57", "update_time_dst": "1", "status": "1", "name": "answer_limits", "_answer_periods": Array
[ Object
{ "period_uid": "68553", "begin_answer": "0", "end_answer": "0", "limit_answers": "0", "status": "0" }
]
}
]

error:

Object
{ "error": "[error_message]" }

get_form_info

input:

api.ssessid = [session_id] form.uid = [form_uid]

output sample:

Object
{ "uid": "2600", "default_lid": "9", "create_date": "2010-05-08", // date in format: yyyy-mm-dd "create_time": "19:30:58", // time in format: HH:mm:ss "create_time_dst": "1", // Daylight Saving Time "update_date": "2014-08-09", "update_time": "18:22:22", "update_time_dst": "1", "status": "1", "name": "all components", "_active_answer_period": Object // period of collecting answers
{ "period_uid": "1773", "start_date": "2010-05-08", "start_time": "16:32:07", "end_date": "2023-10-26", "end_time": "16:53:29", "begin_answer": "22", "end_answer": "20" }
}

error:

Object
{ "error": "[error_message]" }

get_form_links

input:

api.ssessid = [session_id] form.uid = [form_uid]

output sample:

Array
[ Object
{ "lang_code": "", // code of language (if empty string => language selector page for multilingual form) "active": true, // translation was finished "title": "Sample form title", // title of form "url": "http://webanketa.com/forms/zzt3cd1j5xk64rhn6gv38zz/", // address of form "embed_html": "<script type="text/javascript">var WebAnketaParams = ["zzt3cd1j5xk64rhn6gv38zz", "Sample form title"]; document.write(unescape("<"+"script src='http"+(/^https:\/\//.test(document.URL) ? "s" : "")+"://webanketa.com/direct/js/embed.js' type='text/javascript'><"+"/script>")); </script><noscript><a href="http://webanketa.com/forms/zzt3cd1j5xk64rhn6gv38zz/" target="_blank">Sample form title</a></noscript>" // HTML for embed form },
Object
{ "lang_code": "ru", "active": true, "title": "Sample form title", "url": "http://webanketa.com/forms/zzt3cd1j5xk64rhn6gv38zz/ru/", "embed_html": "<script type="text/javascript">var WebAnketaParams = ["zzt3cd1j5xk64rhn6gv38zz/ru", "Sample form title"]; document.write(unescape("<"+"script src='http"+(/^https:\/\//.test(document.URL) ? "s" : "")+"://webanketa.com/direct/js/embed.js' type='text/javascript'><"+"/script>")); </script><noscript><a href="http://webanketa.com/forms/zzt3cd1j5xk64rhn6gv38zz/ru/" target="_blank">Sample form title</a></noscript>" }
]

error:

Object
{ "error": "[error_message]" }

get_form_structure

input:

api.ssessid = [session_id] form.uid = [form_uid]

output sample:

Object
{ "uid": "69385", "default_lid": "9", "create_date": "2014-05-10", // date in format: yyyy-mm-dd "create_time": "16:30:49", // time in format: HH:mm:ss "create_time_dst": "1", // Daylight Saving Time "update_date": "2014-05-10", "update_time": "17:16:21", "update_time_dst": "1", "status": "1", "name": "lang bug fix", "_settings": Object {...}
{ "form_type": "0", "timer_start_page": "0", "countdown": "0", "side_skin": "0", "resp_uniq_type": "1", "public_stat": "0", "public_pass": "" },
"_answer_periods": Array
[ Object {...}
{ "period_uid": "68554", "begin_answer": "0", "end_answer": "0", "limit_answers": "0", "status": "0" }
],
"_active_answer_period": 0, "_languages": Array
[ Object {...}
{ "uid": "9", "name": "Русский", "code": "ru", "translate_finished": "1", // translate finished status "default": 1 // language is default or not },
Object {...}
{ "uid": "1", "name": "English", "code": "en", "translate_finished": "1", // translate finished status "default": 0 // language is default or not },
Object {...}
{ "uid": "48", "name": "Latviešu", "code": "lv", "translate_finished": "1", // translate finished status "default": 0 // language is default or not }
],
"_components": Array
[ Object {...}
{ "uid": "513207", "component_type_name": "pageheader", "status": "1", "public_statistic": "1", // publicated statistic "_properties": Object
{ },
"_elements": Object {...}
{ "title": Object {...}
{ "uid": "3925205", "name": "title", "value": "lang bug fix", "_properties": Object
{ },
"_controls": Object
{ },
"_childs": Object
{ }
}
}
},
Object {...}
{ "uid": "513208", "component_type_name": "string", "status": "1", "public_statistic": "1", // publicated statistic "_properties": Object
{ },
"_elements": Object {...}
{ "question": Object {...}
{ "uid": "3925206", "name": "question", "value": "строковое поле", "_properties": Object {...}
{ "Require": Object {...}
{ "uid": "1228726", "name": "Require", "value": "", "checked": "1" }
},
"_controls": Array
[ Object {...}
{ "uid": "2364126", "field_name": "ctrl[513208][3925206][2364126]", "control_type": "string", "default_value": null }
],
"_childs": Object
{ }
},
"description": Object {...}
{ "uid": "3925207", "name": "description", "value": "", "_properties": Object
{ },
"_controls": Object
{ },
"_childs": Object
{ }
}
}
}
]
}

error:

Object
{ "error": "[error_message]" }

get_form_answers_list

input:

api.ssessid = [session_id] form.uid = [form_uid] start_answer_uid = [answer_uid][-] // not required

output sample:

Array
[ Object
{ "uid": "31939", "answer_nr": "1", "ip2long": "1310507274", "duration": "0", "create_date": "2010-05-08", "create_time": "16:33:36", "create_time_dst": "1", "read": "1", // read the owner form "lang_name": "Русский", "form_args": "" },
Object
{ "uid": "152441", "answer_nr": "2", "ip2long": "2130706433", "duration": "0", "create_date": "2012-04-14", "create_time": "18:45:16", "create_time_dst": "1", "read": "1", // read the owner form "lang_name": "Русский", "form_args": "" }
]

error:

Object
{ "error": "[error_message]" }

get_form_answer_data

input:

api.ssessid = [session_id] form.uid = [form_uid] answer.uid = [answer_uid]

output sample:

Object
{ "uid": "31939", "respondent_uid": "31945", "respondent_lid": "9", "answer_period_uid": "1773", "answer_nr": "1", "finished_answer": "1", "duration": "0", "ip2long": "1310507274", "country": "LV", "read": "1", "create_date": "2010-05-08", "create_time": "16:33:36", "create_time_dst": "1", "update_date": "2010-05-08", "update_time": "16:33:36", "update_time_dst": "1", "form_args": "", "http_referer": "", "http_user_agent": "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.5.24 Version/10.54", "_question_answers": Array
[ Object {...}
{ "question": "строковое поле", "controls": Array
[ Object {...}
{ "name": "", "component_uid": "11427", "question_uid": "63164", "control_uid": "38177", "value": "asd" }
],
"subquestions": Object
{ }
},
Object {...}
{ "question": "один из множества", "controls": Array
[ Object {...}
{ "name": "", "component_uid": "11429", "question_uid": "63168", "control_uid": "38180", "value": "Ответ 2" }
],
"subquestions": Object
{ }
},
Object {...}
{ "question": "таблица", "controls": Object
{ },
"subquestions": Array
[ Object {...}
{ "sub_question": "Вопрос 1 - 123 <> 321", "sub_controls": Array
[ Object {...}
{ "name": "", "component_uid": "11433", "question_uid": "63193", "control_uid": "38192", "value": "Ответ 2" }
]
},
Object {...}
{ "sub_question": "Вопрос 2", "sub_controls": Array
[ Object {...}
{ "name": "", "component_uid": "11433", "question_uid": "63199", "control_uid": "38194", "value": "Ответ 1" }
]
},
Object {...}
{ "sub_question": "Вопрос 3", "sub_controls": Array
[ Object {...}
{ "name": "", "component_uid": "11433", "question_uid": "63205", "control_uid": "38199", "value": "Ответ 3" }
]
}
]
},
Object {...}
{ "question": "подзаголовок, текст", "controls": Object
{ },
"subquestions": Object
{ }
},
Object {...}
{ "question": "адрес", "controls": Array
[ Object {...}
{ "name": "Страна", "component_uid": "11442", "question_uid": "63255", "control_uid": "38219", "value": "Latvia" },
Object {...}
{ "name": "Регион", "component_uid": "11442", "question_uid": "63255", "control_uid": "38220", "value": "Riga" },
Object {...}
{ "name": "Город", "component_uid": "11442", "question_uid": "63255", "control_uid": "38221", "value": "Riga" }
],
"subquestions": Object
{ }
}
]
}

error:

Object
{ "error": "[error_message]" }

post_form_answer

input:

api.ssessid = [session_id] form.uid = [form_uid] http_referer = [http_referer] // not required form.lang = [form_lang] // not required form.page = [form_page_nr] // not required form.args = [form_args] // not required respondent.ip = [ip address] // not required respondent.cuid = [32bit uniq number per respondent] // not required respondent.sessid = [respondent sessid] // not required answer.uid = [answer_uid] // not required ctrl[id1][id2][id3] = [value] ctrl[id4][id5][id6] = [value] ctrl[id7][id7][id8] = [value]

output sample:

Object
{ "answer_uid": 12345, "finished": 1, "respondent_cuid": "[respondent cookie id]", "respondent_sessid": "[respondent sess id]", "form_errors": Object {...}
{ "_components": Object {...}
{ "1234567": Object {...} // component_uid
{ "_errors": Object {...}
{ "Require": Object {...} // setting name
{ "uid": 123, "name": "Require", "value": "", "checked": 1, "message_user": "custom message of user for this setting", "message_system": "default message for this setting", "message": "prepared message, based on user or system" }
}
}
}
}
}

error:

Object
{ "error_code": "[error code]", "error_msg": "[error message]" }

get_form_statistic

input:

api.ssessid = [session_id] form.uid = [form_uid] ctrl.id = [control_uid] // only, if need list of one control answers pg = [page_number] // page number for list of one control answers

output sample:

Array
[ Object {...}
{ "component_uid": "11427", "component_type": "string", "question": "строковое поле", "partial_output": 1, "control_uid": "38177", "respondents_total": "22", "non_respondents_total": 0, "answers": Array
[ Object {...}
{ "sub_question": null, "answer": "123", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "999999", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "123", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "12", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "12", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "123", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "1111", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "123", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "123", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "21", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 }
]
},
Object {...}
{ "component_uid": "341281", "component_type": "radiobuttons", "question": "один из множества", "partial_output": null, "control_uid": null, "respondents_total": 18, "non_respondents_total": 4, "answers": Array
[ Object {...}
{ "sub_question": null, "answer": "Ответ 1", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": "5", "answer_percent": 27.78 },
Object {...}
{ "sub_question": null, "answer": "Ответ 2", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": "5", "answer_percent": 27.78 },
Object {...}
{ "sub_question": null, "answer": "", "answer_other": Array
[ Object {...}
{ "answer_other": "123" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "4564" },
Object {...}
{ "answer_other": "123" },
Object {...}
{ "answer_other": "122" },
Object {...}
{ "answer_other": "333333" },
Object {...}
{ "answer_other": "один из множества<hr></script>%f"a's\" }
],
"partial_answer_other": 0, "answer_count": "8", "answer_percent": 44.44 }
]
},
Object {...}
{ "component_uid": "11433", "component_type": "table", "question": "таблица", "partial_output": null, "control_uid": null, "respondents_total": "20", "non_respondents_total": 2, "answers": Array
[ Object {...}
{ "sub_question": "Вопрос 1 - 123 <> 321", "answer": "", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 0, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "Ответ 1", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": "15", "answer_percent": 75 },
Object {...}
{ "sub_question": null, "answer": "Ответ 2", "answer_other": Array
[ Object {...}
{ "answer_other": "21" },
Object {...}
{ "answer_other": "1111" },
Object {...}
{ "answer_other": "ddddd" }
],
"partial_answer_other": 0, "answer_count": "4", "answer_percent": 20 },
Object {...}
{ "sub_question": null, "answer": "Ответ 3", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": "1", "answer_percent": 5 },
Object {...}
{ "sub_question": "Вопрос 2", "answer": "", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 0, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "Ответ 1", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": "13", "answer_percent": 65 },
Object {...}
{ "sub_question": null, "answer": "Ответ 2", "answer_other": Array
[ Object {...}
{ "answer_other": "11" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "0" },
Object {...}
{ "answer_other": "21" },
Object {...}
{ "answer_other": "Ответ 2" }
],
"partial_answer_other": 0, "answer_count": "7", "answer_percent": 35 },
Object {...}
{ "sub_question": null, "answer": "Ответ 3", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 0, "answer_percent": 0 },
Object {...}
{ "sub_question": "Вопрос 3", "answer": "", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 0, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": "Ответ 1", "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": "10", "answer_percent": 50 },
Object {...}
{ "sub_question": null, "answer": "Ответ 2", "answer_other": Array
[ Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "ddddd" }
],
"partial_answer_other": 0, "answer_count": "2", "answer_percent": 10 },
Object {...}
{ "sub_question": null, "answer": "Ответ 3", "answer_other": Array
[ Object {...}
{ "answer_other": "222" },
Object {...}
{ "answer_other": "21" },
Object {...}
{ "answer_other": "0" },
Object {...}
{ "answer_other": "22222" },
Object {...}
{ "answer_other": "2121" },
Object {...}
{ "answer_other": "Ответ 3" }
],
"partial_answer_other": 0, "answer_count": "8", "answer_percent": 40 }
]
},
Object {...}
{ "component_uid": "11435", "component_type": "subtitle", "question": "подзаголовок, текст", "partial_output": null, "control_uid": null, "respondents_total": null, "non_respondents_total": null, "answers": Object
{ }
},
Object {...}
{ "component_uid": "341283", "component_type": "number", "question": "целое число", "partial_output": 1, "control_uid": "1626103", "respondents_total": "16", "non_respondents_total": 6, "answers": Array
[ Object {...}
{ "sub_question": null, "answer": 8, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 2, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 2, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": -12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 },
Object {...}
{ "sub_question": null, "answer": 12, "answer_other": Object
{ },
"partial_answer_other": 0, "answer_count": 1, "answer_percent": 0 }
]
}
]
or
Object
{ "component_uid": "341283", "question": "целое число", "control_uid": 1626103, "respondents_total": "22", "offset": 0, "answers": Array
[ Object {...}
{ "answer_other": "8" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "2" },
Object {...}
{ "answer_other": "2" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "-12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "123" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "12" },
Object {...}
{ "answer_other": "123.99" }
]
}

error:

Object
{ "error": "[error_message]" }

delete_form_answers

input:

api.ssessid = [session_id] form.uid = [form_uid] answer.uid = 1772766 // or uid of answer answer.uids = 1772766,1772767 // or list of uids, separated by comma

output sample:

Object
{ "result": "ok" }

error:

Object
{ "error": "[message]" }

edit_form_structure

input:

api.ssessid = [session_id] form.uid = [form_uid] component[197637][disabled] = 1 // disable component

output sample:

Object
{ "result": "ok" }

error:

Object
{ "error": "[message]" }

start_form_publication

input:

api.ssessid = [session_id] form.uid = [form_uid]

output sample:

Object
{ "result": "ok" }

error:

Object
{ "error": "[message]" }

stop_form_publication

input:

api.ssessid = [session_id] form.uid = [form_uid]

output sample:

Object
{ "result": "ok" }

error:

Object
{ "error": "[message]" }