-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapiary.apib
52 lines (34 loc) · 2.04 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FORMAT: 1A
HOST: http://fossilcalibrations.org/api/v1/
# fcdb-api
fcdb-api is a read-only REST interace to the [Fossil Calibrations database](https://github.com/NESCent/FossilCalibrations)
# Group Calibrations
Calibrations related resources of the **fcdb-api**
## Calibrations Collection [/calibrations{?.format}{?maxAge,minAge,clade,tipTaxa%5B%5D,geologicalTime}]
+ Parameters
+ maxAge (optional, string) ... Maximum, i.e. oldest, calibration age in Ma.
+ minAge (optional, string) ... Minimum, i.e. youngest, calibration age in Ma.
+ clade (optional, string) ... Name of taxon identifying clade in which to search
+ tipTaxa%5B%5D (optional, array) ... Up to 2 taxa to use when performing an MRCA search.
+ geologicalTime (optional, string) ... Geological time period
+ format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json`
### Filter Calibrations [GET]
#### Samples
- GET /api/v1/calibrations?geologicalTime=Neogene
- GET /api/v1/calibrations?minAge=10&maxAge=35
- GET /api/v1/calibrations.csv?clade=Primates
- GET /api/v1/calibrations?tipTaxa[]=dog&tipTaxa[]=cat
Returns calibrations in the database, maching the optional filter parameters.
+ Response 200 (application/json)
[
{"id":1,"nodeName":"node1","nodeMinAge":0,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]},
{"id":2,"nodeName":"node2","nodeMinAge":10,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]}
]
## Calibration [/calibrations/{id}{?.format}]
A single Calibration object with its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Calibration to perform action with.
+ format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json`
### Retrieve a Calibration [GET]
+ Response 200 (application/json)
{"id":1,"nodeName":"node1","nodeMinAge":0,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]}