Welcome to the LimeSurvey Community Forum

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

Export responses via API by date

  • toox_015
  • toox_015's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #244330 by toox_015
Export responses via API by date was created by toox_015
Hello everyone,

I would like to export responses of a survey periodically. Let's say that I want to export daily the completed responses sent in the previous 24 hours.

I use the following code to get all completed answers, but I want to filter to the last 24 hours, how to do that?

data = {
    "method": "export_responses",
    "params": {
        "sSessionKey": session_key,
        "iSurveyID": survey_id,
        "sDocumentType": "json",
        "sCompletionStatus": "complete",
        "sHeadingType" : "code"
    },
    "id": 1}
       
response = requests.post(api_url, json=data, verify=False)

Thank you in advance.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose