MT#15393 improve API documentation

Change-Id: I7c62a88b14fb24e0fa27b0712cdf6c7cc991b4db
changes/73/2773/2
Gerhard Jungwirth 11 years ago
parent fdfac50423
commit cfd2f784c2

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Sipwise NGCP HTTP API documentation</title>
<link rel="stylesheet" href="/css/ui-lightness/jquery-ui-1.10.3.custom.min.css"></link>

@ -24,7 +24,9 @@ With cURL, use <span>--user 'username:password'</span> option to specify your ac
curl -i -X GET --user 'myuser:mypassword' https://example.org:1443/api/
</code>
Additionally use the <span>--insecure</span> option if you are testing against a self-signed server certificate.
Additionally use the <span>--insecure</span> option if you are testing against a self-signed server certificate.<br/>
Read the Part <em>SSL Certificates</em> under the Chapter <em>Security and Maintenance</em> in the SPCE documentation
for more information about SSL Certificates.
</p>
<h5>Using Perl LWP::UserAgent</h5>

@ -112,7 +112,7 @@ Accept-Post: application/hal+json; profile="http://purl.org/sipwise/ngcp-api/#re
[% IF col.actions.grep('^GET$').size -%]
<h[% level + 2 %]>Request the entire <i>[% id %]</i> collection</h[% level + 2 %]>
<p>
<p></p>
<p>
You cannot request the entire collection at once, but instead you can simply page through the results. The response provides <i>prev</i> and <i>next</i> links you can follow to get the next page.
@ -179,7 +179,7 @@ Content-Type: application/hal+json; profile="http://purl.org/sipwise/ngcp-api/"
INCLUDE helpers/api_req_res.tt request=request response=response level=level+3;
-%]
</p>
<p></p>
[% END -%]
[% IF col.item_actions.grep('^GET$').size -%]
@ -281,7 +281,7 @@ Preference-Applied: return=minimal';
[% IF col.item_actions.grep('^PATCH$').size -%]
<h[% level + 2 %]>Update specific fields of an existing <i>[% id %]</i> item</h[% level + 2 %]>
<p>
<p></p>
[%
props = ''; rem = 0; rep = 0;
FOREACH p IN col.fields;
@ -398,7 +398,7 @@ Preference-Applied: return=minimal';
INCLUDE helpers/api_req_res.tt request=request response=response level=level+3;
-%]
</p>
<p></p>
[% END -%]
[% IF col.item_actions.grep('^DELETE$').size -%]

@ -77,15 +77,18 @@ Some collections define query paramters to filter the output. Typical use cases
Query parameters are appended to the URL like in the following example:
<code>
curl -X GET 'https://example.org:1443/api/somecollection/?param_one=1&amp;param2=something
curl -X GET 'https://example.org:1443/api/somecollection/?param_one=1&amp;param2=something'
</code>
Some query parameters allow wildcard/pattern matching, which is expressed by a '*' like this:
<code>
curl -X GET 'https://example.org:1443/api/somecollection/?param=*something*
curl -X GET 'https://example.org:1443/api/somecollection/?param=*something*'
</code>
<em>Note:</em> this examples do not yet contain authentication and will therefore not work on a standard installation. To read more
about that go to the Chapter <a href="#auth">Authentication</a>.
<h[% level + 1%]>HTTP Response Codes</h[% level + 1%]>
The REST API returns an HTTP response code with the following classes:

@ -3,12 +3,12 @@
[% IF extended -%]
<p>
Note that you <b>MUST</b> pass the following additional headers for this request:
You can pass the following additional headers for this request:
<ul>
<li><b>Prefer</b>
<p>This header tells the API which type of response the client expects. The following values are possible:
<ul>
<li><b>return=minimal</b> tells the API to respond with a <b>204 No Content</b> if the operation has been performed successfully, without returning the updated resource in the body.</li>
<li><b>return=minimal</b> (default) tells the API to respond with a <b>204 No Content</b> if the operation has been performed successfully, without returning the updated resource in the body.</li>
<li><b>return=representation</b> will let the API respond with <b>200 OK</b> with the full representation of the updated resource in the body.</li>
</ul>
</p>

Loading…
Cancel
Save