- Posts: 55
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
<?php /* * * * * * * * * * * * * * * * * * * * * * * Start Edit * * * * * * * * * * * * * * * * * * * * * */ define( 'LS_BASEURL', 'https://www.example.org' ); // if subbfolder => https://localhost/MyFolder define( 'LS_USER', 'admin' ); define( 'LS_PASSWORD', 'password' ); $iSurveyId = 1234; // survey ID /* * * * * * * * * * * * * * * * * * * * * * * End Edit * * * * * * * * * * * * * * * * * * * * * */ /* using LimeSurvey (LS) RemoteControly API version 2's JSON-RPC method */ include "application/libraries/jsonRPCClient.php"; /* instantiate a new client */ $lsJSONRPCClient = new jsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' ); /* receive session key */ $sessionKey = $lsJSONRPCClient->get_session_key(LS_USER, LS_PASSWORD); /* receive all ids and info of query belonging to a given survey */ $properties = array('template','datecreated','showwelcome','bounce_email'); $result = $lsJSONRPCClient->call('get_survey_properties', array($sessionKey,$iSurveyId,$properties)); /* output */ print_r($result, null ); /* release the session key */ $lsJSONRPCClient->release_session_key($sessionKey); ?>
jltrussart11 wrote: ...and it's published on admin/remotecontrol.