Statistics
| Branch: | Tag: | Revision:

root / djnro / templates / front / api.html @ d3ea44a4

History | View | Annotate | Download (2.4 kB)

1
{% extends "base.html" %}
2
{% load i18n %}
3
    {% block currentpagetitle %}{% trans "Closest Point API" %}{% endblock %}
4
    {% block homepage %}{% endblock %}
5
    {% block hometop %}{% endblock %}
6
    {% block api %}class="active"{% endblock %}
7

    
8

    
9
                {% block subcontent %}
10
                        <h4>{% trans "Closest point API" %}</h4>
11
                        <hr>
12
                        <div class="span6">
13
                                <p>{% blocktrans %}Since we collect information from eduroam.org about the available eduroam points, we developed the closest point service API, which handles locating the closest eduroam service location.{% endblocktrans %}</p>
14
                                <p>{% blocktrans %}The API receives the current location coordinates in a GET request, calculates the closest point through server-side triangulation and returns a JSON reply with its’ coordinates and a detailed description.{% endblocktrans %}</p>
15
                                <h5>Applications</h5>
16
                                <p>{% blocktrans %}Based on this API, we developed the closest point web page that allows users to find the closest eduroam location or a location they search for.{% endblocktrans %}</p>
17
                                <p>{% blocktrans %}Potentials are limitless! You can build your own application either it is web or mobile or a widget for a wearable device.{% endblocktrans %}</p>
18
                                <h5>API</h5>
19
                                <div class="well">
20
                                        <strong>url: https://{{site}}{% url closest %}?lat=latitude&lng=longitude</strong><br>
21
                                        <strong>method: GET</strong><br><br>
22
                                        <strong>lat:</strong>Latitude coordinate, eg. 37.98101<br>
23
                                        <strong>lng:</strong>Longitude coordinate, eg. 23.728695
24
                                </div>
25
                                        <strong>Example request: </strong>
26
                                        <div class="well">
27
                                                Find the closest eduroam point to my position, eg. coords(37.98, 23.72): <br><strong>https://{{site}}{% url closest %}?lat=37.98&lng=23.72</strong>
28
                                        </div>
29
                                        <strong>Example response:</strong>                                
30
<pre>{
31
"lat": "37.972883",
32
"lng": "23.717463",
33
"text": "\n &lt;b&gt;Name:&lt;/b&gt; National Observatory, Athens, Greece&lt;br&gt;&lt;b&gt;Address:&lt;/b&gt; Athens, 118 51&lt;br&gt;&lt;b&gt;SSID:&lt;/b&gt; EDUROAM&lt;br&gt;&lt;b&gt;Enc:&lt;/b&gt; WPA2/AES&lt;br&gt;&lt;b&gt;AP:&lt;/b&gt; 1&lt;br&gt; \n ",
34
"name": "\n &lt;b&gt;Name:&lt;/b&gt; National Observatory, Athens, Greece&lt;br&gt;&lt;b&gt;Address:&lt;/b&gt; Athens, 118 51&lt;br&gt;&lt;b&gt;SSID:&lt;/b&gt; EDUROAM&lt;br&gt;&lt;b&gt;Enc:&lt;/b&gt; WPA2/AES&lt;br&gt;&lt;b&gt;AP:&lt;/b&gt; 1&lt;br&gt; \n "
35
"plainname": "National Observatory of Athens ",
36
}
37
</pre>
38

    
39
                                
40
                        </div>
41
                {% endblock %}