You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def list_surveys(api, username=None):
from collections import OrderedDict
method = "list_surveys"
params = OrderedDict([
("sSessionKey", api.session_key),
("sUsername", username or api.username)
])
response = api.query(method=method, params=params)
response_type = type(response)
if response_type is dict and "status" in response:
status = response["status"]
error_messages = [
"Invalid user",
"No surveys found",
"Invalid session key"
]
for message in error_messages:
if status == message:
raise LimeSurveyError(method, status)
else:
assert response_type is list
return response
api.survey.list_surveys = list_surveys
# from the example
result = api.survey.list_surveys(api)
method _Survey.list_surveys() uses key 'iSurveyID' to get survey list. According to REST-API, it shoud be 'sUsername'
Tested with:
limesurveyrc2ap master-commit: 866cf62
LimeSurvey Community Edition Version 6.4.7
The text was updated successfully, but these errors were encountered: