Import data from API

I am a complete novice at this task, so grateful for any suggestions.

For a research project, we collect data in the field using CommCare. Data are collected as "forms" and synced to the CommCare server. To date, we have been downloading data from CommCareHQ when required, and importing into R for analysis. But I am wondering if there is a more efficient way of doing this using the CommCare data API?

I think this is the correct page with instructions for accessing form data:
https://confluence.dimagi.com/display/commcarepublic/List+Forms

So far, I have tried the following:

library(httr)

username <- "my_username"
password <- "my_password"

call <- "https://www.commcarehq.org/a/PROJECTNAME/api/v0.5/form&xmlns=http://openrosa.org/formdesigner/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX"

get_data <- GET(call, authenticate(username, password))

...but now completely stuck about what to do next. Very grateful for suggestions.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.