Code:
# step 1
enddate=$(date -v -1H -u +"%Y-%m-%dT%H:%M:%SZ")
pid=$(curl --request POST \
--url https:///weblink]/API/v3/surveys/${survey_id}/export-responses \
--header 'Content-Type: application/json' \
--header "X-API-TOKEN: ${API_token}" \
--data "{\"format\": \"csv\", \"compress\":\"False\",\"useLabels\":\"True\", \"startDate\":\"${enddate}\"}" | /usr/local/bin/jq -r '.result.progressId')
echo ${pid}
wait
sleep 3
# step 2
fileid=$(curl --request GET \
--url https:///weblink]/API/v3/surveys/${survey_id}/export-responses/${pid} \
--header 'Content-Type: application/json' \
--header "X-API-TOKEN: ${API_token}" \
--data '{"format": "csv", "useLabels":"True"}' | /usr/local/bin/jq -r '.result.fileId')
echo ${fileid}
# step 3
curl --request GET \
--url https:///weblink]/API/v3/surveys/${survey_id}/export-responses/${fileid}/file \
--header 'Content-Type: application/json' \
--header "X-API-TOKEN: ${API_token}" \
--output ~/output.csv
Step 1 still works, but step 2 throws an error:
`curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)`
Can I get some ideas on the nature of this error? Thanks a lot.