odb_config: Generate the connection configuration

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Use this function to generate a base configuration for all the other functions.

Usage

1
odb_config(base_url, token, api_version, ...)

Arguments

base_url

character. The base URL for the API calls. It should start with the protocol ("http") and end with "api". Defaults to OpenDataBio test server.

token

character. The API token for a registered user. The data that can be accessed will vary from user to user! Leave blank for anonymous login.

api_version

character. Use this to specify the API version to connect to. You can set this to NULL to connect to the latest API, but this might break your code.

...

Further parameters to be passed to add_headers.

Details

You can set the environment variables ODB_BASE_URL, ODB_TOKEN and ODB_API_VERSION to avoid typing these at each script. Please note that if you need to use the odb_config function explicitly if you need more flexibility.

Value

list

Examples

1
2
3
4
5
6
7
8
## Not run: 
cfg = odb_config(
   base_url = "http://localhost/opendatabio/api",
   token = "ABCDEF",
   api_version = "v0"
)

## End(Not run)

opendatabio/opendatabio-r documentation built on Sept. 27, 2021, 1:32 a.m.