There are a number of different GET and POST endpoints in the GWAS database API. This is a generic way to access them.
api_query(
path,
query = NULL,
opengwas_jwt = get_opengwas_jwt(),
method = "GET",
silent = TRUE,
encode = "json",
timeout = 300,
override_429 = FALSE
)
httr response object
Either a full query path (e.g. for get) or an endpoint (e.g. for post) queries
If post query, provide a list of arguments as the payload. NULL
by default
Used to authenticate protected endpoints. Login to https://api.opengwas.io to obtain a jwt. Provide the jwt string here, or store in .Renviron under the keyname OPENGWAS_JWT.
"GET"
(default) or "POST"
, "DELETE"
etc
TRUE
/FALSE
to be passed to httr call. TRUE
by default
Default = "json"
, see httr::POST
for options
Default = 300
, avoid increasing this, preferentially
simplify the query first.
Default=FALSE. If allowance is exceeded then the query will error before submitting a request to avoid getting blocked. If you are sure you want to submit the request then set this to TRUE.