Welcome to the LimeSurvey Community Forum

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

i can't add_participant

  • grisuno
  • grisuno's Avatar Topic Author
  • Visitor
  • Visitor
10 years 8 months ago #98471 by grisuno
i can't add_participant was created by grisuno
Dear, I have a problem, do not know, if I am very stupid or what, but I can not use the functions invite_participant and add_participant, first describe the problem, I use the function add_participant and adding a participant but in blank, and invite_participants returns [status] => Error : No candidate tokens. Now show the sample code I am using.
Code:
error_reporting(-1);
require_once 'some_path_to/jsonRPCClient.php';
 
define( 'LS_BASEURL', 'http://some_url/system/survey/index.php');  // adjust this one to your actual LimeSurvey URL
 
define( 'LS_USER', 'admin' );
 
define( 'LS_PASSWORD', 'some_pass' );
 
// the survey to process
 
$survey_id=421678;
 
// instanciate a new client
 
$myJSONRPCClient = new jsonRPCClient( LS_BASEURL.'/admin/remotecontrol' );
 
// receive session key
 
$sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD );
 
// receive all ids and info of groups belonging to a given survey
 
$addp = $myJSONRPCClient->add_participants(
    $sessionKey, 
    $survey_id,
    array('email'=>'jsalinas@enexum.cl','lastname'=>'Salinas','firstname'=>"Jaime"),TRUE);
$send = $myJSONRPCClient->invite_participants($sessionKey, $survey_id);
$myJSONRPCClient->release_session_key( $sessionKey );  
print_r($addp);
print_r($send);
 
$myJSONRPCClient->release_session_key( $sessionKey );
 


and that return

Array
(


many thanks in advance
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose