Welcome to the LimeSurvey Community Forum

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

Can't get import_question to work/Invalid LimeSurvey question structure XML

  • blacky
  • blacky's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #201083 by blacky
Hello,

I'm new to LimeSurvey and am trying to import a question using the API. I'm using nodeJS and whenever I try to import a question I get following error: Invalid LimeSurvey question structure XML

I searched the internet and found that some people had similar issues with importing whole surveys, but couldn't quite find a solution.

I exported the lsq in the GUI and I have no problem importing it there.

That's how I call import_question in JS:

options.body = JSON.stringify({method:'import_question', params: [SESSIONKEY, surveyID, 111, "limesurvey_question_3790.lsq", "lsq"], id:1});

Am I doing something wrong or do I have to preprocess the lsq before calling import_question?

Any help would be appreciated.

Thanks!
The topic has been locked.
  • blacky
  • blacky's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #201267 by blacky
Update: I did encode the filepath with base64, but it's still not working. When I copy the API part, which causes the error, and run it locally, it throws no errors. So I think it has something to do with how the path gets passed from Js to the PHP API, but I can't figure out why this is a problem.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose