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

2 years 9 months ago #201083 by blacky

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.

The topic has been locked.
2 years 9 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