0

Is there a way to add a user to Limesurvey through RemoteControl2-API? I would like to programmtically add users and surveys belonging to that user.

Hokascha
  • 1,709
  • 1
  • 23
  • 41
  • There are no solution with actual API to add admin user. Please look at manual : https://manual.limesurvey.org/RemoteControl_2_API . Or source code : http://api.limesurvey.org/classes/remotecontrol_handle.html – Denis Chenu May 27 '15 at 12:59

1 Answers1

0

you can add a user using add_participants function of remote control API of limesurvey. You can see how I used it my work: // without composer this line can be used include_once("../../lib/jsonrpcphp/JsonRPCClient.php");

    //Get Session parameters
    $myJSONRPCClient = new JsonRPCClient( LS_BASEURL );
    $sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );

    $aParticipantData = array(
        'user'=>array('firstname'=>'Christopher',
                'lastname'=>'hitchens',
                'email'=>'christopher@example.com',
                'language'=>'en',
                'emailstatus'=>'ok'),
        );

    $added_user = $myJSONRPCClient->add_participants($sessionKey, $survey_id, $aParticipantData, 1);
    $myJSONRPCClient->release_session_key($sessionKey );

You can use this code when user want to register for that survey.

It will be better if provide more info about problem. you can get more information about this at this link: http://code.uoa.gr/p/limesurvey/test_scenarios.php