Welcome to the LimeSurvey Community Forum

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

R package Limer: does it work with limesurvey 5.3?

  • migliorati
  • migliorati's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #230772 by migliorati
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.3
Own server or LimeSurvey hosting: own server
Survey theme/template:
==================
Hi guys. We passed to version 5.3, and now we have problems using API via the R limer package (I open a ticket about).
There 's someone successfully using limer package of R to access Limesurvey 5.3?
Tx you

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 months ago #230774 by Joffm
Hi,
why do you ask this question about your limer issue again?
[url] forums.limesurvey.org/forum/installation...update-to-5-3#230754 [/url]

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • migliorati
  • migliorati's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #230777 by migliorati
Hi Joff.
The 2 questions are different: in the post you refer to I'm asking for the reason of an error, here I'm simply asking if someone is using the package with the new release of Limesurvey, to verify if they are compatible...
Tx for your work

Manlio

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 months ago #230783 by holch

The 2 questions are different:


Not really... ;-)

And this second question could simply be asked in addition on the same post. I don't think many use Limer and of those that do, few are in the forum on a regular basis. I think the best chance to get feedback is to get in contact with the people who develop Limer.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 3 months ago #230790 by tammo
We (Respondage)  use it to make online reports like this:
reporting.toolsforresearch.com/project/d...VF&id=128&sid=863547

The php file calls an R script that calls several RMarkdown scripts. All is based on data that is collected from a LimeSurvey 5.3.26 instance:
vragenlijst.digiscanbouw.nl/index.php/86...t=Y&lang=nl-informal

No problems using Limer, but I believe my business partner did tweak something. I'll ask him.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: holch

Please Log in to join the conversation.

  • Jane
  • Jane's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 3 months ago - 2 years 3 months ago #230791 by Jane
We did not tweak limer for LS 5.3. We had to tweak it for older versions like v2.

@migliorati Your issue at github.com/cloudyr/limer/issues/58 states that get_session_key is not working and returns an error.
My gut feeling is that it is an error in your RPC2 config. Did you check if it works with a direct call? For instance in PHP:

Code:
        define('ROOT', '/path/to/lsroot/');
        require_once ROOT . 'application/libraries/jsonRPCClient.php';
        define( 'LS_USER', 'reporter' );
        define( 'LS_PASSWORD', 'verysecret' );
        // instantiate a new client
        $myJSONRPCClient = new JsonRPCClient( 'https://example.com/index.php/admin/remotecontrol' );
        // receive session key
        $sSessionKey = $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );
        echo $sSessionKey;
Last edit: 2 years 3 months ago by Jane. Reason: Type in edited PHP code
The following user(s) said Thank You: holch, tpartner

Please Log in to join the conversation.

  • migliorati
  • migliorati's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #230815 by migliorati
Hi guys, and tx so much for your replies.
I solved the problem, and here I'm describing MY experience.
The R limer package, in the release you can find on github, doesn't work with limesurvey 5.6
What I had to do was to modify:
- function get_session_key: the original implementation refers the field"admin" that seems has been erased in ver. 5.6. I guessed to use the field"username", instead, and it works
- to modify the management of the session_key to correctly use it in function "call_limer"
After these 2 modifications, my call was working.
TX again

Manlio

Please Log in to join the conversation.

  • Jane
  • Jane's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 3 months ago - 2 years 3 months ago #230818 by Jane
Strange. This has not been changed in limer since the introduction 7 year ago:
github.com/cloudyr/limer/blame/4e0f7c571...et_session_key.R#L13
We are using this and it is stil working in LS 5.3.26+220720 
Code:
options(lime_api = 'https://example.com/index.php/admin/remotecontrol')
options(lime_username = 'reporter')
options(lime_password = 'verysecret')
session_key <- get_session_key()
lsquestions <- call_limer(method="list_questions", params = list(iSurveyID = SID))
Last edit: 2 years 3 months ago by Jane. Reason: Add lime_api option & detailed LS version

Please Log in to join the conversation.

  • migliorati
  • migliorati's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #230820 by migliorati
In the params list of the body_json it is defined the param "admin"
In my case, with limesurvey 5.6, invoking get_session_key I have a fail with http status 500.
changing it from "admin" to "username" the call works

Please Log in to join the conversation.

  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 3 months ago #230821 by tammo
Current version of LimeSurvey is 5.3.28.

Where did you download version 5.6?


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

  • Jane
  • Jane's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 3 months ago #230822 by Jane
We do not send a body_json. We just put the lime_username and lime_password in the options:
github.com/cloudyr/limer/blob/4e0f7c5713..._session_key.R#L4-L5

#' @param username LimeSurvey username. Defaults to value set in \code{options()}.
#' @param password LimeSurvey password Defaults to value set in \code{options()}.

Please Log in to join the conversation.

  • migliorati
  • migliorati's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 3 months ago #230831 by migliorati
As from subject and all the thread, it is a typo. We are talking about 5.3

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose