1. What is the problem? Be very detailed.
Hi,
I'm trying to create an R script that will download all the submissions for a form from ODK central into a local zip file with the CSV and media attachments.
I am using the ruODK
package and httr
. However, with the code I've tried below, I can't see how to download the data. Any help would be useful.
2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Central v1.1.2
3. What you have you tried to fix the problem?
> x <- httr::RETRY("GET",
> paste0(ruODK::get_default_url(),
> "/v1/projects/",
> ruODK::get_default_pid(),
> "/forms/",
> "laLmRDT2",
> "/submissions.csv.zip?media=true"),
> httr::authenticate(Sys.getenv("ODKC_UN"),
> Sys.getenv("ODKC_PW")
> ))
4. What steps can we take to reproduce the problem?
5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
When this code is run I get the following message in the console window
Response [https:/xxx.xxx.xxx/laLmRDT2/submissions.csv.zip?media=true]
Date: 2021-03-13 21:41
Status: 200
Content-Type: application/zip
Size: 832 B
<BINARY BODY>