Skip to content
Advertisement

Show question from surveygizmo survey using API Python

im using an API to get some responses from surveygizmo. It works, but it is changing the question to [question(1)], [question(2)]…

import surveygizmo as sg

client = sg.SurveyGizmo(
api_version='v4',
# example
api_token = "api_token",
api_token_secret = "api_token_secret."
)

survey_id = "survey_id"

responses = client.api.surveyresponse.list(survey_id)

pages = responses['total_pages']

data = []

responses

I got the following answer:

{'result_ok': True,
 'total_count': 5,
 'page': 1,
 'total_pages': 1,
 'results_per_page': 50,
 'data': [{'id': '1',
   'contact_id': '',
   'status': 'Complete',
   'is_test_data': '0',
   'datesubmitted': '2020-01-22 16:07:30',
   'SessionID': '1579727226_5e28b97a9ff992.53369554',
   'Language': 'Portuguese (Brazil)',
   'datestarted': '2020-01-22 16:07:30',
   'iLinkID': '9342723',
   'sResponseComment': '',
   'responseID': '1',
   '[question(2)]': 'Sim',
   '[question(3)]': 'Assunto',
   '[question(4)]': '8',

...

I need to show the question as it was made. How it is possible to do that?

Advertisement

Answer

I found the answer. api_version=’v4′ has some limitations, the question text came with api_version=’v5′.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement