Hi,
I'm starting to look at the API and i mess around.
I'm trying to connect to the API, without success. I always got a http error 500.
My limesurvey installation is locate at
vecteursleviers.com/conseil/index.php?r=admin
I also got an http error 500 when I try do display the /conseil/ folder.
The jsonrpcphp library from github is intalled in a folder name api on my web server. The client can be found at the url
vecteursleviers.com/conseil/api/jsonrpcp...r/src/org/jsonrpcphp
I've create a php file at this location
vecteursleviers.com/conseil/api/API-Lime-JLT.php
and add this code.
The *** are my my verified login infos.
Can you help me find where I got wrong?
Thanks for your precious help!
<?php
// without composer this line can be used
// require_once 'jsonrpcphp-master\src\org\jsonrpcph\jsonRPCClient.php';
// with composer support just add the autoloader
include_once 'vendor/autoload.php';
define( 'LS_BASEURL', '
vecteursleviers.com/conseil/
'); // adjust this one to your actual LimeSurvey URL DONE
define( 'LS_USER', '***' );
define( 'LS_PASSWORD', '***' );
// the survey to process
$survey_id=374699;
// instanciate a new client
$myJSONRPCClient = new \org\jsonrpcphp\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
$groups = $myJSONRPCClient->list_groups( $sessionKey, $survey_id );
print_r($groups, null );
// release the session key
$myJSONRPCClient->release_session_key( $sessionKey );
add_participants
/**
* RPC Routine to add participants to the tokens collection of the survey.
* Returns the inserted data including additional new information like the Token entry ID and the token string.
*
* @access public
* @param string $sSessionKey Auth credentials
* @param int $iSurveyID ID of the Survey
* @param struct $aParticipantData Data of the participants to be added
* @param bool Optional - Defaults to true and determins if the access token automatically created
* @return array The values added
*/
php?>