mbischof / LimeSurvey

The most popular FOSS online survey tool on the web.
https://www.limesurvey.org
Other
0 stars 0 forks source link

How to import Participants to CPDB via remote control #5

Open mbischof opened 5 years ago

mbischof commented 5 years ago
$client = new \org\jsonrpcphp\JsonRPCClient(
    'http://limesurvey.localhost/index.php/admin/remotecontrol'
);

$sessionKey= $client->get_session_key('username', 'password');

$participants = array(
    array(
        'firstname' => 'firstname 1',
        'lastname' => 'lastname 1',
        'email' => 'firstname1.lastname1@test.com'
    ),
    array(
        'firstname' => 'firstname 2',
        'lastname' => 'lastname 2',
        'email' => 'firstname2.lastname2@test.com',
        'blacklisted' => 'Y' //setting the blacklisted attribute currently not support -> BUG or FEATURE?
    )
);

$result = $client->cpd_importParticipants($sessionKey, $participants);
var_dump($result); exit;

BUT: https://bugs.limesurvey.org/view.php?id=15610