Retrieves the list of survey questions associated with a ClimMob project using the ClimMob API. The function sends a request to the getListOfQuestionsByProject endpoint and returns the survey questions as a data frame.

This function is useful for extracting questionnaire structures used in ClimMob projects, which can then be used for documentation, translation, validation, or integration into analysis pipelines.

If the API request fails (e.g., invalid project, unsupported language, or server error), the function prints a message and returns NULL instead of terminating the R session.

getSurvey(key, userowner, project, language)

Arguments

key

character, the user's API key

userowner

character, username of project's owner

project

character, the project id

language

Character. Language code for the questionnaire

Value

A data frame containing the survey questions associated with the specified project and language. Returns NULL if the request fails.

Details

The function queries the ClimMob API endpoint: https://1000farms.climmob.net/api/getListOfQuestionsByProject.

The API response is returned as JSON and parsed into an R data frame. If the server returns an error or invalid JSON, the function reports the issue and safely returns NULL.

See also

Other GET functions: getDataCM(), getProjectProgress(), getProjectsCM()

Examples

if (FALSE) { # interactive()
# This function only works with an API key
# the API key can be obtained from your ClimMob account
 
library("ClimMobTools")
my_key = "d39a3c66-5822-4930-a9d4-50e7da041e77"
}