Welcome to the LimeSurvey Community Forum

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

RPC list_surveys returns an empty string after upgrade to v3

  • dkbergstrom
  • dkbergstrom's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #183437 by dkbergstrom
Recently I upgraded to Version 3.17.1+190408 from version 2. Everything seems to be working correctly except some of the RPC API calls.


Connection works
Code:
$rpc     = new \org\jsonrpcphp\JsonRPCClient( '***/admin/remotecontrol/' );
$key     = $rpc->get_session_key('***', '***');

List surveys works
Code:
$rpc->list_surveys($key, 'reports')

Export returns an empty string
Code:
$rpc->export_responses($key, $surveyID, 'json');

I have tried to change the parameters around according to the documentation and each combination returns and empty string. api.limesurvey.org/classes/remotecontrol_handle.html
The topic has been locked.
  • dominikvitt
  • dominikvitt's Avatar
  • Visitor
  • Visitor
4 years 10 months ago #183583 by dominikvitt
I tried to reproduce the same issue as you are having, but I get correct response.
You should get some message, not a empty string.
Please check if you get some message when trying with other export types: pdf, csv, xls, doc
The topic has been locked.
  • dkbergstrom
  • dkbergstrom's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 10 months ago #183631 by dkbergstrom
// var_dump for csv
string(0) ""

// var_dump for xls
string(0) ""

// var_dump for doc
string(0) ""

// var_dump for json
Fatal error: Uncaught exception 'Exception' with message 'Incorrect response id: (request id: 1)' in ***classes\thirdparty\jsonrpc\JsonRPCClient.php:185 Stack trace: #0 ***survey\index.php(36): org\jsonrpcphp\JsonRPCClient->__call('export_response...', Array) #1 ***survey\index.php(36): org\jsonrpcphp\JsonRPCClient->export_responses('***...', 887129, 'json') #2 {main} thrown in ***classes\thirdparty\jsonrpc\JsonRPCClient.php on line 185
The topic has been locked.
  • dkbergstrom
  • dkbergstrom's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 10 months ago #183930 by dkbergstrom
I resolved the issue by doing a clean install and then migrating the database.
The topic has been locked.
  • dominikvitt
  • dominikvitt's Avatar
  • Visitor
  • Visitor
4 years 10 months ago #183938 by dominikvitt
Great that you solved this problem!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose