- Posts: 24
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Getting responses for a survey via Remote Control 2 API
- Anurag01
- Topic Author
- Offline
- Junior Member
Less
More
10 years 7 months ago #98642
by Anurag01
Getting responses for a survey via Remote Control 2 API was created by Anurag01
I'm struggling with getting responses for a non-anonymized survey that has a tokens table properly initialized and that has some valid responses as well. The problem is:
And no, I'm not calling the JSON-RPC webservice the wrong way. Several other methods, like list_questions, list_participants, etc., are working fine.
Could someone help me out here?
- There doesn't seem to be a direct method in the API to get survey responses. There is export_responses, but that's not what I want as it exports responses to a file.
- A potential solution seems to exist in get_summary (completed_responses and full_responses stats), but even that isn't working for me. But it may be that I'm calling it in the wrong way. I pass as arguments to this method -- session key, survey id and the stat name. What I get in response is this JSON object --
Code:
{ "id": "1", "result": "1", "error": null }
And no, I'm not calling the JSON-RPC webservice the wrong way. Several other methods, like list_questions, list_participants, etc., are working fine.
Could someone help me out here?
The topic has been locked.
- Anurag01
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
10 years 7 months ago #98675
by Anurag01
Replied by Anurag01 on topic Getting responses for a survey via Remote Control 2 API
A gentle bump
The topic has been locked.
- Anurag01
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
10 years 7 months ago #98709
by Anurag01
Replied by Anurag01 on topic Getting responses for a survey via Remote Control 2 API
Another gentle bump. Anybody home? :whistle:
The topic has been locked.
- mdekker
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 55
- Thank you received: 12
10 years 7 months ago #98714
by mdekker
---
Menno Dekker
Replied by mdekker on topic Getting responses for a survey via Remote Control 2 API
What are you trying to do? Do you know the token or responseid you would like to request? Exporting to csv would result in something easy to parse after receiving it.
What exact calls are you using (minus the sessionid)? What version (build) are you using?
What exact calls are you using (minus the sessionid)? What version (build) are you using?
---
Menno Dekker
The topic has been locked.
- Anurag01
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
10 years 7 months ago #98715
by Anurag01
I'm trying to retrieve all responses to the survey as they would appear in an exported file. I do not want to retrieve info for a particular token, but for the entire respondents. Hence, token info is not required in my request.
Exporting to CSV is not an option as I want to get data in JSON format. As I mentioned before, I'm calling the get_summary function with these arguments -- session key, survey id and the stat name (full_responses).
Limesurvey Version 2.00+ Build 130611
Thanks
Replied by Anurag01 on topic Getting responses for a survey via Remote Control 2 API
mdekker wrote: What are you trying to do? Do you know the token or responseid you would like to request? Exporting to csv would result in something easy to parse after receiving it.
What exact calls are you using (minus the sessionid)? What version (build) are you using?
I'm trying to retrieve all responses to the survey as they would appear in an exported file. I do not want to retrieve info for a particular token, but for the entire respondents. Hence, token info is not required in my request.
Exporting to CSV is not an option as I want to get data in JSON format. As I mentioned before, I'm calling the get_summary function with these arguments -- session key, survey id and the stat name (full_responses).
Limesurvey Version 2.00+ Build 130611
Thanks
The topic has been locked.
- mdekker
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 55
- Thank you received: 12
10 years 7 months ago #98722
by mdekker
---
Menno Dekker
Replied by mdekker on topic Getting responses for a survey via Remote Control 2 API
The get_summary will only report how many responses are available, not the response itself. So if you want responses, the only option you have is to use export_responses and parse csv output.
---
Menno Dekker
The topic has been locked.