-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapi.html
119 lines (105 loc) · 2.98 KB
/
api.html
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
layout: api
title: API
byline: Offisiellt REST API for Nasjonal Turbase
class: api
---
<p>Denne siden beskriver resursene som til sammen bygger opp det offisielle APIet
for Nasjonal Turbase v1-beta. Hvis du her noen problemer eller andre
forespørsler ikke nøl med å ta kontakt.</p>
<h2>API-miljøer</h2>
<p>Nasjonal Turbase har to API-miljøer <code>api</code> or <code>dev</code>.
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Miljø</th>
<th>Hostname</th>
<th>Beskrivelse</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>api</code></td>
<td>api.nasjonalturbase.no</td>
<td>Produksjonsmiljø - brukes mot sluttbrukere</td>
</tr>
<tr>
<td><code>dev</code></td>
<td>dev.nasjonalturbase.no</td>
<td>Utviklingsmiljø - brukes under utvikling</td>
</tr>
</body>
</table>
</div>
<h2>Oversikt</h2>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Resurs</th>
<th>POST</th>
<th>GET</th>
<th>PUT</th>
<th>PATCH</th>
<th>DELETE</th>
</tr>
</thead>
<tbody>
<tr>
<td>/objekttyper</td>
<td></td>
<td class="success">Hent typer</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>/{type}</td>
<td class="success">Nytt objekt</td>
<td class="success">Hent liste</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>/{type}/{id}</td>
<td></td>
<td class="success">Hent objekt</td>
<td class="success">Oppdater objekt</td>
<td class="success">Oppdater objekt</td>
<td class="success">Slett objekt</td>
</tr>
</body>
</table>
</div>
{% for api in site.data.api %}
<h2 class="title" id="{{ api.anchor }}">
<a class="anchor" href="#{{ api.anchor }}">#</a>
{{ api.title }}
</h2>
{% if api.desc %}<p class="desc">{{ api.desc }}</p>{% endif %}
{% if api.resource %}
<pre class="resource"><code class="http">{{ api.resource }}</code></pre>
{% endif %}
{% if api.params %}<h3 class="params">Parametere</h3><dl>{% endif %}
{% for param in api.params %}
<dt>{{ param.name }}</dt>
<dd>
<em>{{ param.requ }}</em>
<strong>{{ param.type }}</strong>
{% if param.desc %} - {{ param.desc }}{% endif %}
</dd>
{% endfor %}
{% if api.params %}</dl>{% endif %}
{% if api.request %}
<h3 class="example">Forespørsel</h3>
<pre class="headers"><code class="http">{{ api.request.headers }}</code></pre>
<pre class="highlight"><code class="json">{{ api.request.payload }}</code></pre>
{% endif %}
{% if api.response %}
<h3 class="response">Respons</h3>
<pre class="headers"><code class="http">{{ api.response }}</code></pre>
<pre class="highlight"><code class="json">{{ api.data }}</code></pre>
{% endif %}
{% endfor %}