Examples of use
The `http` command line tool that is used to execute the following sample calls is downloadable at: https://httpie.org/
Due to historical reasons, the measurements have been technically referrred to as 'Batches' in the actual Oculyze Platform API .
The Bearer token that must accompany the calls to the API must be obtained through a authentication endpoint. Please get in touch with our Engineering Team regarding a valid access credential.
Due to historical reasons, the measurements have been technically referrred to as 'Batches' in the actual Oculyze Platform API .
The Bearer token that must accompany the calls to the API must be obtained through a authentication endpoint. Please get in touch with our Engineering Team regarding a valid access credential.
Calls for Creating and Modifying a Batches (Measurements) ;
Create a Batch
http -f --auth Bearer:r5o7RIcqDwAhkZBHDcKpHR7gSbx1cv POST https://srv.oculyze.de/services/handler/v1/batches method=2 name='wort' desc=test app_version=13.0.2 method_attributes='{"stain": 1, "analysis_level": 2}'
Add Task with image
http -v -f --auth Bearer:r5o7RIcqDwAhkZBHDcKpHR7gSbx1cv PUT https://srv.oculyze.de/services/handler/v1/batches/5b3f8f68477b490017efbb45/tasks image@/path/to/image.jpg
Update batch values and state to trigger aggregation on backend
http -f --auth Bearer:r5o7RIcqDwAhkZBHDcKpHR7gSbx1cv PUT https://srv.oculyze.de/services/handler/v1/batches/5b3f8f68477b490017efbb45 state=1 dilution_sample=1 dilution_sample_1=1 dilution_sample_2=1 dilution_stain=1 dilution_stain_1=1 dilution_stain_2=1 image_volume=5.600000000000001e-06
Querying Batches
To get a page of existing batches, with results;
To get a page of existing batches, with results;
~ ❯❯❯ http --auth Bearer:9uTl8EVWJ1UVNqeyTh7HuuFGsAigMz GET https://srv.oculyze.de/services/handler/v1/batches\?page_size\=1
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1681
Content-Type: application/json
Date: Fri, 24 Aug 2020 10:11:51 GMT
Server: nginx
[
{
"created_at": "Sun, 12 Aug 2020 17:37:50 GMT",
"desc": "",
"dilution_sample": 1.0,
"dilution_stain": 0.8,
"id": "58a09d6eacf4fd001c85655a",
"method": 2,
"modified_at": "Sun, 12 Aug 2020 17:38:24 GMT",
"name": "",
"result_stat": {
"area": {
"hist": [
[
1,
3,
2,
0,
1,
2,
0,
2,
1,
3
],
[
1796.0,
2566.8,
3337.6,
4108.4,
4879.2,
5650.0,
6420.799999999999,
7191.599999999999,
7962.4,
8733.2,
9504.0
]
],
"mean": 5754.8,
"std": 2663.0071272904997
},
"conz": 1.0714285714285714,
"countTotal": {
"hist": [
[
0,
0,
0,
0,
0,
1,
0,
0,
0,
0
],
[
14.5,
14.6,
14.7,
14.8,
14.9,
15.0,
15.1,
15.2,
15.3,
15.4,
15.5
]
],
"mean": 15.0,
"std": 0.0
},
"meanDia": {
"hist": [
[
1,
2,
1,
2,
0,
1,
2,
1,
0,
5
],
[
48.0,
54.6,
61.2,
67.8,
74.4,
81.0,
87.6,
94.19999999999999,
100.8,
107.4,
114.0
]
],
"mean": 85.66666666666667,
"std": 21.89266746855871
}
},
"state": 2,
"tasks": [
{
"id": "58a09d7facf4fd001b62c288",
"result_stat": {
"area": [
7583,
9504,
8617
],
"circPct": [
59,
86,
76
],
"countTotal": 3,
"meanDia": [
111,
110,
108
]
},
"state": 2
},
{
"id": "58a09d83acf4fd001c85655c",
"result_stat": {
"area": [],
"circPct": [],
"countTotal": 0,
"meanDia": []
},
"state": 2
},
{
"id": "58a09d88acf4fd001b62c291",
"result_stat": {
"area": [
2692,
3039,
3340,
6253
],
"circPct": [
71,
76,
65,
87
],
"countTotal": 4,
"meanDia": [
61,
64,
70,
89
]
},
"state": 2
},
{
"id": "58a09d8eacf4fd001c85656a",
"result_stat": {
"area": [
1796,
6141,
3415,
5358,
8811,
2621
],
"circPct": [
84,
82,
66,
84,
62,
88
],
"countTotal": 6,
"meanDia": [
48,
89,
70,
84,
114,
57
]
},
"state": 2
},
{
"id": "58a09d92acf4fd001aa0409c",
"result_stat": {
"area": [
9417,
7735
],
"circPct": [
83,
89
],
"countTotal": 2,
"meanDia": [
111,
99
]
},
"state": 2
}
],
"user": "56bdbe17231388031fc1e382"
}
]
To get an already existing batch by the BatchID
http --auth Bearer:9uTl8EVWJ1UVNqeyTh7HuuFGsAigMz GET https://srv.oculyze.de/services/handler/v1/batches/58a09d6eacf4fd001c85655a
Filtering Results
to filter batches based on batch creation dates
to filter batches based on batch creation dates
~ ❯❯❯ curl -u Bearer:<access_token> https://srv.oculyze.de/services/handler/v1/batches\?st_date_creation=20170301\&end_date_creation=20170331 | jq '.[] | {id: .id, created_at: .created_at}'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4524 100 4524 0 0 29821 0 --:--:-- --:--:-- --:--:-- 29960
{
"id": "58d905a2acf4fd001a1bc02e",
"created_at": "Mon, 27 Mar 2017 12:29:22 GMT"
}
{
"id": "58cfc7f2191926006f22dbd0",
"created_at": "Mon, 20 Mar 2017 12:15:46 GMT"
}
to obtain the count only (for the previous query)
~ ❯❯❯ curl -u Bearer:<access_token> https://srv.oculyze.de/services/handler/v1/batches\?st_date_creation=20170301\&end_date_creation=20170331\&count=True
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13 100 13 0 0 29821 0 --:--:-- --:--:-- --:--:-- 29960
{ 'count': 2}