{% extends "layout.html" %} {% block page_title %}REST API v1 alpha{% endblock %} {% block head -%} {{ super() }} {%- endblock %} {% block script -%} {{ super() }} {%- endblock %} {% block body %}
The API lives at /api/v1/
. The format used is JSON.
Name | Value | Description |
---|---|---|
page |
int | Page number |
per_page |
int | Number of items per page |
range |
int,int | Range to return, in the format offset,value |
This resource returns an array of ISP objects.
When using pagination (default) :
{
"total_items": 3,
"page": 1,
"num_pages": 1,
"per_page": 10,
"isps": [
/* list of ISP objects */
]
}
When providing a range parameter :
{
"total_items": 3,
"range": "0,1",
"isps": [
/* list of ISP objects */
]
}
This resource can return the following status codes: 400
, 500
.
This resource returns an ISP object or an ObjectNotFound error.
This resource can return the following status codes: 404
, 400
, 500
.
Name | Value | Description |
---|---|---|
page |
int | Page number |
per_page |
int | Number of items per page |
range |
int,int | Range to return, in the format offset,value |
This resource returns an array of CoveredArea objects belonging to a given ISP. Note that the CoveredArea objects don't have an "isp" attribute since we assume the client will have retrieved informations about the ISP beforehand.
This resource can return the following status codes: 404
, 400
, 500
.
This resource returns a list of all ISP Format URLs in database.
This resource can return the following status codes: 500
.
Name | Value | Description |
---|---|---|
page |
int | Page number |
per_page |
int | Number of items per page |
range |
int,int | Range to return, in the format offset,value |
This resource returns an array of CoveredArea objects.
When using pagination (default) :
{
"total_items": 3,
"page": 1,
"num_pages": 1,
"per_page": 10,
"covered_areas": [
/* list of CoveredArea objects */
]
}
When providing a range parameter :
{
"total_items": 3,
"range": "0,1",
"covered_areas": [
/* list of CoveredArea objects */
]
}
This resource can return the following status codes: 404
, 400
, 500
.
This resource returns a CoveredArea object or an ObjectNotFound error.
This resource can return the following status codes: 404
, 400
, 500
.
{
"id": "int",
"is_ffdn_member": "bool",
"json_url": "string:url",
"date_added": "string:ISO8601 datetime",
"last_update": "string:ISO8601 datetime",
"ispformat": "object:ISP Format"
}
{
"id": "int",
"isp": {
"id": "int",
"name": "string",
"shortname": "string|null"
},
"name": "string",
"geojson": "object:GeoJSON"
}
A typical error response looks like this:
{
"error": {
"message": "There was an error while processing your request",
"error_type": "ispdb.api.InternalError"
}
}
Message is an informative message regarding the error, error_type is an optionnal field containing the error class, which can give machine-readable informations about the error.
For now, the following error class are defined:
Error class | Status code | Description |
---|---|---|
ispdb.api.ObjectNotFound |
404 | Could not find the item matching the criterias you specified |
ispdb.api.BadInput |
400 | Invalid input |
ispdb.api.InternalError |
500 | Internal server error |