Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

Retrieve particular question responses from API

mcase
mcase Durham, NCCommunity Member Qubie ✭

I am having a hard time scripting the appropriate string for pulling particular questions from the API into a CSV.
I am using the example script, in python, which worked great for dumping the whole dataset. But for the CSV, I only need certain questions for another project. I've gotten a variety of errors, but usually, it's the "results" text response.

Here is an example of what I tried to force without success. Any tips would be greatly appreciated.

downloadRequestUrl = baseUrl
downloadRequestPayload = '{"format":"' + fileFormat + '","surveyId":"' + surveyId + '","questionId":"' + ["QID28", "QID10"] + '"}'
downloadRequestResponse = requests.request("POST", downloadRequestUrl, data=downloadRequestPayload, headers=headers)
progressId = downloadRequestResponse.json()["result"]["id"]
print(downloadRequestResponse.text)