FaunaMarin Lab API V2.3 beta
This is a lightweight API to access FaunaMarin's laboratory database.
Users can create a unique 64-character string as an access token, granting access to the user's data here (must be logged in):
/en/home/token
To create a new test token for your company you can use:
Login: user@example.com
Password: test
The token can be renewed or discarded by the user at any time.
The token is user-specific, so you don’t have to submit a user-ID or password.
Limitations
- To use our API a partner key must be submitted with the user token. Please contact us at labor@faunamarin.de to get the secret partner key to access the API V2.
- You can only send 60 requests per minute. Exceeding this limit will result in HTTP 429 (Too Many Requests).
Note on timestamps: All timestamps returned by the API are server timestamps formatted with PHP format('Y-m-d h:i:s') (example: 2020-12-08 12:29:45). The values reflect the server time (timezone Europe/Berlin). No timezone suffix is included.
TOC
User endpoint
Parameters (GET or POST, POST recommended for security):
| key | string with auth string per partner |
|---|---|
| token | string with auth string from user |
Output:
| id | bigint(20) unsigned (auto increment) |
|---|---|
| name | varchar(255) |
| varchar(190) | |
| email_verified | timestamp (nullable) |
| created | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| updated | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| customerId | int(10) unsigned (nullable) |
| lastname | varchar(255) (nullable) |
| firstname | varchar(255) (nullable) |
| langId | int(10) unsigned [default: 0] |
| lastLogin | datetime (nullable) |
| last_seen | datetime (nullable) |
Test:
Aquariums endpoint
Parameters (GET or POST, POST recommended for security):
| key | string with auth string per partner |
|---|---|
| token | string with auth string from user |
Output:
| id | bigint(20) unsigned (auto increment) |
|---|---|
| created | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| updated | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| user_id | int(10) unsigned |
| name | varchar(255) |
| startup_date | date (nullable) |
| show | tinyint(1) [default: 0] (nullable) |
| length | decimal(8,2) (nullable) |
| width | decimal(8,2) (nullable) |
| height | decimal(8,2) (nullable) |
| thickness | int(10) unsigned (nullable) |
| volume | int(10) unsigned (nullable) |
| lighting | text (nullable) |
| filtration | text (nullable) |
| pumps | text (nullable) |
| interior | text (nullable) |
| animals_sessile | text (nullable) |
| animals_vagile | text (nullable) |
| notes | text (nullable) |
| video_link | varchar(191) (nullable) |
Test:
Analyses endpoint
Parameters (GET or POST, POST recommended for security):
| key | string with auth string per partner |
|---|---|
| token | string with auth string from user |
| aquarium_id | bigint(20) unsigned with key |
| startdate | optional date of first analysis, format: yyyy-mm-dd |
| enddate | optional date of last analysis, format: yyyy-mm-dd |
Output:
| id | bigint(20) unsigned (auto increment) |
|---|---|
| sample_id | string |
| created | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| updated | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| process_started | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss"; start of process for this sample (source: issued_tests.created_at) |
| water_type | tinyint(4) [default: 0] — 0: seawater, 1: osmosis water, 2: freshwater |
| owner_type | tinyint(4) [default: 0] — 0: FaunaMarin, 1: User, 2: External Lab |
| parent | bigint(20) (nullable) — main analysis result (osmosis water analysis if set) |
| ag | double(16,8) (nullable) — Silver |
| al | double(16,8) (nullable) — Aluminium |
| ar | double(16,8) (nullable) |
| as | double(16,8) (nullable) |
| b | double(16,8) (nullable) |
| ba | double(16,8) (nullable) |
| be | double(16,8) (nullable) |
| br | double(16,8) (nullable) |
| ca | double(16,8) (nullable) |
| cd | double(16,8) (nullable) |
| co | double(16,8) (nullable) |
| cr | double(16,8) (nullable) |
| cu | double(16,8) (nullable) |
| fe | double(16,8) (nullable) |
| hg | double(16,8) (nullable) |
| i | double(16,8) (nullable) — iodine in mg/l, e.g. 0.0055 |
| k | double(16,8) (nullable) |
| la | double(16,8) (nullable) |
| li | double(16,8) (nullable) |
| mg | double(16,8) (nullable) |
| mn | double(16,8) (nullable) |
| mo | double(16,8) (nullable) |
| na | double(16,8) (nullable) |
| ni | double(16,8) (nullable) |
| p | double(16,8) (nullable) |
| pb | double(16,8) (nullable) |
| rb | double(16,8) (nullable) |
| s | double(16,8) (nullable) |
| sb | double(16,8) (nullable) |
| sc | double(16,8) (nullable) |
| se | double(16,8) (nullable) |
| si | double(16,8) (nullable) |
| sn | double(16,8) (nullable) |
| sr | double(16,8) (nullable) |
| te | double(16,8) (nullable) |
| ti | double(16,8) (nullable) |
| tl | double(16,8) (nullable) |
| v | double(16,8) (nullable) |
| w | double(16,8) (nullable) |
| zn | double(16,8) (nullable) |
| zr | double(16,8) (nullable) |
| fluoride | double(16,8) (nullable) |
| chloride | double(16,8) (nullable) |
| bromide | double(16,8) (nullable) |
| nitrate | double(16,8) (nullable) |
| nitrite | double(16,8) (nullable) |
| sulfate | double(16,8) (nullable) |
| conductivity | double(16,8) (nullable) |
| pH | double(16,8) (nullable) |
| alkalinityMmol | double(16,8) (nullable) |
| alkalinityDkH | double(16,8) (nullable) |
| salinity | double(16,8) (nullable) |
| temperature | double(16,8) (nullable) |
| density | double(16,8) (nullable) |
| densityrel | double(16,8) (nullable) |
| po4g | double(16,8) (nullable) |
| po4er | double(16,8) (nullable) |
| smell | tinyint(1) [default: 0] |
| color | tinyint(1) [default: 0] |
| date | datetime (nullable) |
| type | smallint(6) [default: 0] — deprecated, legacy values: 1 = TotalReef, 2 = ReefFreeICP, 3 = OsmoseICP, 4 = Freshwater, 5 = PestID |
| note | text (nullable) |
| staff_id | bigint(20) unsigned (nullable) |
| aquarium_id | bigint(20) unsigned |
| co2 | double(16,8) (nullable) — calculated value |
| acid_binding_capacity | double(16,8) (nullable) — calculated value |
Test:
Latest analysis endpoint
Parameters (GET or POST, POST recommended for security):
| key | string with auth string per partner |
|---|---|
| token | string with auth string from user |
| aquarium_id | bigint(20) unsigned with key |
Output:
| id | bigint(20) unsigned (auto increment) |
|---|---|
| sample_id | string |
| created | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| updated | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss" |
| process_started | timestamp (nullable) — server time, format "YYYY-MM-DD hh:ii:ss"; start of process for this sample (source: issued_tests.created_at) |
| water_type | tinyint(4) [default: 0] — 0: seawater, 1: osmosis water, 2: freshwater |
| owner_type | tinyint(4) [default: 0] — 0: FaunaMarin, 1: User, 2: External Lab |
| parent | bigint(20) (nullable) — main analysis result (osmosis water analysis if set) |
| ag | double(16,8) (nullable) — Silver |
| al | double(16,8) (nullable) — Aluminium |
| ar | double(16,8) (nullable) |
| as | double(16,8) (nullable) |
| b | double(16,8) (nullable) |
| ba | double(16,8) (nullable) |
| be | double(16,8) (nullable) |
| br | double(16,8) (nullable) |
| ca | double(16,8) (nullable) |
| cd | double(16,8) (nullable) |
| co | double(16,8) (nullable) |
| cr | double(16,8) (nullable) |
| cu | double(16,8) (nullable) |
| fe | double(16,8) (nullable) |
| hg | double(16,8) (nullable) |
| i | double(16,8) (nullable) — iodine in mg/l, e.g. 0.0055 |
| k | double(16,8) (nullable) |
| la | double(16,8) (nullable) |
| li | double(16,8) (nullable) |
| mg | double(16,8) (nullable) |
| mn | double(16,8) (nullable) |
| mo | double(16,8) (nullable) |
| na | double(16,8) (nullable) |
| ni | double(16,8) (nullable) |
| p | double(16,8) (nullable) |
| pb | double(16,8) (nullable) |
| rb | double(16,8) (nullable) |
| s | double(16,8) (nullable) |
| sb | double(16,8) (nullable) |
| sc | double(16,8) (nullable) |
| se | double(16,8) (nullable) |
| si | double(16,8) (nullable) |
| sn | double(16,8) (nullable) |
| sr | double(16,8) (nullable) |
| te | double(16,8) (nullable) |
| ti | double(16,8) (nullable) |
| tl | double(16,8) (nullable) |
| v | double(16,8) (nullable) |
| w | double(16,8) (nullable) |
| zn | double(16,8) (nullable) |
| zr | double(16,8) (nullable) |
| fluoride | double(16,8) (nullable) |
| chloride | double(16,8) (nullable) |
| bromide | double(16,8) (nullable) |
| nitrate | double(16,8) (nullable) |
| nitrite | double(16,8) (nullable) |
| sulfate | double(16,8) (nullable) |
| conductivity | double(16,8) (nullable) |
| pH | double(16,8) (nullable) |
| alkalinityMmol | double(16,8) (nullable) |
| alkalinityDkH | double(16,8) (nullable) |
| salinity | double(16,8) (nullable) |
| temperature | double(16,8) (nullable) |
| density | double(16,8) (nullable) |
| densityrel | double(16,8) (nullable) |
| po4g | double(16,8) (nullable) |
| po4er | double(16,8) (nullable) |
| smell | tinyint(1) [default: 0] |
| color | tinyint(1) [default: 0] |
| date | datetime (nullable) |
| type | smallint(6) [default: 0] — deprecated, TotalReef = 1, ReefFreeICP = 2, OsmoseICP = 3, Freshwater = 4, PestID = 5 |
| note | text (nullable) |
| staff_id | bigint(20) unsigned (nullable) |
| aquarium_id | bigint(20) unsigned |
| co2 | double(16,8) (nullable) — calculated value |
| acid_binding_capacity | double(16,8) (nullable) — calculated value |
Test:
Register new sample
Parameters (GET or POST, POST recommended for security):
| key | required string with auth string per partner |
|---|---|
| token | required string with auth string from user |
| sample_id | required numeric string with 8 digits (last digit is a checksum), can only be used once |
| aquarium_id | required integer > 0 with aquarium id |
| advisor_id | optional integer > 0 with advisor id |
Output:
| id | bigint(20) unsigned (auto increment) | number of started process, NULL if error |
|---|---|---|
| status | smallint |
200 - ok 400 - bad request, check sample id 403 - forbidden, check key, token and aquarium_id 409 - conflict, sample_id already used 500 - internal error |
| message | string | descriptive text |
Test: