-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapi.php
87 lines (68 loc) · 1.25 KB
/
api.php
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<div class="hero bg-base-200">
<div class="hero-content text-center">
<div class="max-w-lg">
<h1 class="text-5xl font-bold">API</h1>
</div>
</div>
</div>
<div class="container mx-auto min-h-screen">
<section class="pb-2">
<h2 class="h1">/api/autocomplete</h2>
<p>This end-point is designed to be compatible with jQuery Autocomplete</p>
<pre><code>GET /api/autocomplete?q=TERM</code></pre>
<pre><code>GET /api/autocomplete?term=TERM</code></pre>
<pre><code>[
{
"code": "",
"stub": "",
"label": "Strain A",
"value": "Strain A",
},
{
"code": "",
"stub": "",
"label": "Strain B",
"value": "Strain B",
},
]</code></pre>
</section>
<section class="pb-2">
<h2 class="h1">/api/search</h2>
<p>This end-point is for getting a response in the OpenTHC JSON schema.</p>
<pre><code>GET /api/search?q=TERM
[
{
"id": "",
"code": "",
"stub": "",
"name": "Strain A",
},
{
"id": "",
"code": "",
"stub": "",
"name": "Strain B",
}
]</code></pre>
</section>
<h2>Create a Strain</h2>
<pre>
POST /api/create
>>>>
{
"name": "Strain C",
"type": "",
}
####
</pre>
<h2>Update a Strain</h2>
<pre>
POST /api/update/S123.D
>>>>
{
"name": "Strain D",
"type": "",
}
####
</pre>
</div>