Welcome to the LimeSurvey Community Forum

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

add_participants remote control api

  • muhzak
  • muhzak's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #101670 by muhzak
add_participants remote control api was created by muhzak
Hi,

So I can get information from lime. But when adding a token I use the following code:
Code:
$pData = array('firstname'=>"testFirst", 'lastname'=>'testLasy',"email"=>"fake@gmail.com");
$addParticipant = $myJSONRPCClient-add_participants($sessionKey,$survey_id,$pData );

It adds a token... that is an entry is made, and a unique token is generated. BUT the firstname, lastname and email are not added. I get the following return:
Code:
Array
(
    [firstname] => 
    [lastname] => 
    [email] => 
)

json_encoding the array does not help either. I am sure I'm missing something really obvious.
The topic has been locked.
  • muhzak
  • muhzak's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #101671 by muhzak
Replied by muhzak on topic add_participants remote control api
HA!

The second I pressed submit on the post above I realized my issue.

Because we can add multiple participants. I need to go one deeper in the array.
Code:
$pData = array();
$pData[] = array('firstname'=>"testFirst", 'lastname'=>'testLasy',"email"=>"fake@gmail.com");
// and now I can add multiple. 
 
$addParticipant = $myJSONRPCClient-add_participants($sessionKey,$survey_id,$pData );

Thanks for the help.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose