- Posts: 2
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
// Get the API Client Handle $myJSONRPCClient = new \org\jsonrpcphp\JsonRPCClient( LS_RPCURL ); // Authenticate and receive a session key $sessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD ); // Build the participant from ticket data $participant = array("email"=>$email,"lastname"=>$last,"firstname"=>$first,"language"=>$language,"emailstatus"=>$emailStatus); // Add single participant to an array of length 1 $participantList = array($participant); // Add the participant to the survey and save the JSON response to get the tokens out of $tokens = $myJSONRPCClient->add_participants( $sessionKey, $surveyId, $participantList, $createToken ); // Save some ticket information using the token // TODO - How do I do this? // Save $ticketNumber to "Ticket ID" question. I have a already created a URL parameter called 'ticketid' which works. If I can use this parameter directly from the API, that would be awesome. // Create an array of length 1 using the single returned token. $tokenIds = array($tokens[0]['tid']); // Send invites $tokens = $myJSONRPCClient->add_participants( $sessionKey, $surveyId, $participantList, $createToken );
Please Log in to join the conversation.
$participant = array( "email"=>$email,"lastname"=>$last,"firstname"=>$first,"language"=>$language,"emailstatus"=>$emailStatus, "attribute_1"=>$ticketId, "attribute_2"=>$groupName );
Please Log in to join the conversation.