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
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -26,18 +26,17 @@ The first step toward reproducible pipelines is to automate the process of searc
26
26
### Using Your API key to Connect
27
27
28
28
An API key is like a password. It allows you to access data, and should be kept private.
29
-
Therefore, we are not going to put it in code that we share. The one exception is the key 9999999999999999999999999999999999999999 that will allow you to access metadata tables (all tables except _traits_ and _yields_). It will also allow you to access all of the simulated data in the https://terraref.ncsa.illinois.edu/bety-test database.
29
+
Therefore, we are not going to put it in code that we share.
30
30
31
-
A common way of handling private API keys is to place it in a text file in your current directory.
32
-
Don't put it in a project directory where it might be inadvertently shared.
31
+
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
32
34
33
Here is how to find and save your API key:
35
34
36
35
* click file --> new --> text file
37
36
* copy the api key that was sent when you registered into the file
38
37
* file --> save as '.betykey'
39
38
40
-
For the public key, you can call this file `.betykey_public`.
39
+
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
40
42
41
43
42
## Accessing data using a URL query
@@ -49,7 +48,7 @@ For the public key, you can call this file `.betykey_public`.
49
48
* path to the api: `/api/v1`
50
49
* api endpoint: `/search` or `traits` or `sites`. For BETYdb, these are the names of database tables.
51
50
* Query parameters: `genus=Sorghum`
52
-
* Authentication: `key=9999999999999999999999999999999999999999` is the public key for the TERRA REF traits database.
51
+
* 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.
53
52
54
53
### Constructing a URL query
55
54
@@ -62,17 +61,16 @@ First, lets construct a query by putting together a URL.
62
61
3. Add the name of the table you want to query. Lets start with `variables`
0 commit comments