'How to get the survey List from surveygizmo API in the Postman?(Trial Version)
I want to get list of survey from surveyGizmo API itself but its not working for Me.For valid token also it always returning error code is 401.
Alchemer :Version 5
https://api.alchemer.com/v5/survey?api_token="token"&api_token_secret="token"
Response: {"result_ok":false,"code":401,"message":"Invalid api_token or api_token_secret supplied"}
Solution 1:[1]
Found the solution.Please try to change the region while register.The trial version is currently supporting US-region
Solution 2:[2]
Late to this question but I just started using Alchemer (formerly SurveyGizmo) and the API access as shown below. You need to create an API app on Alchemer's site first.
# get responses from a survey:
# be sure to update the URL with your survey id number
library(ODataQuery)
s1res <- ODataQuery::retrieve_data(
url = paste0(
"https://api.alchemer.com/v5/survey/yourIdNumberHere/surveyresponse?api_token=",
api_token,
"&api_token_secret=",
apiSecretKey ) )
s1data <- s1res$data # yields a list for each respondent named "survey_data"
df<- tidyr::unnest(s1data$survey_data)
table(df$answer10) # check responses for one question
# remove unnecessary vars using `dplyr`
df2<-df %>% select(starts_with("question") | starts_with("answer")) %>% select(-contains("_id"))
# make column names from the first row of values
q_text<-df2 %>% select(starts_with("question")) %>% slice_head(n=1) %>% as.character()
df3<-df2 %>% select(starts_with("answer"))
colnames(df3)<-str_replace_all(q_text," ","") # assign new col names; check!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Priyanga Manivelan |
Solution 2 | Ben |