You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: traits/02-betydb-api-access.Rmd
+12-13Lines changed: 12 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -31,24 +31,23 @@ Therefore, we are not going to put it in code that we share.
31
31
32
32
A common way of handling private API keys is to place it in a text file in your current directory. Don't put it in a project directory where it might be inadvertently shared.
33
33
34
-
Here is how to find and save your API key:
34
+
Here is how to find and save your API key to a hidden file:
35
35
36
36
* click file --> new --> text file
37
37
* copy the api key that was sent when you registered into the file
38
-
* file --> save as '.betykey'
39
-
40
-
An API key is not needed to access public data. This includes metadata tables and simulated data in the https://terraref.ncsa.illinois.edu/bety-test database.
41
-
38
+
* file --> save as '.betykey' (don't use apostrophes).
39
+
* you won't be able to see this file in the file browser in R Studio, as this build doesn't allow display of hidden files in this window. To see your hidden file, open the terminal window in that folder and type 'ls -a'
42
40
41
+
An API key is not needed to access public data includes sample datasets and metadata.
43
42
44
43
## Accessing data using a URL query
45
44
46
45
47
46
### Components of a URL query
48
47
49
-
*base url: `terraref.ncsa.illinois.edu/bety`
50
-
*path to the api: `/api/v1`
51
-
*api endpoint: `/search` or `traits` or `sites`. For BETYdb, these are the names of database tables.
48
+
*Base url: `terraref.ncsa.illinois.edu/bety`
49
+
*Path to the api: `/api/v1`
50
+
*API endpoint: `/search` or `traits` or `sites`. For BETYdb, these are the names of database tables.
52
51
* Query parameters: `genus=Sorghum`
53
52
54
53
* Authentication: `key=api_key` is your assigned API key. This will only be needed when querying trait data. No key is needed to access the public metadata tables.
@@ -61,16 +60,16 @@ First, lets construct a query by putting together a URL.
61
60
1. start with the database url: `terraref.ncsa.illinois.edu/bety`
62
61
* this url brings you to the home page
63
62
2. Add the path to the API, `/api/v1`
64
-
* now we have terraref.ncsa.illinois.edu/bety/api/v1, which points to the API documentation
63
+
* now we have terraref.ncsa.illinois.edu/bety/api/v1, which points to the API documentation for additional detail on available options
65
64
3. Add the name of the table you want to query. Lets start with `variables`
0 commit comments