rapiclient icon indicating copy to clipboard operation
rapiclient copied to clipboard

SEEK platform

Open jcolomb opened this issue 6 years ago • 1 comments

tried the package with the SEEK platform, and it is not working

get_api("https://www.fairdomhub.org")

Error in parse_con(txt, bigint_as_char) : lexical error: invalid char in json text. <!doctype html> <html lang="en (right here) ------^

I am not sure on which side the error is, but they say they use openapi ...

jcolomb avatar Dec 12 '18 15:12 jcolomb

The get_api routine requires a link to the API spec at "https://docs.seek4science.org/tech/api/definitions/swaggerSeek-oas3.yml"

However, this spec is a yaml file rather than JSON, so you need to do a quick conversion:

library(rapiclient) library(yaml) library(jsonlite) library(magrittr)

APIspec_yaml <- readLines("https://docs.seek4science.org/tech/api/definitions/swaggerSeek-oas3.yml")

FAIRDOM_SEEK <- read_yaml(text = APIspec_yaml) %>% toJSON() %>% get_api()

In order to create a functioning client, I suspect that you'll need to add basic authentication in to your HTTP header.

SEEKops <- get_operations(FAIRDOM_SEEK, .headers = authenticationHeader )

adamsardar avatar Jan 04 '19 12:01 adamsardar