Obtaining responses through API

More
2 years 2 months ago #125936 by TaiSHi
TaiSHi created the topic: Obtaining responses through API
Hi,

Is there a way to obtain a json list from all responses through API? I've been struggling with it with no success.
export_respones only returns a subset of values (id, lastpage, startlanguage, submitdate) but no actual responses from the survey.

Thanks in advance,
J

Please Log in to join the conversation.

More
2 years 2 months ago #125953 by DenisChenu
DenisChenu replied the topic: Obtaining responses through API

TaiSHi wrote: Hi,

Is there a way to obtain a json list from all responses through API? I've been struggling with it with no success.
export_respones only returns a subset of values (id, lastpage, startlanguage, submitdate) but no actual responses from the survey.

Thanks in advance,
J

Strange,

Last time i tested and use it, export whole responses DB and column ?

You use the last build for API ?

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #125968 by TaiSHi
TaiSHi replied the topic: Obtaining responses through API
Ok, forum borked me twice, I'm pasting half of my old message as it seems to crash with certain characters...
Gah, forum gave a 502 and my response got deleted!
As I was saying, I'm on Version 2.06+ Build 150731, updated through app. Using my own fork/implementation of a python glue (you can get it here ), so I might be missing something
I'm attaching 2 responses, one for a single key (so it's easier to read) and a full response after.

/cheers
Attachments:
Last Edit: 2 years 2 months ago by TaiSHi.

Please Log in to join the conversation.

More
2 years 2 months ago #126038 by DenisChenu
DenisChenu replied the topic: Obtaining responses through API
I do a quick test , code is $lsJSONRPCClient->export_responses( $sessionKey,$iSurveyId,'json');

I get all responses : www.gsill.net/brouillon/rcLS/

With the last GIT version. Can you test with a version upper to your actual version ?

Looking at git history, unsure we have a fix actually but .... github.com/LimeSurvey/LimeSurvey/commits...tecontrol_handle.php

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #126039 by DenisChenu
DenisChenu replied the topic: Obtaining responses through API
OK !

Can reproduce the issue :
$lsJSONRPCClient->export_responses( $sessionKey,$iSurveyId,'json'); : return reponses line
$lsJSONRPCClient->export_responses( $sessionKey,$iSurveyId,'json','complete' ); : return only some answers part

Can you report the bug please ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 2 years 2 months ago by DenisChenu.

Please Log in to join the conversation.

More
2 years 2 months ago #126073 by TaiSHi
TaiSHi replied the topic: Obtaining responses through API
Done! Thanks for reproducing!

bugs.limesurvey.org/view.php?id=9919

Please Log in to join the conversation.

More
2 years 2 months ago #126074 by TaiSHi
TaiSHi replied the topic: Obtaining responses through API
I can confirm that passing only session/surveyID/json exports responses as expected, adding further parameters borks

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!