Welcome to the LimeSurvey Community Forum

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

LimeSurvey API

More
1 year 11 months ago #240829 by Immuc
LimeSurvey API was created by Immuc
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.7
Own server or LimeSurvey hosting: Own server
Survey theme/template: default
==================
Hello, i just want to get the number of answers on a survey via the JSON API. How do i do that? And how do i use javascript & typescript libraries like axios to do these requests? -> How do i do this through normal http requests?

Would be great to get an example to understand the usage of the API better.

I already tried several ways but none worked.

Thanks in advance,
Immuc

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #240850 by tpartner
Replied by tpartner on topic LimeSurvey API
Please refer to the manual - www.limesurvey.org/manual/RemoteControl_2_API

There are examples here - www.limesurvey.org/manual/RemoteControl_...I#Example_and_helper

I prefer to use PHP as it does not expose your credentials. Here is an old example - forums.limesurvey.org/index.php/forum/ca...-html?start=6#184946

Of course if you need to use JavaScript, you can access that file via an AJAX call - api.jquery.com/jquery.ajax/

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 year 11 months ago #240879 by Immuc
Replied by Immuc on topic LimeSurvey API
Hey,
I literally just pasted the node js example in a fresh environment and it does not work.
Any other example out there? Why does it not work?

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #240880 by holch
Replied by holch on topic LimeSurvey API

I literally just pasted the node js example in a fresh environment and it does not work.


You adapted it to your environment though, right?

Without any error messages or some more information, no one will know why it "does not work" for you. You are being quite vague here.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose