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

/api/v2/get_user

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)
email 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:

Key:

Token:




Aquariums endpoint

/api/v2/get_aquariums

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:

Key:

Token:




Analyses endpoint

/api/v2/get_analyses

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)
agdouble(16,8) (nullable) — Silver
aldouble(16,8) (nullable) — Aluminium
ardouble(16,8) (nullable)
asdouble(16,8) (nullable)
bdouble(16,8) (nullable)
badouble(16,8) (nullable)
bedouble(16,8) (nullable)
brdouble(16,8) (nullable)
cadouble(16,8) (nullable)
cddouble(16,8) (nullable)
codouble(16,8) (nullable)
crdouble(16,8) (nullable)
cudouble(16,8) (nullable)
fedouble(16,8) (nullable)
hgdouble(16,8) (nullable)
idouble(16,8) (nullable) — iodine in mg/l, e.g. 0.0055
kdouble(16,8) (nullable)
ladouble(16,8) (nullable)
lidouble(16,8) (nullable)
mgdouble(16,8) (nullable)
mndouble(16,8) (nullable)
modouble(16,8) (nullable)
nadouble(16,8) (nullable)
nidouble(16,8) (nullable)
pdouble(16,8) (nullable)
pbdouble(16,8) (nullable)
rbdouble(16,8) (nullable)
sdouble(16,8) (nullable)
sbdouble(16,8) (nullable)
scdouble(16,8) (nullable)
sedouble(16,8) (nullable)
sidouble(16,8) (nullable)
sndouble(16,8) (nullable)
srdouble(16,8) (nullable)
tedouble(16,8) (nullable)
tidouble(16,8) (nullable)
tldouble(16,8) (nullable)
vdouble(16,8) (nullable)
wdouble(16,8) (nullable)
zndouble(16,8) (nullable)
zrdouble(16,8) (nullable)
fluoridedouble(16,8) (nullable)
chloridedouble(16,8) (nullable)
bromidedouble(16,8) (nullable)
nitratedouble(16,8) (nullable)
nitritedouble(16,8) (nullable)
sulfatedouble(16,8) (nullable)
conductivitydouble(16,8) (nullable)
pHdouble(16,8) (nullable)
alkalinityMmoldouble(16,8) (nullable)
alkalinityDkHdouble(16,8) (nullable)
salinitydouble(16,8) (nullable)
temperaturedouble(16,8) (nullable)
densitydouble(16,8) (nullable)
densityreldouble(16,8) (nullable)
po4gdouble(16,8) (nullable)
po4erdouble(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:

Key:

Token:

Aquarium ID:

Startdate:

Stopdate:






Latest analysis endpoint

/api/v2/get_latest_analysis

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)
agdouble(16,8) (nullable) — Silver
aldouble(16,8) (nullable) — Aluminium
ardouble(16,8) (nullable)
asdouble(16,8) (nullable)
bdouble(16,8) (nullable)
badouble(16,8) (nullable)
bedouble(16,8) (nullable)
brdouble(16,8) (nullable)
cadouble(16,8) (nullable)
cddouble(16,8) (nullable)
codouble(16,8) (nullable)
crdouble(16,8) (nullable)
cudouble(16,8) (nullable)
fedouble(16,8) (nullable)
hgdouble(16,8) (nullable)
idouble(16,8) (nullable) — iodine in mg/l, e.g. 0.0055
kdouble(16,8) (nullable)
ladouble(16,8) (nullable)
lidouble(16,8) (nullable)
mgdouble(16,8) (nullable)
mndouble(16,8) (nullable)
modouble(16,8) (nullable)
nadouble(16,8) (nullable)
nidouble(16,8) (nullable)
pdouble(16,8) (nullable)
pbdouble(16,8) (nullable)
rbdouble(16,8) (nullable)
sdouble(16,8) (nullable)
sbdouble(16,8) (nullable)
scdouble(16,8) (nullable)
sedouble(16,8) (nullable)
sidouble(16,8) (nullable)
sndouble(16,8) (nullable)
srdouble(16,8) (nullable)
tedouble(16,8) (nullable)
tidouble(16,8) (nullable)
tldouble(16,8) (nullable)
vdouble(16,8) (nullable)
wdouble(16,8) (nullable)
zndouble(16,8) (nullable)
zrdouble(16,8) (nullable)
fluoridedouble(16,8) (nullable)
chloridedouble(16,8) (nullable)
bromidedouble(16,8) (nullable)
nitratedouble(16,8) (nullable)
nitritedouble(16,8) (nullable)
sulfatedouble(16,8) (nullable)
conductivitydouble(16,8) (nullable)
pHdouble(16,8) (nullable)
alkalinityMmoldouble(16,8) (nullable)
alkalinityDkHdouble(16,8) (nullable)
salinitydouble(16,8) (nullable)
temperaturedouble(16,8) (nullable)
densitydouble(16,8) (nullable)
densityreldouble(16,8) (nullable)
po4gdouble(16,8) (nullable)
po4erdouble(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:

Key:

Token:

Aquarium ID:






Register new sample

/api/v2/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:

Key:

Token:
Sample ID:

Aquarium ID:

Advisor ID:





↑