Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

API export_responses not working with parameter $sCompletionStatus

  • datamunger
  • datamunger's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 5 months ago #177342 by datamunger
I've been using the API to import responses into python with good success, but there seems to be a problem when using the parameter $sCompletionStatus.

This is my python code:
Code:
method = "export_responses"
params = OrderedDict([
            ("sSessionKey", api.session_key),
            ("iSurveyID", 977955),
            ("sDocumentType", 'json'),
            ("sCompletionStatus", 'complete'),
])
 
result64 = api.query(method=method, params=params)

it gives me this result:
Code:
{'status': 'Language code not found for this survey.'}

If I remove the sCompletionStatus parameter, everything works fine.

Any help would be appreciated.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 5 months ago #177351 by DenisChenu
Did you try :
Code:
params = OrderedDict([
            ("sSessionKey", api.session_key),
            ("iSurveyID", 977955),
            ("sDocumentType", 'json'),
            ("sLanguageCode", ''),
            ("sCompletionStatus", 'complete'),
])
Since we use ordered params

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • datamunger
  • datamunger's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177405 by datamunger
This was the answer, I had them in the wrong order! Thank you so much.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose