cpfaff / rBExIS

Exchange data and metadata between R and BExIS II
3 stars 4 forks source link

bypass token option for public data #10

Open amynang opened 2 years ago

amynang commented 2 years ago

At the moment the script below would not work. Dataset 90 is public (and could be downloaded from https://jexis.uni-jena.de without login) but rBExIS cannot retrieve it unless I provide my token.

library(httr) library(jsonlite) library(XML) library(rBExIS)

bexis.options(base_url = "https://jexis.uni-jena.de") # bexis.options(token = "") # this is necessary even for public datasets bexis_data90 <- bexis.get.dataset_by(id = 90)

cpfaff commented 2 years ago

At the moment I have not much time to maintain the package. I pulled in the changes and updates which have been made in https://github.com/BEXIS2/rBExIS. If you have time to help out you could write a pull request to fix it.

amynang commented 2 years ago

I'm not sure I have the coding skills for that but could give it a try. Any pointers on where to start appreciated.

cpfaff commented 2 years ago

I quickly checked. I guess the api on the bexis portal is not reachable without a token. You could code around it and use the urls that are provided via the frontend but then you get a zip with the files. That one you need to unpack and then you import the csv file in there. Correct solution to this would be to implement the access to datasets via the api on bexis in a more granular way.

cpfaff commented 2 years ago

@DavidBlaa Could you say something about it?

amynang commented 2 years ago

I quickly checked. I guess the api on the bexis portal is not reachable without a token. You could code around it and use the urls that are provided via the frontend but then you get a zip with the files. That one you need to unpack and then you import the csv file in there. Correct solution to this would be to implement the access to datasets via the api on bexis in a more granular way.

I agree. My workaround to this is this but it is hacky and probably fragile.