如何从Postman中的surveygizmo API获取survey List?(试用版)

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

我想从 surveyGizmo API 本身获取调查列表,但它不适用于 Me.For 有效令牌,而且它总是返回错误代码 401。

炼金术士:版本 5

https://api.alchemer.com/v5/survey?api_token="token"&api_token_secret="token"

响应:{""result_ok":false,"code":401,"message":"无效 api_token 或 api_token_secret 提供"}

发现solution.Please尝试更改地区,而register.The试用版目前支持美国地区

迟到了这个问题,但我刚刚开始使用 Alchemer(以前称为 SurveyGizmo)和 API 访问权限,如下所示。您需要先在 Alchemer 的网站上创建一个 API 应用程序。

# 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!