cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 36 forks source link

example using set_survey_properties #60

Closed migman63 closed 1 year ago

migman63 commented 1 year ago

Hi guys. Using LS 5.3, I'm trying to set via API the expires date for a survey, and to do this I'm using the method set_survey_properties in R. Unfortunately it seems not working, the value of the filed doesn't change. Please, has someone a working example of successfully invoking set_survey_properties in R? Thank you so much Manlio

migman63 commented 1 year ago

Solved, here a working example charDate="2022-11-24 12:00:00" prop.list=list(aSurveyData=list("datecreated"=charDate)) par <- c(key.list, id.list,prop.list) m="set_survey_properties" body.json <- list(method = m, id = " ", params = par) r <- httr::POST(getOption("lime_api"), httr::content_type_json(), body = jsonlite::toJSON(body.json, auto_unbox = TRUE)) text_content(r)