An example of getting Epicollect5 data in R. Get the source code here.
library(httr)library(jsonlite) # if needing json formatcID<-"999" # client IDsecret<- "F00HaHa00G" # client secretproj.slug<- "YourProjectSlug" # project slugform.ref<- "YourFormRef" # form referencebranch.ref<- "YourFromRef+BranchExtension" # branch referenceres <- POST("https://five.epicollect.net/api/oauth/token",body = list(grant_type = "client_credentials",client_id = cID,client_secret = secret))http_status(res)token <- content(res)$access_token# url.form<- paste("https://five.epicollect.net/api/export/entries/", proj.slug, "?map_index=0&form_ref=", form.ref, "&format=json", sep= "") ## if using jsonurl.form<- paste("https://five.epicollect.net/api/export/entries/", proj.slug, "?map_index=0&form_ref=", form.ref, "&format=csv&headers=true", sep= "")res1<- GET(url.form, add_headers("Authorization" = paste("Bearer", token)))http_status(res1)# ct1<- fromJSON(rawToChar(content(res1))) ## if using jsonct1<- read.csv(res1$url)str(ct1)# url.branch<- paste("https://five.epicollect.net/api/export/entries/", proj.slug, "?map_index=0&branch_ref=", branch.ref, "&format=json&per_page=1000000", sep= "") ## if using json; pushing max number of records from default 50 to 10^6url.branch<- paste("https://five.epicollect.net/api/export/entries/", proj.slug, "?map_index=0&branch_ref=", branch.ref, "&format=csv&headers=true", sep= "")res2<- GET(url.branch, add_headers("Authorization" = paste("Bearer", token)))http_status(res2)ct2<- read.csv(res2$url)# ct2<- fromJSON(rawToChar(content(res2))) ## if using jsonstr(ct2)