asitav-sen / KoboconnectR

Download data from Kobotoolbox to R
https://asitav-sen.github.io/KoboconnectR/
GNU General Public License v3.0
13 stars 2 forks source link

kobo_kf_download problem: Could not resolve host #8

Closed andresimi closed 2 years ago

andresimi commented 2 years ago

Hi, I am also having troubles with kobo_kf_donwnload. But a little different from the previous issues. I am receiving this message:

df <- kobo_df_download(uname, pwd, assetid, all="false", lang="English (em)", include_grp="false", grp_sep=NULL) Error in curl::curl_fetch_memory(url, handle = handle) : Could not resolve host: andresimi

What this could be?

asitav-sen commented 2 years ago

Hi @andresimi , Sorry about the issue. Are you using any proxy? And is the language correct?

andresimi commented 2 years ago

Hi, thank you for your prompt response. No, I am not using proxies and the language is correct. The message persists if I let default language.

asitav-sen commented 2 years ago

Hi @andresimi , Do the other functions work with same url, userid and password? Also, could you please check if you can access this one from your browser, post login? https://{KF_URL}/api/v2/assets/{ASSET_UID}/exports

FInally, is the url parameter set to the correct one? The default value is "url="kobo.humanitarianresponse.info". I'm asking this because I don't see the url value in the code you have provided.

andresimi commented 2 years ago

Hello @asitav-sen, thank you for your return.

  1. I am able to use kobotools_kpi_data to download data, however, i think it is JSON format.
  2. I am not sure what to see in the url, so I will post here: image
  3. The url parameter is url <- "kf.kobotoolbox.org"

Thank you!

asitav-sen commented 2 years ago

Hi @andresimi , Thank you for your patience. I noticed that the there is no option of "include group" in the API anymore and group separator is compulsory. I have changed my code accordingly. Please download the github version. # install.packages("devtools") devtools::install_github("asitav-sen/KoboconnectR")

Then rerun the code with grp_sep="/". Hope it helps. Please let me know how it goes.

andresimi commented 2 years ago

Hello @asitav-sen! I updated the package as you instructed, however it had no effect on the problem:

image Best!

asitav-sen commented 2 years ago

Hi @andresimi , You need to add the URL parameter as well. ` kobo_df_download( url="kf.kobotoolbox.org", uname = "username", pwd="password", assetid = "assetid", lang="English (em)")

` This is because the default value of URL is "kobo.humanitarianresponse.info".

Hope it helps.

andresimi commented 2 years ago

That helped! It worked. I didn't saw this argument was missing! Thank you!