commit
stringlengths 40
40
| old_file
stringlengths 2
205
| new_file
stringlengths 2
205
| old_contents
stringlengths 0
32.9k
| new_contents
stringlengths 1
38.9k
| subject
stringlengths 3
9.4k
| message
stringlengths 6
9.84k
| lang
stringlengths 3
13
| license
stringclasses 13
values | repos
stringlengths 6
115k
|
---|---|---|---|---|---|---|---|---|---|
11eab020a08bf755064f9121af626843d8d80d62
|
STATION-METADATA-API-BLUEPRINT.apib
|
STATION-METADATA-API-BLUEPRINT.apib
|
FORMAT: 1A
Station Metadata API
=============================
# General information
This Service exists to provide the canonical API for querying and returning MeteoGroup stations and their capabilities.
The output response with requested stations is always in GEOJson format.
## Requesting the Data
The GEOJson information about stations might be requested either by bounding box or by polygon.
## Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `station-metadata`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/refactor-2-guideline/authorization/Authentication.md)
### Cache control headers:
if data unchanged since this date using the If-Modified-Since request header
the server will return with an empty body with the 304 response code. Ex:
+ Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ If-Modified-Since: Thu, 13 Jul 2017 10:55:53 GMT
### Querying MeteoGroup stations data
Here is the information about all supported HTTP request parameters and HTTP Headers:
+ Headers
+ Authorization: Bearer {ENCRYPTED TOKEN HERE}
+ If-Modified-Since: {DATE}
+ Parameters
+ locatedWithin:
- {"type":"bbox","coordinates":[[lon,lat],[lon,lat]]} (string, optional) - top left and bottom right coordinates that construct bounding box;
- {"type":"polygon","coordinates":[[[-10,10],[10,5],[-5,-5],[-10,10]],[[-5,5],[0,5],[0,0],[-5,5]]]} - polygon coordinates.
- {"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]} - An array of separate polygons.
- First polygons array describes polygon and another describe holes in it.
- **lon** in degree numeric format and in range <-180,180> eg. -123.454, 179.864
- **lat** in degree numeric format and in range <-90,90> eg. -85.541, 5.32,
+ accessVisibility: `public` (string, optional) - station access visibility, valid values is `public` and `private`
+ provider: `WMO,MG` (string, optional) - currently filter by provider or providers. All possible providers are described in section: **Get all providers**
+ type: `SKI_RESORT` (string, optional) - currently filter by type. All possible types are described in section: **Get all station types**
+ hasForecastData: `false` (boolean, optional) - station has forecast data.
+ hasObservationData: `true` (boolean, optional) - station has observation data.
+ countryIsoCode: `GB` (string, optional) - station located in this country. ISO Code refers to the [ISO 3166 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166)
The API supports various combinations for querying stations data by bounding box, polygon, multi-polygon, by provider and type, by stations that produce forecast and observation data.
Here are a couple of examples how to query by provider and type, bounding box and polygon.
#### Querying by provider and type
Query example:
```
GET /stations?accessVisibility=public&provider=WMO&hasForecastData=true&hasObservationData=false&countryIsoCode=UA
```
+ Response 200 (application/json)
+ Headers
Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ Body
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"icaoCode": "ENAS",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1004,
"name": "Ny-Alesund II",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
11.9222,
78.9233,
16
]
}
},
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1005,
"name": "Isfjord Radio",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
13.6333,
78.0667,
5
]
}
}
]
}
```
#### Querying by bounding box
Query example for getting stations by bounding box: ```locatedWithin={"type":"bbox","coordinates":[[-10,80],[10,5]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22bbox%22%2C%22coordinates%22%3A%5B%5B-10%2C80%5D%2C%5B10%2C5%5D%5D%7D
```
If the station data are queried by bounding box, its important to set up the correct **locatedWithin** parameter: **"type":"box", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
The response body is the same as for querying stations by provider and type.
#### Querying by polygon
Query example for getting stations by polygon: ```locatedWithin={"type":"polygon","coordinates":[[[-0.16,51.70],[-0.43,51.29],[0.18,51.30],[-0.16,51.70]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22polygon%22%2C%22coordinates%22%3A%5B%5B%5B-0.16%2C51.70%5D%2C%5B-0.43%2C51.29%5D%2C%5B0.18%2C51.30%5D%2C%5B-0.16%2C51.70%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Querying by multi-polygon
Query example for getting stations by multi-polygon: ```locatedWithin={"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22multipolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B102.0%2C2.0%5D%2C%5B103.0%2C2.0%5D%2C%5B103.0%2C3.0%5D%2C%5B102.0%2C3.0%5D%2C%5B102.0%2C2.0%5D%5D%5D%2C%5B%5B%5B100.0%2C0.0%5D%2C%5B101.0%2C0.0%5D%2C%5B101.0%2C1.0%5D%2C%5B100.0%2C1.0%5D%2C%5B100.0%2C0.0%5D%5D%2C%5B%5B100.2%2C0.2%5D%2C%5B100.8%2C0.2%5D%2C%5B100.8%2C0.8%5D%2C%5B100.2%2C0.8%5D%2C%5B100.2%2C0.2%5D%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Get all station types
Query example:
```
GET /stations/types
```
Returns a list containing all current known station types. This list can be extended in the future.
#### Get all providers
Query example:
```
GET /stations/providers
```
Returns a list containing all current known data providers. This list can be extended in the future.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. If you do not, you will receive **empty** response with status code **400 Bad Request**.
|
FORMAT: 1A
Station Metadata API
=============================
# General information
This Service exists to provide the canonical API for querying and returning MeteoGroup stations and their capabilities.
The output response with requested stations is always in GEOJson format.
## Requesting the Data
The GEOJson information about stations might be requested either by bounding box or by polygon.
## Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `station-metadata`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/master/authorization/Authentication.md)
### Querying MeteoGroup stations data
Here is the information about all supported HTTP request parameters and HTTP Headers:
+ Headers
+ Authorization: Bearer {ENCRYPTED TOKEN HERE}
+ If-Modified-Since: {DATE}
+ Parameters
+ locatedWithin:
- {"type":"bbox","coordinates":[[lon,lat],[lon,lat]]} (string, optional) - top left and bottom right coordinates that construct bounding box
- {"type":"polygon","coordinates":[[[-10,10],[10,5],[-5,-5],[-10,10]],[[-5,5],[0,5],[0,0],[-5,5]]]} - polygon coordinates; same as in [GeoJSON Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6)
- {"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]} - a multi-polygon, as in [GeoJSON MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7)
+ accessVisibility: `public` (string, optional) - station access visibility, valid values is `public` and `private`
+ provider: `WMO,MG` (string, optional) - currently filter by provider or providers. All possible providers are described in section: **Get all providers**
+ type: `SKI_RESORT` (string, optional) - currently filter by type. All possible types are described in section: **Get all station types**
+ hasForecastData: `false` (boolean, optional) - station has forecast data.
+ hasObservationData: `true` (boolean, optional) - station has observation data.
+ countryIsoCode: `GB` (string, optional) - station located in this country. ISO Code refers to the [ISO 3166 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166)
The API supports various combinations for querying stations data by area/region (bounding box, polygon, multi-polygon), by provider or type,
by stations where MeteoGroup produces forecast or has observation data available.
Here are a couple of examples how to query by provider and type, bounding box and polygon.
#### Querying by provider or type
Query example:
```
GET /stations?accessVisibility=public&provider=WMO&hasForecastData=true&hasObservationData=false&countryIsoCode=UA
```
+ Response 200 (application/json)
+ Headers
Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ Body
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"icaoCode": "ENAS",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1004,
"name": "Ny-Alesund II",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
11.9222,
78.9233,
16
]
}
},
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1005,
"name": "Isfjord Radio",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
13.6333,
78.0667,
5
]
}
}
]
}
```
### Queries by area or region (bounding box, polygone or multipolygone)
When querying stations within a region queries have to formated, like geometries in [GeoJSON](https://tools.ietf.org/html/rfc7946).
See the following examples.
#### Querying by bounding box
Query example for getting stations by bounding box: ```locatedWithin={"type":"bbox","coordinates":[[-10,80],[10,5]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22bbox%22%2C%22coordinates%22%3A%5B%5B-10%2C80%5D%2C%5B10%2C5%5D%5D%7D
```
If the station data are queried by bounding box, its important to set up the correct **locatedWithin** parameter: **"type":"box", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
The response body is the same as for querying stations by provider and type.
#### Querying by polygon
Query example for getting stations by polygon: ```locatedWithin={"type":"polygon","coordinates":[[[-0.16,51.70],[-0.43,51.29],[0.18,51.30],[-0.16,51.70]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22polygon%22%2C%22coordinates%22%3A%5B%5B%5B-0.16%2C51.70%5D%2C%5B-0.43%2C51.29%5D%2C%5B0.18%2C51.30%5D%2C%5B-0.16%2C51.70%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Querying by multi-polygon
Query example for getting stations by multi-polygon: ```locatedWithin={"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22multipolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B102.0%2C2.0%5D%2C%5B103.0%2C2.0%5D%2C%5B103.0%2C3.0%5D%2C%5B102.0%2C3.0%5D%2C%5B102.0%2C2.0%5D%5D%5D%2C%5B%5B%5B100.0%2C0.0%5D%2C%5B101.0%2C0.0%5D%2C%5B101.0%2C1.0%5D%2C%5B100.0%2C1.0%5D%2C%5B100.0%2C0.0%5D%5D%2C%5B%5B100.2%2C0.2%5D%2C%5B100.8%2C0.2%5D%2C%5B100.8%2C0.8%5D%2C%5B100.2%2C0.8%5D%2C%5B100.2%2C0.2%5D%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**:
The ```locatedWithin``` parameter has to be encoded before putting it to the request.
There are free online URL encoder available, for rapid manual testing: e.g. http://www.url-encode-decode.com/
If the query value is not proper encoded, you will receive an empty response with status code ```400 Bad Request```.
#### Get all station types
Query example:
```
GET /stations/types
```
Returns a list containing all current known station types. This list can be extended in the future.
#### Get all providers
Query example:
```
GET /stations/providers
```
Returns a list containing all current known data providers. This list can be extended in the future.
### Cache control headers:
The service offer regular HTTP caching hints in the reponse header.
All clients are requested to follow good API citizen guidelines and respect these cache information.
Example: f data unchanged since this date using the If-Modified-Since request header
the server will return with an empty body with the 304 response code. Ex:
+ Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ If-Modified-Since: Thu, 13 Jul 2017 10:55:53 GMT
|
revise wording
|
revise wording
|
API Blueprint
|
apache-2.0
|
MeteoGroup/weather-api,MeteoGroup/weather-api
|
e795144b082695e75102b6c00a1f2776b445db70
|
apiary.apib
|
apiary.apib
|
HOST: http://dcp.jboss.org/v1
--- Distributed Contribution Platform API v1 ---
---
# Overview
**Distributed Contribution Platform** provides **Rest API** for data manipulation and search.
# DCP Content object
This is main content object which can be pushed/retrieved or searched.
DCP Content object is JSON document with free structure. There is no restriction how many key value pairs must be defined or in which structure.
However this document is during push to DCP and reindex normalized and internal DCP data are added. Those data are prefixed by dcp_.
DCP Content described by example:
{
Free JSON Structure repsesenting content. Can be one key value pair or something more structured.
It's defined only by source provider.
"tags": ["Content tag1", "tag2", "tag2"],
"dcp_content_id": "Any value from content provider",
"dcp_content_typev: "Source provider type like 'issue'"
"dcp_content_provider": "Name of content provider like JIRA River"
"dcp_id": "internal_id"
"dcp_title": "Content Title"
"dcp_url_view": "URL representing content view"
"dcp_description": "Short description used by search GUI"
"dcp_type": "Normalized internal type of content"
"dcp_updated": "Timestamp of last update"
"dcp_project": "Normalized internal project"
"dcp_contributors": ["Firstname Lastname <e-mail>", "Firstname Lastname <e-mail>"]
"dcp_activity_dates": [Timestamp1, Timestamp2]
"dcp_tags": ["Tags constructed from 'tags' tag and user tags from persistance storage"]
}
All DCP Internal data are set during push and reindex except these which can be defined during data push:
* `dcp_title`
* `dcp_url_view`
* `dcp_description`
---
--
Authentication
Distinct operations needs to be authenticated. Content provider provides credintials by URL parameters provider and password or via standard HTTP Basic authentication.
If authentication is not successfull then standard forbidden http code is returned.
--
--
Content
--
Return Document JSON data
GET /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
All content for specified type.
GET /rest/content/{type}
< 200
< Content-Type: application/json
{
"total": "count of returned values",
"hits": [
{
"id": "internal dcp id of document"
"data": "document content"
}
]
}
JSON document in http body which is pushed to DCP.
Http body empty
POST /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
Document deleted
DELETE /rest/content/{type}/{id}
< 200
--
Search
--
Search contributions.
GET /rest/search?TODO
< 200
{ "foo": "bar" }
--
Suggestions
--
Get suggestions for user query.
Returned JSON contains two parts:
- `view`
- `model`
#### view
The `view` represents the visual part of query suggestions.
It *always* contains section `search` which will *always* have only one option matching incoming user query.
It can then contain one or more additional sections (like `suggestions`, `filters`, `mails`, ... etc.).
#### model
The `model` represents possible "actions" that are relevant to individual `option`s in the `view` part.
This means both `view` and `model` parts have the same highlevel structure and each `option`
in the `view` part have corresponding "action" in the `model` part.
Individual actions are described using symbolic commands. Interpretation of these commands is up to the client
the following is just a recommendation about how client can interpret the commands:
##### Commands:
`search` - execute search for `query` value.
`suggestion` - replace text in the search field with the `value`'s value.
`filter` - replace current filters with provided filters.
`filter_add` - enable provided filters (on top of currently active filters).
... more TDB.
To allow CORS we need to response to `OPTIONS` requests (for more see: <http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0>). We allow `GET` requests only.
OPTIONS /rest/suggestions/query_string
< 200
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET
GET /rest/suggestions/query_string?q={user_query_string}
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["${query_string}"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"option #1",
"option #2",
"..."
]
},
"filters": {
"caption": "Filters",
"options": [
"option #1",
"option #2",
"..."
]
},
"mails": {
"caption": "Mails",
"options": [
"option #1",
"option #2",
"..."
]
}
},
"model" : {
"search": {
"search": { "query": "${query_string}" }
},
"suggestions" : [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"filters": [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"mails": [
{ "action #1": {} },
{ "action #2": {} },
{ }
]
}
}
Example for user query 'Hiberna'.
GET /rest/suggestions/query_string?q=Hiberna
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["Hiberna"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"<strong>Hiberna</strong>te",
"<strong>Hiberna</strong>te query",
"<strong>Hiberna</strong>te session"
]
},
"filters": {
"caption": "Filters",
"options": [
"<strong>Add</strong> project filter for <strong>Hibernate</strong>",
"<strong>Add</strong> project filter for <strong>Infinispan</strong>",
"<strong>Search</strong> project <strong>Hibernate</strong> only"
]
},
"mails": {
"caption": "Mails",
"options": [
"<strong>Add</strong> some Mails filter",
"Do some other fancy thing here",
"Or do something else"
]
}
},
"model" : {
"search": { "search": { "query": "Hiberna" } },
"suggestions" : [
{ "suggestion": { "value": "Hibernate" }, "search": { "query": "Hibernate" } },
{ "suggestion": { "value": "Hibernate query" }, "search": { "query": "Hibernate query" } },
{ "suggestion": { "value": "Hibernate session" }, "search": { "query": "Hibernate session" } }
],
"filters": [
{ "filter_add": [ "Hibernate" ] },
{ "filter_add": [ "Infinispan" ] },
{ "filter": [ "Hibernate" ] }
],
"mails": [
{ "filter_add": [ "foo" ] },
{},
{}
]
}
}
|
HOST: http://dcp.jboss.org/v1
--- Distributed Contribution Platform API v1 ---
---
# Overview
**Distributed Contribution Platform** provides **Rest API** for data manipulation and search.
# DCP Content object
This is main content object which can be pushed/retrieved or searched.
DCP Content object is JSON document with free structure. There is no restriction how many key value pairs must be defined or in which structure.
However this document is during push to DCP and reindex normalized and internal DCP data are added. Those data are prefixed by dcp_.
DCP Content described by example:
{
Free JSON Structure repsesenting content. Can be one key value pair or something more structured.
It's defined only by source provider.
"tags": ["Content tag1", "tag2", "tag2"],
"dcp_content_id": "Any value from content provider",
"dcp_content_typev: "Source provider type like 'issue'"
"dcp_content_provider": "Name of content provider like JIRA River"
"dcp_id": "internal_id"
"dcp_title": "Content Title"
"dcp_url_view": "URL representing content view"
"dcp_description": "Short description used by search GUI"
"dcp_type": "Normalized internal type of content"
"dcp_updated": "Timestamp of last update"
"dcp_project": "Normalized internal project"
"dcp_contributors": ["Firstname Lastname <e-mail>", "Firstname Lastname <e-mail>"]
"dcp_activity_dates": [Timestamp1, Timestamp2]
"dcp_tags": ["Tags constructed from 'tags' tag and user tags from persistance storage"]
}
All DCP Internal data are set during push and reindex except these which can be defined during data push:
* `dcp_title`
* `dcp_url_view`
* `dcp_description`
---
--
Authentication
Distinct operations needs to be authenticated. Content provider provides credintials by URL parameters provider and password or via standard HTTP Basic authentication.
If authentication is not successfull then standard forbidden http code is returned.
--
--
Content
--
Return Document JSON data
GET /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
All content for specified type.
GET /rest/content/{type}
< 200
< Content-Type: application/json
{
"total": "count of returned values",
"hits": [
{
"id": "internal dcp id of document"
"data": "document content"
}
]
}
JSON document in http body which is pushed to DCP.
Http body empty
POST /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
Document deleted
DELETE /rest/content/{type}/{id}
< 200
--
Search
--
Search contributions.
GET /rest/search?TODO
< 200
{ "foo": "bar" }
--
Suggestions
--
Get suggestions for user query.
Returned JSON contains two parts:
- `view`
- `model`
#### view
The `view` represents the visual part of query suggestions.
It *always* contains section `search` which will *always* have only one option matching incoming user query.
It can then contain one or more additional sections (like `suggestions`, `filters`, `mails`, ... etc.).
#### model
The `model` represents possible "actions" that are relevant to individual `option`s in the `view` part.
This means both `view` and `model` parts have the same highlevel structure and each `option`
in the `view` part have corresponding "action" in the `model` part.
Individual actions are described using symbolic commands. Interpretation of these commands is up to the client
the following is just a recommendation about how client can interpret the commands:
##### Commands:
`search` - execute search for `query` value.
`suggestion` - replace text in the search field with the `value`'s value.
`filter` - replace current filters with provided filters.
`filter_add` - enable provided filters (on top of currently active filters).
... more TDB.
To allow CORS we need to response to `OPTIONS` requests (for more see: <http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0>). We allow `GET` requests only.
OPTIONS /rest/suggestions/query_string
< 200
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET
GET /rest/suggestions/query_string?q={user_query_string}
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["${query_string}"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"option #1",
"option #2",
"..."
]
},
"filters": {
"caption": "Filters",
"options": [
"option #1",
"option #2",
"..."
]
},
"mails": {
"caption": "Mails",
"options": [
"option #1",
"option #2",
"..."
]
}
},
"model" : {
"search": {
"search": { "query": "${query_string}" }
},
"suggestions" : [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"filters": [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"mails": [
{ "action #1": {} },
{ "action #2": {} },
{ }
]
}
}
Example for user query 'Hiberna'.
GET /rest/suggestions/query_string?q=Hiberna
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["Hiberna"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"<strong>Hiberna</strong>te",
"<strong>Hiberna</strong>te query",
"<strong>Hiberna</strong>te session"
]
},
"filters": {
"caption": "Filters",
"options": [
"<strong>Add</strong> project filter for <strong>Hibernate</strong>",
"<strong>Add</strong> project filter for <strong>Infinispan</strong>",
"<strong>Search</strong> project <strong>Hibernate</strong> only"
]
},
"mails": {
"caption": "Mails",
"options": [
"<strong>Add</strong> some Mails filter",
"Do some other fancy thing here",
"Or do something else"
]
}
},
"model" : {
"search": { "search": { "query": "Hiberna" } },
"suggestions" : [
{ "suggestion": { "value": "Hibernate" }, "search": { "query": "Hibernate" } },
{ "suggestion": { "value": "Hibernate query" }, "search": { "query": "Hibernate query" } },
{ "suggestion": { "value": "Hibernate session" }, "search": { "query": "Hibernate session" } }
],
"filters": [
{ "filter_add": [ "Hibernate" ] },
{ "filter_add": [ "Infinispan" ] },
{ "filter": [ "Hibernate" ] }
],
"mails": [
{ "filter_add": [ "foo" ] },
{},
{}
]
}
}
|
fix format
|
fix format
|
API Blueprint
|
apache-2.0
|
ollyjshaw/searchisko,ollyjshaw/searchisko,searchisko/searchisko,searchisko/searchisko,searchisko/searchisko,ollyjshaw/searchisko
|
140bd1f489d50384d6dcf7910cbc8022ebf14583
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://awesome-bucketlist-api.herokuapp.com/
# Awesome Bucketlist API Docs
A Bucketlist is a list of items, activities or goals you want to achieve before you "kick the bucket"
this is an API to allow you create a new user account, login into your account, create, update, view or delete
bucketlists and bucketlist items.
# Allowed methods:
```
POST - To create a resource.
PUT - Update a resource.
GET - Get a resource or list of resources.
DELETE - To delete a resource.
```
# HTTP status codes description:
- 200 `OK` - the request was successful (some API calls may return 201 instead).
- 201 `Created` - the request was successful and a resource was created.
- 204 `No Content` - the request was successful but there is no representation to return (i.e. the response is empty).
- 400 `Bad Request` - the request could not be understood or was missing required parameters.
- 401 `Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- 403 `Forbidden` - access denied.
- 404 `Not Found` - resource was not found.
- 405 `Method Not Allowed` - requested method is not supported for resource.
## features covered include:
* User login and registration.
* Token based authentication.
* Creating a bucketlist.
* Viewing bucketlists.
* Viewing a single bucketlist.
* Updating a bucketlist.
* Deleting a single bucketlist.
* Creating a bucketlist item.
* Viewing all bucketlist items.
* Viewing a single bucketlist item.
* Updating a bucketlist item.
* Deleting a bucketlist item.
## Registration Resource [/auth/register]
### Create a new account [POST]
Create a new account using a username and password.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 201 (application/json)
{
"message": "user registered successfully"
}
## Login Resource [/auth/login]
### Login to your account [POST]
Send your account credentials which returns a token for use with all requests to the API.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 200 (application/json)
{
"token": "The token generated"
}
## Bucketlists Resource [/bucketlists]
### Create New Bucketlist [POST]
Creates a new bucketlist under your account.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 201 (application/json)
{
"message": "Bucketlist created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Get All Bucketlists [GET]
Gets all bucketlists created under your account, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
[
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
]
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Resource [/bucketlists/{id}]
+ Parameters
+ id - the bucketlist id
### Get single bucketlist [GET]
Gets a single bucketlist for the specified id, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
### Update a bucketlist [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
## Bucketlist Items Resource [/bucketlists/{bucketlist_id}/items/]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
### Create new item [POST]
Gets bucketlist items created under the specified **bucketlist_id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "climb Mt.Kilimanjaro"
}
+ Response 201 (application/json)
{
"message": "Item created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Item with similar name already exists"
}
### Get all items [GET]
Gets all bucketlist items created under the specified **bucketlist id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Item Resource [/bucketlists/{bucketlist_id}/items/{item_id}]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
+ item_id - the id for any of the items created earlier
### Update an item [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist item with the **item id** specified.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
|
FORMAT: 1A
HOST: https://awesome-bucketlist-api.herokuapp.com/
# Awesome Bucketlist API Docs
A Bucketlist is a list of items, activities or goals you want to achieve before you "kick the bucket"
this is an API to allow you create a new user account, login into your account, create, update, view or delete
bucketlists and bucketlist items.
# Allowed methods:
```
POST - To create a resource.
PUT - Update a resource.
GET - Get a resource or list of resources.
DELETE - To delete a resource.
```
# HTTP status codes description:
- 200 `OK` - the request was successful (some API calls may return 201 instead).
- 201 `Created` - the request was successful and a resource was created.
- 204 `No Content` - the request was successful but there is no representation to return (i.e. the response is empty).
- 400 `Bad Request` - the request could not be understood or was missing required parameters.
- 401 `Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- 403 `Forbidden` - access denied.
- 404 `Not Found` - resource was not found.
- 405 `Method Not Allowed` - requested method is not supported for resource.
## features covered include:
* User login and registration.
* Token based authentication.
* Creating a bucketlist.
* Viewing bucketlists.
* Viewing a single bucketlist.
* Updating a bucketlist.
* Deleting a single bucketlist.
* Creating a bucketlist item.
* Viewing all bucketlist items.
* Viewing a single bucketlist item.
* Updating a bucketlist item.
* Deleting a bucketlist item.
## Registration Resource [/auth/register]
### Create a new account [POST]
Create a new account using a username and password.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 201 (application/json)
{
"message": "user registered successfully"
}
+ Response 409 (application/json)
{
"message": "username already exists"
}
## Login Resource [/auth/login]
### Login to your account [POST]
Send your account credentials which returns a token for use with all requests to the API.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 200 (application/json)
{
"token": "The token generated"
}
+ Response 401 (application/json)
{
"message": "username or password is incorrect"
}
## Bucketlists Resource [/bucketlists]
### Create New Bucketlist [POST]
Creates a new bucketlist under your account.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 201 (application/json)
{
"message": "Bucketlist created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Get All Bucketlists [GET]
Gets all bucketlists created under your account, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
[
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
]
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Resource [/bucketlists/{id}]
+ Parameters
+ id - the bucketlist id
### Get single bucketlist [GET]
Gets a single bucketlist for the specified id, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
### Update a bucketlist [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
## Bucketlist Items Resource [/bucketlists/{bucketlist_id}/items/]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
### Create new item [POST]
Gets bucketlist items created under the specified **bucketlist_id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "climb Mt.Kilimanjaro"
}
+ Response 201 (application/json)
{
"message": "Item created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Item with similar name already exists"
}
### Get all items [GET]
Gets all bucketlist items created under the specified **bucketlist id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Item Resource [/bucketlists/{bucketlist_id}/items/{item_id}]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
+ item_id - the id for any of the items created earlier
### Update an item [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist item with the **item id** specified.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
|
Add unauthorized response body for login and registration
|
[CHORE] Add unauthorized response body for login and registration
|
API Blueprint
|
mit
|
brayoh/bucket-list-api
|
f6a829a3fef2d5e56ffdffb02b7e644c6e210368
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2.
# Orchestrator Hooks
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo"
}
}
+ Response 200 (pplication/vnd.orch.task.v1+json)
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2.
# Orchestrator Hooks
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo"
}
}
+ Response 200 (application/vnd.orch.task.v1+json)
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
|
Fix misspelled content type.
|
Fix misspelled content type.
|
API Blueprint
|
mit
|
totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator
|
d3e7dcdf8e50274d1848faf9b7bdf80833dbd276
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# bootkick
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Notes
Notes related resources of the **Notes API**
## Notes Collection [/notes]
### List all Notes [GET]
+ Response 200 (application/json)
[{
"id": 1, "title": "Jogging in park"
}, {
"id": 2, "title": "Pick-up posters from post-office"
}]
### Create a Note [POST]
+ Request (application/json)
{ "title": "Buy cheese and bread for breakfast." }
+ Response 201 (application/json)
{ "id": 3, "title": "Buy cheese and bread for breakfast." }
## Note [/notes/{id}]
A single Note object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.
### Retrieve a Note [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{ "id": 2, "title": "Pick-up posters from post-office" }
### Remove a Note [DELETE]
+ Response 204
|
FORMAT: 1A
# BootKick
Kickstarting APIs with Spring Boot.
# Group Notes
Persons related resources of the **BootKick API**
## Persons Collection [/persons/]
### List all Persons [GET]
+ Response 200 (application/json)
[
{ "id": "123", "name": "Hank Schrader", "phone": "+555687684" },
{ "id": "234", "name": "Jesse Pinkman", "phone": "+555313441" }
]
### Create a Person [PUT]
+ Request (application/json)
{ "id": "123", "name": "Hank Schrader", "phone": "+555687684" }
+ Response 204
## Person [/persons/{id}]
A single Person with all its details
+ Parameters
+ id (required, string, `123`) ... `id` of the Person to perform action with. Has example value.
### Retrieve a Person [GET]
+ Response 200 (application/json)
+ Body
{ "id": "123", "name": "Hank Schrader", "phone": "+555687684" }
### Remove a Person [DELETE]
+ Response 204
|
update blueprint
|
update blueprint
|
API Blueprint
|
unlicense
|
Egga/bootkick,Egga/bootkick,Egga/bootkick
|
6d872bec8faae995fa017558a2efb4b434e21ec3
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://tvarkaumiesta.lt/api/
# Tvarkau Miestą
API for Tvarkau Miestą apps. Manages problems reported by Lithuanian citizens.
# Group Authorization
Access to the API is granted using OAuth2. API requests must contain authorization header.
Example: `Authorization: Bearer accesstoken123`
Using OAuth2 client library is recommended to acquire access token.
Ruby example:
```ruby
require 'oauth2'
client = OAuth2::Client.new('web', nil, site: 'https://ws.tvarkaumiesta.lt/auth')
token = client.password.get_token('guest', 'guest')
puts token.token
```
## Access Token [/oauth/token]
+ Model (application/json)
{
"access_token": "7689bb55c6097159a5bca1a90b9aca2e6369c0c69f49929290459643feafb2ac",
"token_type": "bearer",
"expires_in": 7199,
"scope": "user",
"created_at": 1513989843
}
### Create an access token [POST]
#### Guest login
Grant type: `password`
Pass `guest` value as username/password.
#### Login with email and password
Grant type: `password`
Email should be passed via `username` attribute.
#### Google / Facebook login
Grant type: `assertion`
Required Google/Facebook permissions: `email`
Acquire access token using
[Google](https://developers.google.com/identity/sign-in/)/[Facebook](https://developers.facebook.com/docs/facebook-login/)
SDK for your platform and pass it to the token endpoint via `assertion` attribute.
#### VIISP login - Elektroniniai valdžios vartai
Grant type: `assertion`
Acquire [VIISP access token](#reference/authorization/viisp-access-token)
and pass it to the token endpoint via `assertion` attribute.
+ Attributes
+ client_id: android (string, required) - Client app identifier. One of: *android*, *ios*, *web*.
+ grant_type: password (string, required) - OAuth2 grant type. One of: *password*, *assertion*.
+ scope: user (string, optional) - Access scope.
+ username: [email protected] (string, optional) - User's email address. **Required for password grant type**.
+ password: secret (string, optional) - User's password. **Required for password grant type**.
+ provider: google (string, optional) - Assertion provider. One of: *google*, *facebook*, *viisp*. **Required for assertion grant type**.
+ assertion: token123 (string, optional) - Google/Facebook/VIISP token. **Required for assertion grant type**.
+ Request Create a token using email/password.
{
"client_id": "android",
"grant_type": "password",
"scope": "user",
"username": "[email protected]",
"password": "secret"
}
+ Response 200
[Access Token][]
+ Request Create a guest user token.
{
"client_id": "android",
"grant_type": "password",
"scope": "user",
"username": "guest",
"password": "guest"
}
+ Response 200
[Access Token][]
+ Request Create a token using Facebook/Google/VIISP token.
{
"client_id": "android",
"grant_type": "assertion",
"scope": "user",
"provider": "google",
"assertion": "token123"
}
+ Response 200
[Access Token][]
## VIISP Access Token [/auth/viisp/new{?redirect_uri}]
After successful authorization user will be redirected to the `redirect_uri` with the access token.
VIISP access token should be exchanged to the API access token using OAuth2 assertion grant.
Android/iOS apps can use custom url scheme to handle return to the application with the token.
### Start authorization [GET]
+ Parameters
+ redirect_uri: lt.tvarkauvilniu://viisp/callback (string, required) - URI where user should be redirected after successful authorization.
+ Response 200 (text/html)
<html>
<body>
A web page automatically redirecting to VIISP authorization system.
</body>
</html>
# Group Users
## Current User [/me]
### Get current user profile [GET]
+ Response 200 (application/json)
{
"id": 1,
"email": "[email protected]",
"created_at": "2017-12-23T13:35:46.000Z"
}
# Group Reports
## Report [/reports/{report_id}]
+ Parameters
+ report_id: 1 (number, required) - The id of the Report
+ Model (application/json)
{
"id": 1,
"ref_no": null,
"report_type_id": 1,
"lat": "9.99",
"lng": "9.99",
"user_id": 2,
"status_id": 1,
"description": "Description",
"answer": null,
"license_plate_no": "ABC123",
"registered_at": "2017-02-24T22:17:25.000Z",
"completed_at": null
}
### Retrieve a Report [GET]
+ Response 200
[Report][]
## Reports Collection [/reports{?type,status,limit,offset}]
### List Reports [GET]
+ Parameters
+ type: 1 (number, optional) - Report type id
+ status: 1 (number, optional) - Report status id
+ limit: 20 (number, optional) - Returned entries limit
+ offset: 0 (number, optional) - List offset
+ Response 200 (application/json)
{
"entries": [
{
"id": 1,
...
},
{
"id": 2,
...
},
]
}
### Create a New Report [POST]
+ Request
[Report][]
+ Response 201
[Report][]
|
FORMAT: 1A
HOST: https://tvarkaumiesta.lt/api/
# Tvarkau Miestą
API for Tvarkau Miestą apps. Manages problems reported by Lithuanian citizens.
# Group Authorization
Access to the API is granted using OAuth2. API requests must contain authorization header.
Example: `Authorization: Bearer accesstoken123`
Using OAuth2 client library is recommended to acquire access token.
Ruby example:
```ruby
require 'oauth2'
client = OAuth2::Client.new('android', nil, site: 'https://tvarkaumiesta.lt/api/oauth')
token = client.password.get_token('guest', 'guest')
puts token.token
```
## Access Token [/oauth/token]
+ Model (application/json)
{
"access_token": "7689bb55c6097159a5bca1a90b9aca2e6369c0c69f49929290459643feafb2ac",
"token_type": "bearer",
"expires_in": 7199,
"scope": "user",
"created_at": 1513989843
}
### Create an access token [POST]
#### Guest login
Grant type: `password`
Pass `guest` value as username/password.
#### Web authorization
Grant type: `authorization_code`
First get authorization using `authorize` endpoint and pass it via `code` attribute. Also pass
`redirect_uri` which should be the same as passed to the `authorize` endpoint.
#### Login with email and password
Grant type: `password`
Email should be passed via `username` attribute.
#### Google / Facebook login
Grant type: `assertion`
Required Google/Facebook permissions: `email`
Acquire access token using
[Google](https://developers.google.com/identity/sign-in/)/[Facebook](https://developers.facebook.com/docs/facebook-login/)
SDK for your platform and pass it to the token endpoint via `assertion` attribute.
#### VIISP login - Elektroniniai valdžios vartai
Grant type: `assertion`
Acquire [VIISP access token](#reference/authorization/viisp-access-token)
and pass it to the token endpoint via `assertion` attribute.
+ Attributes
+ `client_id`: android (string, required) - Client app identifier. One of: *android*, *ios*, *web*.
+ `client_secret`: secret123 (string, optional) - Client secret. **Required for authorization_code grant type**.
+ `grant_type`: password (string, required) - OAuth2 grant type. One of: *password*, *assertion*, *authorization_code*.
+ scope: user (string, optional) - Access scope.
+ username: [email protected] (string, optional) - User's email address. **Required for password grant type**.
+ password: secret (string, optional) - User's password. **Required for password grant type**.
+ provider: google (string, optional) - Assertion provider. One of: *google*, *facebook*, *viisp*. **Required for assertion grant type**.
+ assertion: token123 (string, optional) - Google/Facebook/VIISP token. **Required for assertion grant type**.
+ code: code123 (string, optional) - Authorization code. **Required for authorization_code grant type**.
+ `redirect_uri`: https://tvarkaumiesta.lt/auth/callback (string, optional) - Redirect uri, must be the same as in authorize request. **Required for authorization_code grant type**.
+ Request Create a guest user token.
{
"client_id": "android",
"grant_type": "password",
"scope": "user",
"username": "guest",
"password": "guest"
}
+ Response 200
[Access Token][]
+ Request Create a token using authorization code.
{
"client_id": "web",
"client_secret": "secret123",
"grant_type": "authorization_code",
"scope": "user",
"code": "authorizationcode123",
"redirect_uri": "https://tvarkaumiesta.lt/auth/callback"
}
+ Response 200
[Access Token][]
+ Request Create a token using email/password.
{
"client_id": "android",
"grant_type": "password",
"scope": "user",
"username": "[email protected]",
"password": "secret"
}
+ Response 200
[Access Token][]
+ Request Create a token using Facebook/Google/VIISP token.
{
"client_id": "android",
"grant_type": "assertion",
"scope": "user",
"provider": "google",
"assertion": "token123"
}
+ Response 200
[Access Token][]
## Authorization Code [/oauth/authorize{?client_id,response_type,redirect_uri}]
### Get an authorization code [GET]
Client will be redirected to the authorization web page. After picking authorization method and
successfully authorizing she will be redirected back to the `redirect_url` with authorization
`code`. Authorization code should be exchanged to the access token using `token` endpoint.
+ Parameters
+ client_id: web (string, required) - Client app identifier.
+ response_type: code (string, required) - Response type.
+ redirect_uri: https://tvarkaumiesta.lt/auth/callback (string, required) - Redirect uri.
+ Response 302
## VIISP Access Token [/auth/viisp/new{?redirect_uri}]
After successful authorization user will be redirected to the `redirect_uri` with the access token.
VIISP access token should be exchanged to the API access token using OAuth2 assertion grant.
Android/iOS apps can use custom url scheme to handle return to the application with the token.
### Start authorization [GET]
+ Parameters
+ redirect_uri: lt.tvarkauvilniu://viisp/callback (string, required) - URI where user should be redirected after successful authorization.
+ Response 200 (text/html)
<html>
<body>
A web page automatically redirecting to VIISP authorization system.
</body>
</html>
# Group Users
## Current User [/me]
### Get current user profile [GET]
+ Response 200 (application/json)
{
"id": 1,
"email": "[email protected]",
"created_at": "2017-12-23T13:35:46.000Z"
}
# Group Reports
## Report [/reports/{report_id}]
+ Parameters
+ report_id: 1 (number, required) - The id of the Report
+ Model (application/json)
{
"id": 1,
"ref_no": null,
"report_type_id": 1,
"lat": "9.99",
"lng": "9.99",
"user_id": 2,
"status_id": 1,
"description": "Description",
"answer": null,
"license_plate_no": "ABC123",
"registered_at": "2017-02-24T22:17:25.000Z",
"completed_at": null
}
### Retrieve a Report [GET]
+ Response 200
[Report][]
## Reports Collection [/reports{?type,status,limit,offset}]
### List Reports [GET]
+ Parameters
+ type: 1 (number, optional) - Report type id
+ status: 1 (number, optional) - Report status id
+ limit: 20 (number, optional) - Returned entries limit
+ offset: 0 (number, optional) - List offset
+ Response 200 (application/json)
{
"entries": [
{
"id": 1,
...
},
{
"id": 2,
...
},
]
}
### Create a New Report [POST]
+ Request
[Report][]
+ Response 201
[Report][]
|
Add authorization code flow description (#72)
|
Add authorization code flow description (#72)
|
API Blueprint
|
mit
|
vilnius/tvarkau-vilniu-ms,vilnius/tvarkau-vilniu-ms,vilnius/tvarkau-vilniu-ms
|
bcfb20487c639fc0f82c67f4f230a19ff469cfc2
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://se.zhuangty.com/
# CaμsAPI
CaμsAPI is an API to promote utility learning assistant on wechat end.
## Student Register [/students/register]
### A Student Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key",
"username": "Valid student username(e.g. 2014000000 or abc14)",
"password": "Right-password-of-this-id"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"existed": "true or false",
"information": {
"studentnumber": "Stundent number",
"department": "Department"",
"position": "Undergrate/master/doctor/teacher",
"email": "Email",
"realname": "Real name"
}
}
+ Response 401 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Cancel [/students/{username}/cancel]
### A Student Cancel His Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username"
}
+ Response 412 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Courses List [/learnhelper/{username}/{semester}/courses]
### A Student Get His Courses List [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"courses": [
{
"coursename": "Course Name",
"courseid": "Course ID",
"unreadnotice": "Unread Notice",
"newfile": "New File",
"unsubmittedoperations": "Unsubmitted Operations"
}
]
}
+ Response 412 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Notices List [/learnhelper/{username}/{semester}/courses/{courseid}/notices]
### Get All Notices Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"notices": [
{
"title": "Title",
"publishtime": "Publish Time",
"state": "Read status",
"content": "Content"
}
]
}
+ Response 412 (application/json)
{
"message": "Failure",
"username": "Request username"
}
|
FORMAT: 1A
HOST: http://se.zhuangty.com/
# CaμsAPI
CaμsAPI is an API to promote utility learning assistant on wechat end.
## Student Register [/students/register]
### A Student Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key",
"username": "Valid student username(e.g. 2014000000 or abc14)",
"password": "Right-password-of-this-id"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"existed": "true or false",
"information": {
"studentnumber": "Stundent number",
"department": "Department",
"position": "Undergrate/master/doctor/teacher",
"email": "Email",
"realname": "Real name"
}
}
+ Response 401 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Cancel [/students/{username}/cancel]
### A Student Cancel His Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username"
}
+ Response 412 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Courses List [/learnhelper/{username}/{semester}/courses]
### A Student Get His Courses List [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"courses": [
{
"coursename": "Course Name",
"courseid": "Course ID",
"unreadnotice": "Unread Notice",
"newfile": "New File",
"unsubmittedoperations": "Unsubmitted Operations"
}
]
}
+ Response 412 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Notices List [/learnhelper/{username}/{semester}/courses/{courseid}/notices]
### Get All Notices Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"notices": [
{
"title": "Title",
"publishtime": "Publish Time",
"state": "Read status",
"content": "Content"
}
]
}
+ Response 412 (application/json)
{
"message": "Failure",
"username": "Request username"
}
|
Update API Description
|
Update API Description
|
API Blueprint
|
mit
|
TennyZhuang/CamusAPI,TennyZhuang/CamusAPI
|
4a2310d0204ca149616f2d55bda4937f0d92b04b
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://localhost:3993
# scifgif
Humorous image microservice for isolated networks - xkcd and giphy full text search API
# Group xkcd
xkcd comic endpoints
## xkcd Random [/xkcd]
### Retrieve random xkcd comic [GET]
+ Response 200 (image/png)
## xkcd Number [/xkcd/number/{number}]
### Retrieve xkcd by number [GET]
+ Parameters
+ number: `1319` (number, required) - The xkcd comic ID
+ Response 200 (image/png)
## xkcd Search [/xkcd/search{?query}]
### Perform xkcd search [GET]
+ Parameters
+ query: `thumbs up` (string, required) - Search terms
+ Response 200 (image/png)
## xkcd Slash [/xkcd/slash{?text}]
### Post xkcd slash query [POST]
+ Parameters
+ text: `automation` (string, required) - Search terms
+ Request (application/json)
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ icon_url (string) - Slash command icon
+ response_type (string) - Mattermost response type
+ text (string) - Message text
+ username (string) - Mattermost username
+ Body
{
"icon_url": "http://localhost:3993/icon",
"response_type": "in_channel",
"text": "",
"username": "xkcd"
}
## xkcd Webhook [/xkcd/new_post]
### Post xkcd outgoing-webhook query [POST]
+ Attributes
+ channel_id: hawos4dqtby53pd64o4a4cmeoo (string)
+ channel_name: town-square (string)
+ team_domain: someteam (string)
+ team_id: kwoknj9nwpypzgzy78wkw516qe (string)
+ post_id: axdygg1957njfe5pu38saikdho (string)
+ text: some+text+here (string)
+ timestamp: 1445532266 (string)
+ token: zmigewsanbbsdf59xnmduzypjc (string)
+ trigger_word: some (string)
+ user_id: rnina9994bde8mua79zqcg5hmo (string)
+ user_name: somename (string)
+ Request (application/json)
+ Request (application/x-www-form-urlencoded)
+ Body
channel_id=hawos4dqtby53pd64o4a4cmeoo&
channel_name=town-square&
team_domain=someteam&
team_id=kwoknj9nwpypzgzy78wkw516qe&
post_id=axdygg1957njfe5pu38saikdho&
text=some+text+here&
timestamp=1445532266&
token=zmigewsanbbsdf59xnmduzypjc&
trigger_word=some&
user_id=rnina9994bde8mua79zqcg5hmo&
user_name=somename
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ text (string) - Response text
+ Body
{
"text": "This is some response text."
}
# Group giphy
Giphy GIF endpoints
## giphy Random [/giphy]
### Retrieve random giphy gif [GET]
+ Response 200 (image/gif)
## giphy Search [/giphy/search{?query}]
### Retrieve giphy search [GET]
+ Parameters
+ query: `thumbs up` (string, required) - Search terms
+ Response 200 (image/gif)
## giphy Slash [/giphy/slash{?text}]
### Post giphy slash query [POST]
+ Parameters
+ text: `thumbs up` (string, required) - Search terms
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ icon_url (string) - Slash command icon
+ response_type (string) - Mattermost response type
+ text (string) - Message text
+ username (string) - Mattermost username
+ Body
{
"icon_url": "http://localhost:3993/icon",
"response_type": "in_channel",
"text": "",
"username": "scifgif"
}
## giphy Webhook [/giphy/new_post]
### Post giphy outgoing-webhook query [POST]
+ Attributes
+ channel_id: hawos4dqtby53pd64o4a4cmeoo (string)
+ channel_name: town-square (string)
+ team_domain: someteam (string)
+ team_id: kwoknj9nwpypzgzy78wkw516qe (string)
+ post_id: axdygg1957njfe5pu38saikdho (string)
+ text: some+text+here (string)
+ timestamp: 1445532266 (string)
+ token: zmigewsanbbsdf59xnmduzypjc (string)
+ trigger_word: some (string)
+ user_id: rnina9994bde8mua79zqcg5hmo (string)
+ user_name: somename (string)
+ Request (application/json)
+ Request (application/x-www-form-urlencoded)
+ Body
channel_id=hawos4dqtby53pd64o4a4cmeoo&
channel_name=town-square&
team_domain=someteam&
team_id=kwoknj9nwpypzgzy78wkw516qe&
post_id=axdygg1957njfe5pu38saikdho&
text=some+text+here&
timestamp=1445532266&
token=zmigewsanbbsdf59xnmduzypjc&
trigger_word=some&
user_id=rnina9994bde8mua79zqcg5hmo&
user_name=somename
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ text (string) - Response text
+ Body
{
"text": "This is some response text."
}
# Group image
image endpoints
## image [/image/{source}/{file}]
### Retrieve image [GET]
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
### Delete image [DELETE]
Allows users to delete possibly offensive images
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
+ Response 200 (text/plain)
+ Body
image successfully removed
|
FORMAT: 1A
HOST: http://localhost:3993
# scifgif
Humorous image microservice for isolated networks - xkcd and giphy full text search API
# Group xkcd
xkcd comic endpoints
## Random [/xkcd]
### Retrieve random xkcd comic [GET]
+ Response 200 (image/png)
## Number [/xkcd/number/{number}]
### Retrieve xkcd by number [GET]
+ Parameters
+ number: `1319` (number, required) - The xkcd comic ID
+ Response 200 (image/png)
## Search [/xkcd/search{?query}]
### Perform xkcd search [GET]
+ Parameters
+ query: `thumbs up` (string, required) - Search terms
+ Response 200 (image/png)
## Slash [/xkcd/slash{?text}]
### Post xkcd slash query [POST]
+ Parameters
+ text: `automation` (string, required) - Search terms
+ Request (application/json)
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ icon_url (string) - Slash command icon
+ response_type (string) - Mattermost response type
+ text (string) - Message text
+ username (string) - Mattermost username
+ Body
{
"icon_url": "http://localhost:3993/icon",
"response_type": "in_channel",
"text": "",
"username": "xkcd"
}
## Webhook [/xkcd/new_post]
### Post xkcd outgoing-webhook query [POST]
+ Attributes
+ channel_id: hawos4dqtby53pd64o4a4cmeoo (string)
+ channel_name: town-square (string)
+ team_domain: someteam (string)
+ team_id: kwoknj9nwpypzgzy78wkw516qe (string)
+ post_id: axdygg1957njfe5pu38saikdho (string)
+ text: some+text+here (string)
+ timestamp: 1445532266 (string)
+ token: zmigewsanbbsdf59xnmduzypjc (string)
+ trigger_word: some (string)
+ user_id: rnina9994bde8mua79zqcg5hmo (string)
+ user_name: somename (string)
+ Request (application/json)
+ Request (application/x-www-form-urlencoded)
+ Body
channel_id=hawos4dqtby53pd64o4a4cmeoo&
channel_name=town-square&
team_domain=someteam&
team_id=kwoknj9nwpypzgzy78wkw516qe&
post_id=axdygg1957njfe5pu38saikdho&
text=some+text+here&
timestamp=1445532266&
token=zmigewsanbbsdf59xnmduzypjc&
trigger_word=some&
user_id=rnina9994bde8mua79zqcg5hmo&
user_name=somename
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ text (string) - Response text
+ Body
{
"text": "This is some response text."
}
# Group giphy
Giphy GIF endpoints
## Random [/giphy]
### Retrieve random giphy gif [GET]
+ Response 200 (image/gif)
## Search [/giphy/search{?query}]
### Retrieve giphy search [GET]
+ Parameters
+ query: `thumbs up` (string, required) - Search terms
+ Response 200 (image/gif)
## Slash [/giphy/slash{?text}]
### Post giphy slash query [POST]
+ Parameters
+ text: `thumbs up` (string, required) - Search terms
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ icon_url (string) - Slash command icon
+ response_type (string) - Mattermost response type
+ text (string) - Message text
+ username (string) - Mattermost username
+ Body
{
"icon_url": "http://localhost:3993/icon",
"response_type": "in_channel",
"text": "",
"username": "scifgif"
}
## Webhook [/giphy/new_post]
### Post giphy outgoing-webhook query [POST]
+ Attributes
+ channel_id: hawos4dqtby53pd64o4a4cmeoo (string)
+ channel_name: town-square (string)
+ team_domain: someteam (string)
+ team_id: kwoknj9nwpypzgzy78wkw516qe (string)
+ post_id: axdygg1957njfe5pu38saikdho (string)
+ text: some+text+here (string)
+ timestamp: 1445532266 (string)
+ token: zmigewsanbbsdf59xnmduzypjc (string)
+ trigger_word: some (string)
+ user_id: rnina9994bde8mua79zqcg5hmo (string)
+ user_name: somename (string)
+ Request (application/json)
+ Request (application/x-www-form-urlencoded)
+ Body
channel_id=hawos4dqtby53pd64o4a4cmeoo&
channel_name=town-square&
team_domain=someteam&
team_id=kwoknj9nwpypzgzy78wkw516qe&
post_id=axdygg1957njfe5pu38saikdho&
text=some+text+here&
timestamp=1445532266&
token=zmigewsanbbsdf59xnmduzypjc&
trigger_word=some&
user_id=rnina9994bde8mua79zqcg5hmo&
user_name=somename
+ Response 200 (application/json; charset=UTF-8)
+ Attributes (object)
+ text (string) - Response text
+ Body
{
"text": "This is some response text."
}
# Group image
image endpoints
## Image [/image/{source}/{file}]
### Retrieve image [GET]
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
### Delete image [DELETE]
Allows users to delete possibly offensive images
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
+ Response 200 (text/plain)
+ Body
image successfully removed
|
update API docs
|
update API docs
|
API Blueprint
|
mit
|
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
|
42c1d923388a9ef22af181d8a3a03e2a57fef886
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
Category related resources of the **Money Advice Service**.
## Categories Collection [/{locale}/categories.json]
A collection of categories including their subcategories
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Categories.
+ Values
+ `en`
+ `cy`
### Retrieve all Categories [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/categories>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "life-events",
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"subCategories": [
{
"id": "setting-up-home",
"title": "Setting up home",
"description": "Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n",
"subCategories": [
]
},
{
"id": "young-people-and-money",
"title": "Leaving school or college",
"description": "",
"subCategories": [
]
},
{
"id": "having-a-baby",
"title": "Having a baby",
"description": "",
"subCategories": [
]
}
]
},
{
"id": "managing-your-money",
"title": "Managing your money",
"description": "",
"subCategories": [
]
},
{
"id": "money-topics",
"title": "Money topics",
"description": "",
"subCategories": [
]
},
{
"id": "tools--resources",
"title": "Tools & resources",
"description": "",
"subCategories": [
]
},
{
"id": "news",
"title": "News",
"description": "",
"subCategories": [
]
}
]
## Category [/{locale}/categories/{id}]
A single category object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Category.
+ Values
+ `en`
+ `cy`
+ id (required, string, `life-events`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories/life-events>; rel="canonical"; title="Life events", <https://www.moneyadviceservice.org.uk/cy/categories/life-events>; rel="alternate"; hreflang="cy"; title="Digwyddiadau bywyd"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"contents":[
{
"id":"setting-up-home",
"type":"category",
"title":"Setting up home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"id":"how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you've moved in"
}
]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve an Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="canonical"; title="Where to go to get free debt advice", <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="canonical"; title="Action plan – Prepare for the cost of having a baby", <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
#Group Search
Search related resources of the **Money Advice Service**.
## Search [/{locale}/search?query={query_chain}]
A collection of search results
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Search.
+ Values
+ `en`
+ `cy`
+ query_chain (string, `health+check+house`) ... query of the search.
### Retrieve search results [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/search?query=budget+plan+house; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/search>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "manage-your-budget-after-redundancy",
"type": "action_plan",
"title": "Manage your budget after redundancy",
"description":"Use this step-by-step action plan to help you keep the household budget on track after redundancy."
},
{
"id": "new-baby-why-budget",
"type": "article",
"title": "New baby – why budget?",
"description":"If you find yourself saying that more and more, especially if there’s a new baby on the scene, it’s probably time to draw up a household budget and start planning your spending."
},
{
"id": "funeral-plans",
"title": "Funeral plans",
"type": "article",
"description":"A funeral plan is a way of paying for a future funeral today. Here are some things to bear in mind if you're thinking of taking one out."
},
{
"id": "how-to-make-your-money-go-further",
"type": "action_plan",
"title": "How to make your money go further",
"description":"Follow this action plan to help you save money around the home and when you’re out and about, making your hard-earned cash go that bit further."
},
]
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
Category related resources of the **Money Advice Service**.
## Categories Collection [/{locale}/categories.json]
A collection of categories including their subcategories
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Categories.
+ Values
+ `en`
+ `cy`
### Retrieve all Categories [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/categories>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "life-events",
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"subCategories": [
{
"id": "setting-up-home",
"title": "Setting up home",
"description": "Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n",
"subCategories": [
]
},
{
"id": "young-people-and-money",
"title": "Leaving school or college",
"description": "",
"subCategories": [
]
},
{
"id": "having-a-baby",
"title": "Having a baby",
"description": "",
"subCategories": [
]
}
]
},
{
"id": "managing-your-money",
"title": "Managing your money",
"description": "",
"subCategories": [
{
"id": "managing-your-money-better",
"title": "Managing your money",
"description": "How to take control of your money, make ends meet and make better financial decisions\n",
"subCategories": [
]
},
{
"id": "how-to-review-or-reduce-borrowing",
"title": "How to review or reduce borrowing",
"description": "Tips on cutting the cost of card debt, personal loans, car finance, catalogue or HP agreements and mortgage payments",
"subCategories": [
]
}
]
},
{
"id": "money-topics",
"title": "Money topics",
"description": "",
"subCategories": [
]
},
{
"id": "tools--resources",
"title": "Tools & resources",
"description": "",
"subCategories": [
]
},
{
"id": "news",
"title": "News",
"description": "",
"subCategories": [
]
}
]
## Category [/{locale}/categories/{id}]
A single category object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Category.
+ Values
+ `en`
+ `cy`
+ id (required, string, `life-events`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories/life-events>; rel="canonical"; title="Life events", <https://www.moneyadviceservice.org.uk/cy/categories/life-events>; rel="alternate"; hreflang="cy"; title="Digwyddiadau bywyd"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"contents":[
{
"id":"setting-up-home",
"type":"category",
"title":"Setting up home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"id":"how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you've moved in"
}
]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve an Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="canonical"; title="Where to go to get free debt advice", <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="canonical"; title="Action plan – Prepare for the cost of having a baby", <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
#Group Search
Search related resources of the **Money Advice Service**.
## Search [/{locale}/search?query={query_chain}]
A collection of search results
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Search.
+ Values
+ `en`
+ `cy`
+ query_chain (string, `health+check+house`) ... query of the search.
### Retrieve search results [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/search?query=budget+plan+house; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/search>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "manage-your-budget-after-redundancy",
"type": "action_plan",
"title": "Manage your budget after redundancy",
"description":"Use this step-by-step action plan to help you keep the household budget on track after redundancy."
},
{
"id": "new-baby-why-budget",
"type": "article",
"title": "New baby – why budget?",
"description":"If you find yourself saying that more and more, especially if there’s a new baby on the scene, it’s probably time to draw up a household budget and start planning your spending."
},
{
"id": "funeral-plans",
"title": "Funeral plans",
"type": "article",
"description":"A funeral plan is a way of paying for a future funeral today. Here are some things to bear in mind if you're thinking of taking one out."
},
{
"id": "how-to-make-your-money-go-further",
"type": "action_plan",
"title": "How to make your money go further",
"description":"Follow this action plan to help you save money around the home and when you’re out and about, making your hard-earned cash go that bit further."
},
]
|
Add menu items to "managing your money" apiary file
|
Add menu items to "managing your money" apiary file
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
da4e577306c8e56a1caf1cac2fbea49003a1e720
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://neighbor.ly/api/
# Neighbor.ly
Here you will find how to integrate an application with Neighbor.ly. Check our [Dashboard source code](https://github.com/neighborly/neighborly-dashboard) for a real use case.
# Sessions
Your first stop when integrating with Neighborly. For a lot of endpoints, you are expected to provide an `access_token`, managed by this section.
## Sessions [/sessions]
### Create a session [POST]
+ Request
{ "email": "[email protected]", "password": "your-really-strong-password" }
+ Header
Accept: application/vnd.api+json;revision=1
+ Response 201 (application/json)
{ "access_token": "Ndf6kxgLfr_KMhAg8wMpm7Yit2cvHkv9oI8qIXWiHmZdeqI1h0cmn8p4wCEhoZS-AQY", "user_id": 1 }
+ Response 400 (application/json)
{}
+ Response 401 (application/json)
{}
|
FORMAT: 1A
HOST: https://neighbor.ly/api/
# Neighbor.ly
Here you will find how to integrate an application with Neighbor.ly. Check our [Dashboard source code](https://github.com/neighborly/neighborly-dashboard) for a real use case.
# Sessions
Your first stop when integrating with Neighborly. For a lot of endpoints, you are expected to provide an `access_token`, managed by this section.
## Sessions [/sessions]
### Create a session [POST]
+ Request
+ Header
Accept: application/vnd.api+json;revision=1
+ Body
{ "email": "[email protected]", "password": "your-really-strong-password" }
+ Response 201 (application/json)
{ "access_token": "Ndf6kxgLfr_KMhAg8wMpm7Yit2cvHkv9oI8qIXWiHmZdeqI1h0cmn8p4wCEhoZS-AQY", "user_id": 1 }
+ Response 400 (application/json)
{}
+ Response 401 (application/json)
{}
|
Add body section to create a new session
|
[DOC] Add body section to create a new session
|
API Blueprint
|
mit
|
FromUte/dune-api
|
3df7a0676e309fbc8e865bf3ba9407e414140d93
|
deoraclize-apiary.apib
|
deoraclize-apiary.apib
|
FORMAT: 1A
HOST: http://deoraclize.herokuapp.com
# Deoraclize API
## Search [GET /search{?term}]
+ Parameters
+ term: OPC (required, string) - The acronym/abbreviation you want to lookup
+ Response 200 (application/json)
+ Attributes
+ count (number) - Count of the search results
+ results (array)
+ abbr (string) - Abbreviation matching the search term
+ title (string) - Meaning of the abbreviation
+ description (string) - Detailed description
+ url (string) - URL to the source of the information
|
FORMAT: 1A
HOST: http://deoraclize.herokuapp.com
# Deoraclize API
## Search [GET /search{?term}]
+ Parameters
+ term: OPC (required, string) - The acronym/abbreviation you want to lookup
+ Response 200 (application/json)
+ Attributes
+ count (number) - Count of the search results
+ results (array)
+ (object)
+ abbr (string) - Abbreviation matching the search term
+ title (string) - Meaning of the abbreviation
+ description (string) - Detailed description
+ url (string) - URL to the source of the information
|
Fix attributes
|
docs: Fix attributes
|
API Blueprint
|
mit
|
honzajavorek/deoraclize
|
fa8c45dabf70da30d583960ed5fc22fadd43f7b0
|
apiary.apib
|
apiary.apib
|
# Lion API
Lion is a basic localization service using `git` as the backend for storing translations.
## Request headers
All requests to Lion must include the following headers:
- `Lion-Api-Key`
- `Lion-Api-Secret`
- `Lion-Api-Version`
# Group Projects
## Project management [/project/{name}]
+ Parameters
+ name (required, string) ... Project name
### Get project [GET]
Fetch project details, given the projects' name.
+ Request (application/json)
+ Header
Lion-Api-Key: <YOUR_API_KEY>
Lion-Api-Secret: <YOUR_API_SECRET>
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"name": "Project name",
"resources": [
"resource1",
"..."
]
}
+ Response 401 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 403 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 404 (application/json)
+ Header
Lion-Api-Version: v1
|
# Lion API
Lion is a basic localization service using `git` as the backend for storing translations.
## Request headers
All requests to Lion must include the following headers:
- `Lion-Api-Key`
- `Lion-Api-Secret`
- `Lion-Api-Version`
# Group Projects
## Project collection [/projects]
### List projects [GET]
List all configured projects
+ Request (application/json)
+ Header
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"projects": [
"projectA": {
"name" "projectA" // All project details
}
]
}
## Project management [/project/{name}]
+ Parameters
+ name (required, string) ... Project name
### Get project [GET]
Fetch project details, given the projects' name.
+ Request (application/json)
+ Header
Lion-Api-Key: <YOUR_API_KEY>
Lion-Api-Secret: <YOUR_API_SECRET>
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"name": "Project name",
"resources": [
"resource1",
"..."
]
}
+ Response 401 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 403 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 404 (application/json)
+ Header
Lion-Api-Version: v1
|
Document GET /projects
|
Document GET /projects
|
API Blueprint
|
mit
|
sebdah/lion
|
901e3baee7247a819256ed306b562b966b59c1d4
|
source/parser.apib
|
source/parser.apib
|
## API Description Parser [/parser]
Parse an API description format.
### Parse [POST]
API Blueprint parsing is performed as it is provided by the [Drafter](https://github.com/apiaryio/drafter) reference parser.
#### Input Media Types
##### API Blueprint
```
text/vnd.apiblueprint
```
API Blueprint as defined in its [specification](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md).
##### Swagger 2.0
```
application/swagger+yaml
application/swagger+json
```
Swagger as defined in its [specification](http://swagger.io/specification)
#### Output Media Types
##### API Description Parse Result Namespace
```
application/vnd.refract.parse-result+json
application/vnd.refract.parse-result+yaml
```
General-purpose result of the parsing operation. The parse result is in form of the Refract data structure as defined in its [specification](https://github.com/refractproject/refract-spec). The parse result data comply with the [Parse Result Namespace](https://github.com/refractproject/refract-spec/blob/master/namespaces/parse-result-namespace.md).
+ Relation: parse
+ Request Parse API Blueprint into Parse Result Namespace as JSON (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+json
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+json)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Request Parse API Blueprint into Parse Result Namespace as YAML (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+yaml)
:[](fixtures/apib/normal.refract.parse-result.yaml)
+ Request Parse API Blueprint into Parse Result Namespace as JSON 1.0 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+json; version=1.0
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+json; version=1.0)
:[](fixtures/apib/normal.refract.parse-result.1.0.json)
+ Request Parse API Blueprint into Parse Result Namespace as YAML 1.0 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml; version=1.0
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+yaml; version=1.0)
:[](fixtures/apib/normal.refract.parse-result.1.0.yaml)
+ Request Parse API Blueprint into Parse Result Namespace as JSON 0.6 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+json; version=0.6
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+json; version=0.6)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Request Parse API Blueprint into Parse Result Namespace as YAML 0.6 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml; version=0.6
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+yaml; version=0.6)
:[](fixtures/apib/normal.refract.parse-result.yaml)
+ Request Invalid Document (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml
+ Body
:[](fixtures/apib/error.apib)
+ Response 422 (application/vnd.refract.parse-result+yaml)
:[](fixtures/apib/error.refract.parse-result.yaml)
+ Request Unsupported Input Media Type
+ Headers
Accept: application/raml+yaml
+ Body
:[](fixtures/apib/normal.apib)
+ Response 415 (application/vnd.error+json)
{
"statusCode": 415,
"message": "",
"name": "Rest Error"
}
+ Request Unsupported Output Media Type (application/swagger+yaml)
+ Headers
Accept: application/vnd.apiblueprint.parseresult+json; version=2.2
+ Body
:[](fixtures/swagger.yaml/normal.yaml)
+ Response 406 (application/vnd.error+json)
{
"statusCode": 406,
"message": "",
"name": "Rest Error"
}
|
## API Description Parser [/parser]
Parse an API description format.
### Parse [POST]
API Blueprint parsing is performed as it is provided by the [Drafter](https://github.com/apiaryio/drafter) reference parser.
#### Input Media Types
##### API Blueprint
```
text/vnd.apiblueprint
```
API Blueprint as defined in its [specification](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md).
##### Swagger 2.0
```
application/swagger+yaml
application/swagger+json
```
Swagger as defined in its [specification](http://swagger.io/specification)
#### Output Media Types
##### API Description Parse Result Namespace
```
application/vnd.refract.parse-result+json
application/vnd.refract.parse-result+yaml
```
General-purpose result of the parsing operation. The parse result is in form of the Refract data structure as defined in its [specification](https://github.com/refractproject/refract-spec). The parse result data comply with the [Parse Result Namespace](https://github.com/refractproject/refract-spec/blob/master/namespaces/parse-result-namespace.md).
+ Relation: parse
+ Request Parse API Blueprint into Parse Result Namespace as JSON (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+json
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+json)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Request Parse API Blueprint into Parse Result Namespace as YAML (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+yaml)
:[](fixtures/apib/normal.refract.parse-result.yaml)
+ Request Parse API Blueprint into Parse Result Namespace as JSON 1.0 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+json; version=1.0
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+json; version=1.0)
:[](fixtures/apib/normal.refract.parse-result.1.0.json)
+ Request Parse API Blueprint into Parse Result Namespace as YAML 1.0 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml; version=1.0
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+yaml; version=1.0)
:[](fixtures/apib/normal.refract.parse-result.1.0.yaml)
+ Request Parse API Blueprint into Parse Result Namespace as JSON 0.6 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+json; version=0.6
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+json; version=0.6)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Request Parse API Blueprint into Parse Result Namespace as YAML 0.6 (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml; version=0.6
+ Body
:[](fixtures/apib/normal.apib)
+ Response 200 (application/vnd.refract.parse-result+yaml; version=0.6)
:[](fixtures/apib/normal.refract.parse-result.yaml)
+ Request Invalid Document (text/vnd.apiblueprint)
+ Headers
Accept: application/vnd.refract.parse-result+yaml
+ Body
:[](fixtures/apib/error.apib)
+ Response 422 (application/vnd.refract.parse-result+yaml)
:[](fixtures/apib/error.refract.parse-result.yaml)
+ Request Unsupported Input Media Type
+ Headers
Content-Type: application/raml+yaml
+ Body
:[](fixtures/apib/normal.apib)
+ Response 415 (application/vnd.error+json)
{
"statusCode": 415,
"message": "",
"name": "Rest Error"
}
+ Request Unsupported Output Media Type (application/swagger+yaml)
+ Headers
Accept: application/vnd.apiblueprint.parseresult+json; version=2.2
+ Body
:[](fixtures/swagger.yaml/normal.yaml)
+ Response 406 (application/vnd.error+json)
{
"statusCode": 406,
"message": "",
"name": "Rest Error"
}
|
use Content-Type to demonstate invalid input type
|
fix: use Content-Type to demonstate invalid input type
|
API Blueprint
|
mit
|
apiaryio/api.apiblueprint.org,apiaryio/api.apiblueprint.org
|
6a5676d5a30a1c1237eea611f82ea3ca010ec2b7
|
source/composer.apib
|
source/composer.apib
|
## API Description Composer [/composer]
Reverse the parsing process--compose an API description format.
### Compose [POST]
The composition of API Blueprint is performed as it is provided by the [Matter Compiler](https://github.com/apiaryio/matter_compiler) tool.
#### Input Media Types
##### API Elements
API Elements is supported, you can send an [API Elements API
Category](http://api-elements.readthedocs.io/en/latest/element-definitions/#category-base-api-element)
to the composer using the `application/vnd.refract+json` content type. You may
also send an [API Elements Parse
Result](http://api-elements.readthedocs.io/en/latest/element-definitions/#parse-result-elements)
as `application/vnd.refract.parse-result+json`.
```
application/vnd.refract+json
application/vnd.refract.parse-result+json
```
##### API Blueprint AST (Deprecated)
API Blueprint AST support is deprecated and support will be completely removed
from the service by February 28th 2016.
```
application/vnd.apiblueprint.ast+json
application/vnd.apiblueprint.ast+yaml
```
Serialized API Blueprint AST represented either in its JSON or YAML format as defined in [API Blueprint AST Serialization Media Types](https://github.com/apiaryio/api-blueprint-ast).
Please keep in mind that the API Blueprint AST is soon to be deprecated in favor of the API Description Parse Result Namespace.
#### Output Media Types
##### API Blueprint
```
text/vnd.apiblueprint
```
API Blueprint as defined in its [specification](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md).
+ Relation: compose
+ Request Compose API Blueprint from API Elements API (application/vnd.refract+json)
:[](fixtures/apib/normal.refract.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Compose API Blueprint from API Elements Parse Result (application/vnd.refract.parse-result+json)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Compose API Blueprint from AST 2.0 sent as YAML (application/vnd.apiblueprint.ast+yaml; version=2.0)
:[](fixtures/apib/normal.apiblueprint.ast.yaml)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/normal.apib)
+ Request Compose API Blueprint from AST 2.0 sent as JSON (application/vnd.apiblueprint.ast+json; version=2.0)
:[](fixtures/apib/normal.apiblueprint.ast.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/normal.apib)
|
## API Description Composer [/composer]
Reverse the parsing process--compose an API description format.
### Compose [POST]
#### Input Media Types
##### API Elements
API Elements is supported, you can send an [API Elements API
Category](http://api-elements.readthedocs.io/en/latest/element-definitions/#category-base-api-element)
to the composer using the `application/vnd.refract+json` content type. You may
also send an [API Elements Parse
Result](http://api-elements.readthedocs.io/en/latest/element-definitions/#parse-result-elements)
as `application/vnd.refract.parse-result+json`.
```
application/vnd.refract+json
application/vnd.refract.parse-result+json
```
#### Output Media Types
##### API Blueprint
```
text/vnd.apiblueprint
```
API Blueprint as defined in its [specification](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md).
+ Relation: compose
+ Request Compose API Blueprint from API Elements API (application/vnd.refract+json)
:[](fixtures/apib/normal.refract.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Compose API Blueprint from API Elements Parse Result (application/vnd.refract.parse-result+json)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
|
Remove APIB AST composer
|
refactor: Remove APIB AST composer
|
API Blueprint
|
mit
|
apiaryio/api.apiblueprint.org,apiaryio/api.apiblueprint.org
|
c4084c20ba721be7c9d5d625c7749659cc4fd702
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2.
# Orchestrator Hooks
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
*Note:* Orchestrator does not clone the repository and simply use git information
as meta-information for locating totem.yml. This file need not be present in git repository and can be stored in other config providers like s3, etcd.
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo"
}
}
+ Response 200 (application/vnd.orch.task.v1+json)
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2.
# Orchestrator Hooks
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
*Note:* Orchestrator does not clone the repository and simply use git information
as meta-information for locating totem.yml. This file need not be present in git repository and can be stored in other config providers like s3, etcd.
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo"
}
}
+ Response 202 (application/vnd.orch.task.v1+json)
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
|
Add additional note for internal hook.
|
Add additional note for internal hook.
|
API Blueprint
|
mit
|
totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator
|
2af5a1960faaf99c9e2a6a94012e6452595db87e
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
Category related resources of the **Money Advice Service**.
## Categories Collection [/{locale}/categories.json]
A collection of categories including their subcategories
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Categories.
+ Values
+ `en`
+ `cy`
### Retrieve all Categories [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/categories>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "life-events",
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"subCategories": [
{
"id": "setting-up-home",
"title": "Setting up home",
"description": "Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n",
"subCategories": [
]
},
{
"id": "young-people-and-money",
"title": "Leaving school or college",
"description": "",
"subCategories": [
]
},
{
"id": "having-a-baby",
"title": "Having a baby",
"description": "",
"subCategories": [
]
}
]
},
{
"id": "managing-your-money",
"title": "Managing your money",
"description": "",
"subCategories": [
{
"id": "managing-your-money-better",
"title": "Managing your money",
"description": "How to take control of your money, make ends meet and make better financial decisions\n",
"subCategories": [
]
},
{
"id": "how-to-review-or-reduce-borrowing",
"title": "How to review or reduce borrowing",
"description": "Tips on cutting the cost of card debt, personal loans, car finance, catalogue or HP agreements and mortgage payments",
"subCategories": [
]
}
]
},
{
"id": "money-topics",
"title": "Money topics",
"description": "",
"subCategories": [
]
},
{
"id": "tools--resources",
"title": "Tools & resources",
"description": "",
"subCategories": [
]
},
{
"id": "news",
"title": "News",
"description": "",
"subCategories": [
]
}
]
## Category [/{locale}/categories/{id}]
A single category object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Category.
+ Values
+ `en`
+ `cy`
+ id (required, string, `life-events`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories/life-events>; rel="canonical"; title="Life events", <https://www.moneyadviceservice.org.uk/cy/categories/life-events>; rel="alternate"; hreflang="cy"; title="Digwyddiadau bywyd"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"contents":[
{
"id":"setting-up-home",
"type":"category",
"title":"Setting up home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"id":"how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you've moved in"
}
]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve an Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="canonical"; title="Where to go to get free debt advice", <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="canonical"; title="Action plan – Prepare for the cost of having a baby", <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
#Group Search
Search related resources of the **Money Advice Service**.
## Search [/{locale}/search?query={query_chain}]
A collection of search results
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Search.
+ Values
+ `en`
+ `cy`
+ query_chain (string, `health+check+house`) ... query of the search.
### Retrieve search results [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/search?query=budget+plan+house; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/search>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "manage-your-budget-after-redundancy",
"type": "action_plan",
"title": "Manage your budget after redundancy",
"description":"Use this step-by-step action plan to help you keep the household budget on track after redundancy."
},
{
"id": "new-baby-why-budget",
"type": "article",
"title": "New baby – why budget?",
"description":"If you find yourself saying that more and more, especially if there's a new baby on the scene, it's probably time to draw up a household budget and start planning your spending."
},
{
"id": "funeral-plans",
"title": "Funeral plans",
"type": "article",
"description":"A funeral plan is a way of paying for a future funeral today. Here are some things to bear in mind if you're thinking of taking one out."
},
{
"id": "how-to-make-your-money-go-further",
"type": "action_plan",
"title": "How to make your money go further",
"description":"Follow this action plan to help you save money around the home and when you're out and about, making your hard-earned cash go that bit further."
}
]
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
Category related resources of the **Money Advice Service**.
## Categories Collection [/{locale}/categories.json]
A collection of categories including their subcategories
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Categories.
+ Values
+ `en`
+ `cy`
### Retrieve all Categories [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/categories>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "life-events",
"type": "category",
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"contents": [
{
"id": "setting-up-home",
"type": "category",
"title": "Setting up home",
"description": "Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n",
"contents": [
]
},
{
"id": "young-people-and-money",
"type": "category",
"title": "Leaving school or college",
"description": "",
"contents": [
]
},
{
"id": "having-a-baby",
"type": "category",
"title": "Having a baby",
"description": "",
"contents": [
]
}
]
},
{
"id": "managing-your-money",
"type": "category",
"title": "Managing your money",
"description": "",
"contents": [
{
"id": "managing-your-money-better",
"type": "category",
"title": "Managing your money",
"description": "How to take control of your money, make ends meet and make better financial decisions\n",
"contents": [
]
},
{
"id": "how-to-review-or-reduce-borrowing",
"type": "category",
"title": "How to review or reduce borrowing",
"description": "Tips on cutting the cost of card debt, personal loans, car finance, catalogue or HP agreements and mortgage payments",
"contents": [
]
}
]
},
{
"id": "money-topics",
"type": "category",
"title": "Money topics",
"description": "",
"contents": [
]
},
{
"id": "tools--resources",
"type": "category",
"title": "Tools & resources",
"description": "",
"contents": [
]
},
{
"id": "news",
"type": "category",
"title": "News",
"description": "",
"contents": [
]
}
]
## Category [/{locale}/categories/{id}]
A single category object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Category.
+ Values
+ `en`
+ `cy`
+ id (required, string, `life-events`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories/life-events>; rel="canonical"; title="Life events", <https://www.moneyadviceservice.org.uk/cy/categories/life-events>; rel="alternate"; hreflang="cy"; title="Digwyddiadau bywyd"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"contents":[
{
"id":"setting-up-home",
"type":"category",
"title":"Setting up home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"id":"how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you've moved in"
}
]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve an Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="canonical"; title="Where to go to get free debt advice", <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="canonical"; title="Action plan – Prepare for the cost of having a baby", <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
#Group Search
Search related resources of the **Money Advice Service**.
## Search [/{locale}/search?query={query_chain}]
A collection of search results
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Search.
+ Values
+ `en`
+ `cy`
+ query_chain (string, `health+check+house`) ... query of the search.
### Retrieve search results [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/search?query=budget+plan+house; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/search>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "manage-your-budget-after-redundancy",
"type": "action_plan",
"title": "Manage your budget after redundancy",
"description":"Use this step-by-step action plan to help you keep the household budget on track after redundancy."
},
{
"id": "new-baby-why-budget",
"type": "article",
"title": "New baby – why budget?",
"description":"If you find yourself saying that more and more, especially if there's a new baby on the scene, it's probably time to draw up a household budget and start planning your spending."
},
{
"id": "funeral-plans",
"title": "Funeral plans",
"type": "article",
"description":"A funeral plan is a way of paying for a future funeral today. Here are some things to bear in mind if you're thinking of taking one out."
},
{
"id": "how-to-make-your-money-go-further",
"type": "action_plan",
"title": "How to make your money go further",
"description":"Follow this action plan to help you save money around the home and when you're out and about, making your hard-earned cash go that bit further."
}
]
|
Update mock categories response in line with the public_website API
|
Update mock categories response in line with the public_website API
See: https://github.com/moneyadviceservice/public_website/commit/1ba599d980df85870cd2fd2233eb7675ca30108b
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
2b40685f27207cec0a0406e554ac22318a59dfa5
|
doc/apiary/ngsi9-server.apib
|
doc/apiary/ngsi9-server.apib
|
FORMAT: 1A
HOST: https://app.apiary.io/ngsi9
TITLE: IoT Discovery GE Open API Specification
DATE: 01 September 2015
# FIWARE NGSI-9 API Core (v1)
The FIWARE version of the OMA NGSI-9 interface is a RESTful API via HTTP. Its purpose is to exchange information about the availability of context information. The three main interaction types are
* one-time queries for discovering hosts (also called 'agents' here) where certain context information is available
* subscriptions for context availability information updates (and the corresponding notifications)
* registration of context information, i.e. announcements that certain context information is available (invoked by context providers)
## Editors
+ Tarek Elsaleh, UNIS
## Acknowledgements
Fermin Galan (TID), Tobias Jacobs (NEC), Ken Gunner (TID), Salvatore Longo (NEC)
## Versions
+ This Version: http://
+ Previous version: http://
+ Latest version: http://
## Status
## Conformance
All the interfaces described by this specification are mandatory and must be implemented in order to be compliant with.
# Specification
This section is intended to describe the main concepts, constructs, data structures etc. used by your specification.
## Introduction
###Standard NGSI-9 Operation Resources
The five resources listed in the table below represent the five operations offered by systems that implement the NGSI-9 Context Management role. Each of these resources allows interaction via http POST. All attempts to interact by other verbs shall result in an HTTP error status 405; the server should then also include the ‘Allow: POST’ field in the response.
| Resource | Base URI: http://{serverRoot}/ngsi9 | HTTP verbs |
|----|----|----|
| | | POST|
|Context Registration Resource |/registerContext|Generic context registration. The expected request body is an instance of registerContextRequest; the response body is an instance of registerContextResponse.|
|Discovery resource|/discoverContextAvailability|Generic discovery of context information providers. The expected request body is an instance of discoverContextAvailabilityRequest; the response body is an instance of discoverContextAvailabilityResponse.|
|Availability subscription resource|/subscribeContextAvailability|Generic subscription to context availability information. The expected request body is an instance of subscribeContextAvailabilityRequest; the response body is an instance of subscribeContextAvailabilityResponse.|
|Availability subscription update resource|/updateContextAvailabilitySubscription|Generic update of context availability subscriptions. The expected request body is an instance of updateContextAvailabilitySubscriptionRequest; the response body is an instance of updateContextAvailabilitySubscriptionResponse.|
|Availability subscription deletion resource|/unsubscribeContextAvailability|Generic deletion of context availability subscriptions. The expected request body is an instance of unsubscribeContextAvailabilityRequest; the response body is an instance of unsubscribeContextAvailabilityResponse.|
|Notify context resource|/{notificationURI}|Generic availability notification.The expected request body is an instance of notifyContextAvailabilityRequest; the response body is an instance of notifyContextAvailabilityResponse.|
###Convenience Operation Resources
The table below gives an overview of the resources for convenience operation and the effects of interacting with them via the standard HTTP verbs GET, PUT, POST, and DELETE.
|Resource|Base URI: http://{serverRoot}/ngsi9|HTTP verbs||||
|----|----|----|----|----|----|----|
| | | GET|PUT|POST|DELETE|
|Individual context entity |/contextEntities/{EntityID}|Retrieve information on providers of any information about the context entity|-|Register a provider of information about the entity|-|
|Attribute container of individual context entity|/contextEntities/{EntityID}/attributes|Retrieve information on providers of any information about the context entity|-|Register a provider of information about the entity|-|
|Attribute of individual context entity|/contextEntities/{EntityID}/attributes/{attributeName}|Retrieve information on providers of the attribute value|-|Register a provider of information about the attribute|-|
|Attribute domain of individual context entity|/contextEntities/{EntityID}/attributeDomains/{attributeDomainName}|Retrieve information on providers of information about attribute values from the domain|-|Register a provider of information about attributes from the domain|-|
|Context entity type|/contextEntityTypes/{typeName}|Retrieve information on providers of any information about context entities of the type|-|Register a provider of information about context entitie of the type|-|
|Attribute container of entity type|/contextEntityTypes/{typeName}/attributes|Retrieve information on providers of any information about context entities of the type|-|Register a provider of information about context entitie of the type|-|
|Attribute of entity type|/contextEntityTypes/{typeName}/attributes/{attributeName}|Retrieve information on providers of values of this attribute of context entities of the type|-|Register a provider of information about this attribute of context entities of the type|-|
|Attribute domain of entity type|/contextEntityTypes/{typeName}/attributeDomains/{attributeDomainName}|Retrieve information on providers of attribute values belonging to the specific domain, where the entity is of the specific type|-|Register a provider of information about attributes belonging to the specific domain, where the entity is of the specific type|-|
|Availability subscription container|/contextAvailabilitySubscriptions|-|-|Create a new availability subscription|-|
|Availability subscription|/contextAvailabilitySubscriptions/{subscriptionID}|-|Update subscription|-|Cancel subscription
###API operation on Context Consumer Component
This section describes the resource that has to be provided by the context consumer in order to receive availability notifications. All attempts to interact with it by other verbs than POST shall result in an HTTP error status 405; the server should then also include the ‘Allow: POST’ field in the response.
|Resource|Base URI: http://{serverRoot}/ngsi9|HTTP verbs|
|----|----|----|
| | | POST|
|Notify context resource|//{callbackURL}|Generic availability notification.The expected request body is an instance of notifyContextAvailabilityRequest; the response body is an instance of notifyContextAvailabilityResponse.|
## Terminology
## Concepts
###Basic NGSI Context Management Information Model
####Entities
The central aspect of the NGSI-9/10 information model is the concept of entities. Entities are the virtual representation of all kinds of physical objects in the real world. Examples for physical entities are tables, rooms, or persons. Virtual entities have an identifier and a type. For example, a virtual entity representing a person named “John” could have the identifier “John” and the type “person”.
####Attributes
Any available information about physical entities is expressed in the form of attributes of virtual entities. Attributes have a name and a type as well. For example, the body temperature of John would be represented as an attribute having the name “body_temperature” and the type “temperature”. Values of such attributes are contained by value containers. This kind of container does not only consist of the actual attribute value, but also contains a set of metadata. Metadata is data about data; in in our body temperature example this metadata could represent the time of measurement, the measurement unit, and other information about the attribute value.
####Attribute Domains
There also is a concept of attribute domains in OMA NGSI 9/10. An attribute domain logically groups together a set of attributes. For example, the attribute domain "health_status" could comprise of the attributes "body_temperature" and "blood_pressure".
####Context Elements
The data structure used for exchanging information about entities is context element. A context element contains information about multiple attributes of one entity. The domain of these attributes can also be specified inside the context element; in this case all provided attribute values have to belong to that domain.
Formally, a context element contains the following information
an entity id and type
a list of triplets <attribute name, attribute type, attribute value> holding information about attributes of the entity
(optionally) the name of an attribute domain
(optionally) a list of triplets <metadata name, metadata type, metadata value> that apply to all attribute values of the given domain
NGSI Context Management Interfaces
OMA NGSI defines two interfaces for exchanging information based on the information model. The interface OMA NGSI-10 is used for exchanging information about entities and their attribute, i.e., attribute values and metadata. The interface OMA NGSI-9 is used for availability information about entities and their attributes. Here, instead of exchanging attribute values, information about which provider can provide certain attribute values is exchanged.
## Data Structures
# REST API
# Group Root
## NGSI-9 API [/]
### Register Context operation [POST /registerContext]
You may create your own request using this action. It takes a JSON
object containing a RegisterContextRequest message.
+ Request (application/json)
{
"contextRegistrations": [
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
},
{
"type": "Room",
"isPattern": "false",
"id": "Room2"
}
],
"attributes": [
{
"name": "temperature",
"type": "float",
"isDomain": "false"
},
{
"name": "pressure",
"type": "integer",
"isDomain": "false"
}
],
"providingApplication": "http://mysensors.com/Rooms"
}
],
"duration": "P1M"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"duration" : "P1M",
"registrationId" : "52a744b011f5816465943d58"
}
### Discover Context availability operation [POST /discoverContextAvailability]
You may create your own request using this action. It takes a JSON
object containing a discoverContextAvailabilityRequest message.
+ Request (application/json)
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [
"temperature"
]
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"contextRegistrationResponses": [
{
"contextRegistration": {
"attributes": [
{
"isDomain": "false",
"name": "temperature",
"type": "float"
}
],
"entities": [
{
"id": "Room1",
"isPattern": "false",
"type": "Room"
}
],
"providingApplication": "http://mysensors.com/Rooms"
}
}
]
}
### Subscribe to Context availability operation [POST /subscribeContextAvailability]
You may create your own request using this action. It takes a JSON
object containing a subscribeContextAvailability message.
+ Request (application/json)
{
"entities": [
{
"type": "Room",
"isPattern": "true",
"id": ".*"
}
],
"attributes": [
"temperature"
],
"reference": "http://localhost:8080/accumulate",
"duration": "P1M"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"duration": "P1M",
"subscriptionId": "52a745e011f5816465943d59"
}
### Update Subscription to Context availability operation [POST /updateContextAvailabilitySubscription]
You may create your own request using this action. It takes a JSON
object containing a updateContextAvailabilitySubscriptionRequest message.
+ Request (application/json)
{
"entities": [
{
"type": "Room",
"isPattern": "true",
"id": ".*"
}
],
"attributes": [
"temperature"
],
"reference": "http://localhost:8080/accumulate",
"duration": "P1M"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"duration": "P1M",
"subscriptionId": "52a745e011f5816465943d59"
}
### Unsubscribe to Context availability operation [POST /unsubscribeContextAvailability]
You may create your own request using this action. It takes a JSON
object containing a unsubscribeContextAvailabilityRequest message.
+ Request (application/json)
{
"subscriptionId": "52a745e011f5816465943d59"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
},
"subscriptionId": "52a745e011f5816465943d59"
}
### Notify Context availability operation [POST /{callbackURL}]
This operation is initiated by the NGSI-9 server, when a registration match a subscription. It sends a JSON
object containing a NotifyContextAvailabilityRequest message, and receives from the subscriber a NotifyContextAvailabilityResponse message
+ Request (application/json)
{
"subscriptionId": "52a745e011f5816465943d59",
"contextRegistrationResponses": [
{
"contextRegistration": {
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
},
{
"type": "Room",
"isPattern": "false",
"id": "Room2"
}
],
"attributes": [
{
"name": "temperature",
"type": "float",
"isDomain": "false",
"metadatas": [
{
"name": "accuracy",
"type": "float",
"value": "0.8"
}
]
}
],
"providingApplication": "http://mysensors.com/Rooms"
}
}
]
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
|
FORMAT: 1A
HOST: https://app.apiary.io/ngsi9
TITLE: IoT Discovery GE Open API Specification
DATE: 17/05/2016
# FIWARE NGSI-9 API Core (v1)
The FIWARE version of the OMA NGSI-9 interface is a RESTful API via HTTP. Its purpose is to exchange information about the availability of context information. The three main interaction types are
* one-time queries for discovering hosts (also called 'agents' here) where certain context information is available
* subscriptions for context availability information updates (and the corresponding notifications)
* registration of context information, i.e. announcements that certain context information is available (invoked by context providers)
## Editors
+ Tarek Elsaleh, UNIS
## Acknowledgements
Fermin Galan (TID), Tobias Jacobs (NEC), Ken Gunner (TID), Salvatore Longo (NEC)
## Versions
+ This Version: http://
+ Previous version: http://
+ Latest version: http://
## Status
## Conformance
All the interfaces described by this specification are mandatory and must be implemented in order to be compliant with.
# Specification
This section is intended to describe the main concepts, constructs, data structures etc. used by your specification.
## Introduction
###Standard NGSI-9 Operation Resources
The five resources listed in the table below represent the five operations offered by systems that implement the NGSI-9 Context Management role. Each of these resources allows interaction via http POST. All attempts to interact by other verbs shall result in an HTTP error status 405; the server should then also include the ‘Allow: POST’ field in the response.
| Resource | Base URI: http://{serverRoot}/ngsi9 | HTTP verbs |
|----|----|----|
| | | POST|
|Context Registration Resource |/registerContext|Generic context registration. The expected request body is an instance of registerContextRequest; the response body is an instance of registerContextResponse.|
|Discovery resource|/discoverContextAvailability|Generic discovery of context information providers. The expected request body is an instance of discoverContextAvailabilityRequest; the response body is an instance of discoverContextAvailabilityResponse.|
|Availability subscription resource|/subscribeContextAvailability|Generic subscription to context availability information. The expected request body is an instance of subscribeContextAvailabilityRequest; the response body is an instance of subscribeContextAvailabilityResponse.|
|Availability subscription update resource|/updateContextAvailabilitySubscription|Generic update of context availability subscriptions. The expected request body is an instance of updateContextAvailabilitySubscriptionRequest; the response body is an instance of updateContextAvailabilitySubscriptionResponse.|
|Availability subscription deletion resource|/unsubscribeContextAvailability|Generic deletion of context availability subscriptions. The expected request body is an instance of unsubscribeContextAvailabilityRequest; the response body is an instance of unsubscribeContextAvailabilityResponse.|
|Notify context resource|/{notificationURI}|Generic availability notification.The expected request body is an instance of notifyContextAvailabilityRequest; the response body is an instance of notifyContextAvailabilityResponse.|
###Convenience Operation Resources
The table below gives an overview of the resources for convenience operation and the effects of interacting with them via the standard HTTP verbs GET, PUT, POST, and DELETE.
|Resource|Base URI: http://{serverRoot}/ngsi9|HTTP verbs||||
|----|----|----|----|----|----|----|
| | | GET|PUT|POST|DELETE|
|Individual context entity |/contextEntities/{EntityID}|Retrieve information on providers of any information about the context entity|-|Register a provider of information about the entity|-|
|Attribute container of individual context entity|/contextEntities/{EntityID}/attributes|Retrieve information on providers of any information about the context entity|-|Register a provider of information about the entity|-|
|Attribute of individual context entity|/contextEntities/{EntityID}/attributes/{attributeName}|Retrieve information on providers of the attribute value|-|Register a provider of information about the attribute|-|
|Attribute domain of individual context entity|/contextEntities/{EntityID}/attributeDomains/{attributeDomainName}|Retrieve information on providers of information about attribute values from the domain|-|Register a provider of information about attributes from the domain|-|
|Context entity type|/contextEntityTypes/{typeName}|Retrieve information on providers of any information about context entities of the type|-|Register a provider of information about context entitie of the type|-|
|Attribute container of entity type|/contextEntityTypes/{typeName}/attributes|Retrieve information on providers of any information about context entities of the type|-|Register a provider of information about context entitie of the type|-|
|Attribute of entity type|/contextEntityTypes/{typeName}/attributes/{attributeName}|Retrieve information on providers of values of this attribute of context entities of the type|-|Register a provider of information about this attribute of context entities of the type|-|
|Attribute domain of entity type|/contextEntityTypes/{typeName}/attributeDomains/{attributeDomainName}|Retrieve information on providers of attribute values belonging to the specific domain, where the entity is of the specific type|-|Register a provider of information about attributes belonging to the specific domain, where the entity is of the specific type|-|
|Availability subscription container|/contextAvailabilitySubscriptions|-|-|Create a new availability subscription|-|
|Availability subscription|/contextAvailabilitySubscriptions/{subscriptionID}|-|Update subscription|-|Cancel subscription
###API operation on Context Consumer Component
This section describes the resource that has to be provided by the context consumer in order to receive availability notifications. All attempts to interact with it by other verbs than POST shall result in an HTTP error status 405; the server should then also include the ‘Allow: POST’ field in the response.
|Resource|Base URI: http://{serverRoot}/ngsi9|HTTP verbs|
|----|----|----|
| | | POST|
|Notify context resource|//{callbackURL}|Generic availability notification.The expected request body is an instance of notifyContextAvailabilityRequest; the response body is an instance of notifyContextAvailabilityResponse.|
## Terminology
## Concepts
###Basic NGSI Context Management Information Model
####Entities
The central aspect of the NGSI-9/10 information model is the concept of entities. Entities are the virtual representation of all kinds of physical objects in the real world. Examples for physical entities are tables, rooms, or persons. Virtual entities have an identifier and a type. For example, a virtual entity representing a person named “John” could have the identifier “John” and the type “person”.
####Attributes
Any available information about physical entities is expressed in the form of attributes of virtual entities. Attributes have a name and a type as well. For example, the body temperature of John would be represented as an attribute having the name “body_temperature” and the type “temperature”. Values of such attributes are contained by value containers. This kind of container does not only consist of the actual attribute value, but also contains a set of metadata. Metadata is data about data; in in our body temperature example this metadata could represent the time of measurement, the measurement unit, and other information about the attribute value.
####Attribute Domains
There also is a concept of attribute domains in OMA NGSI 9/10. An attribute domain logically groups together a set of attributes. For example, the attribute domain "health_status" could comprise of the attributes "body_temperature" and "blood_pressure".
####Context Elements
The data structure used for exchanging information about entities is context element. A context element contains information about multiple attributes of one entity. The domain of these attributes can also be specified inside the context element; in this case all provided attribute values have to belong to that domain.
Formally, a context element contains the following information
an entity id and type
a list of triplets <attribute name, attribute type, attribute value> holding information about attributes of the entity
(optionally) the name of an attribute domain
(optionally) a list of triplets <metadata name, metadata type, metadata value> that apply to all attribute values of the given domain
NGSI Context Management Interfaces
OMA NGSI defines two interfaces for exchanging information based on the information model. The interface OMA NGSI-10 is used for exchanging information about entities and their attribute, i.e., attribute values and metadata. The interface OMA NGSI-9 is used for availability information about entities and their attributes. Here, instead of exchanging attribute values, information about which provider can provide certain attribute values is exchanged.
## Data Structures
# REST API
# Group Root
## NGSI-9 API [/]
### Register Context operation [POST /registerContext]
You may create your own request using this action. It takes a JSON
object containing a RegisterContextRequest message.
+ Request (application/json)
{
"contextRegistrations": [
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
},
{
"type": "Room",
"isPattern": "false",
"id": "Room2"
}
],
"attributes": [
{
"name": "temperature",
"type": "float",
"isDomain": "false"
},
{
"name": "pressure",
"type": "integer",
"isDomain": "false"
}
],
"providingApplication": "http://mysensors.com/Rooms"
}
],
"duration": "P1M"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"duration" : "P1M",
"registrationId" : "52a744b011f5816465943d58"
}
### Discover Context availability operation [POST /discoverContextAvailability]
You may create your own request using this action. It takes a JSON
object containing a discoverContextAvailabilityRequest message.
+ Request (application/json)
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [
"temperature"
]
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"contextRegistrationResponses": [
{
"contextRegistration": {
"attributes": [
{
"isDomain": "false",
"name": "temperature",
"type": "float"
}
],
"entities": [
{
"id": "Room1",
"isPattern": "false",
"type": "Room"
}
],
"providingApplication": "http://mysensors.com/Rooms"
}
}
]
}
### Subscribe to Context availability operation [POST /subscribeContextAvailability]
You may create your own request using this action. It takes a JSON
object containing a subscribeContextAvailability message.
+ Request (application/json)
{
"entities": [
{
"type": "Room",
"isPattern": "true",
"id": ".*"
}
],
"attributes": [
"temperature"
],
"reference": "http://localhost:8080/accumulate",
"duration": "P1M"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"duration": "P1M",
"subscriptionId": "52a745e011f5816465943d59"
}
### Update Subscription to Context availability operation [POST /updateContextAvailabilitySubscription]
You may create your own request using this action. It takes a JSON
object containing a updateContextAvailabilitySubscriptionRequest message.
+ Request (application/json)
{
"entities": [
{
"type": "Room",
"isPattern": "true",
"id": ".*"
}
],
"attributes": [
"temperature"
],
"reference": "http://localhost:8080/accumulate",
"duration": "P1M"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"duration": "P1M",
"subscriptionId": "52a745e011f5816465943d59"
}
### Unsubscribe to Context availability operation [POST /unsubscribeContextAvailability]
You may create your own request using this action. It takes a JSON
object containing a unsubscribeContextAvailabilityRequest message.
+ Request (application/json)
{
"subscriptionId": "52a745e011f5816465943d59"
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
},
"subscriptionId": "52a745e011f5816465943d59"
}
### Notify Context availability operation [POST /{callbackURL}]
This operation is initiated by the NGSI-9 server, when a registration match a subscription. It sends a JSON
object containing a NotifyContextAvailabilityRequest message, and receives from the subscriber a NotifyContextAvailabilityResponse message
+ Request (application/json)
{
"subscriptionId": "52a745e011f5816465943d59",
"contextRegistrationResponses": [
{
"contextRegistration": {
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
},
{
"type": "Room",
"isPattern": "false",
"id": "Room2"
}
],
"attributes": [
{
"name": "temperature",
"type": "float",
"isDomain": "false",
"metadatas": [
{
"name": "accuracy",
"type": "float",
"value": "0.8"
}
]
}
],
"providingApplication": "http://mysensors.com/Rooms"
}
}
]
}
+ Response 201 (application/json)
+ Headers
Location: /ngsi9
+ Body
{
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
|
Update ngsi9-server.apib
|
Update ngsi9-server.apib
|
API Blueprint
|
agpl-3.0
|
UniSurreyIoT/fiware-iot-discovery-ngsi9,UniSurreyIoT/fiware-iot-discovery-ngsi9
|
0b2b25b004d0d9ee8fa1141554cb1aef36e08960
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://localhost:8001
# demo-faye
This is API blueprint document for my demo on Faye for **Android** and **Node.js**
## Structures
### Client side
This app has two component, Android and Web app.
You can use web app by hit the main page.
1. Android app
2. Web app (http://localhost:8001)
### Server side
The main duty of **Server** side is register new user and receiver user message for responding to the others.
# Web App [/]
You can enter the web chat interface with this API.
## Open Web App [GET]
+ Response 200 (text/html)
## Group Chat API
### Functions
* Register a new user
* Receive message from Server
* Send message to Server
* Notify others user whether a user is joined or left.
### Mechanism
When a **User** connects to server. He will input his username and push his `sessionId` and `username` to the **Server**.
After that, the **Server** will save the **User** information to database and response the `userId` to **User**.
Now, he can talk to other users. When he push a message. The **Server** will receive it and broadcasts to the others.
When a user *joins* or *leave* the room. Other people will be *notified* by **Server**.
### Register a new user [/chat/register]
**User** connects to the **Server** and acquire a `userId`
#### Send user information [POST]
+ Attributes
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
+ username: user (required, string) - Username of the user
+ Request (application/json)
+ Response 200
### Get userId from Server [/chat/register/{sessionId}]
**Server** will send the `userId` to **User** through this API. After **User** send `username` to **Server**
+ Parameters
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
#### Get userId [GET]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ Response 201 (application/json)
### Send message to users [/chat/public]
The **Server** will send message to the users through this api.
### Receive message from server [GET]
+ Attributes
+ text: user: message (required, string) - Message from user
+ Response 201 (application/json)
### Send message to server [/chat/public/server]
Due to the structure of **Faye**, we have to use **another** channel to transfer message from Client to Server.
> **Note:** a channel must have a **single responsibility** to maintain the **stability** of the application.
>
> A channel will be a **publisher** or **subscriber**.
#### Send message [POST]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ text: message (required, string) - Message from user
+ request (application/json)
+ response 200
### Notify user status to the others [/chat/join]
When a user join or log out, their status will be notified to the others.
#### Notify user status [GET]
+ Attributes
+ text: user has joined. (required, string) - User status
+ response 200 (application/json)
|
FORMAT: 1A
HOST: http://localhost:8001
# demo-faye
This is API blueprint document for my demo on Faye for **Android** and **Node.js**
## Structures
### Client side
This app has two component, Android and Web app.
You can use web app by hit the main page.
1. Android app
2. Web app (http://localhost:8001)
### Server side
The main duty of **Server** side is register new user and receiver user message for responding to the others.
# Web App [/]
You can enter the web chat interface with this API.
## Open Web App [GET]
+ Response 200 (text/html)
## Group Chat API
### Functions
* Register a new user
* Receive message from Server
* Send message to Server
* Notify others user whether a user is joined or left.
### Mechanism
When a **User** connects to **Server**. He will input his `username` and pushes his `sessionId` and `username` to the **Server**.
After that, the **Server** save the **User** information and response `userId` to **User**.
When he pushes a message. The **Server** will receive it and broadcasts to the others.
When a user *joins* or *leave* the room. Other people will be *notified* by **Server**.
### Register a new user [/chat/register]
**User** connects to the **Server** and acquire a `userId`
#### Send user information [POST]
+ Attributes
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
+ username: user (required, string) - Username of the user
+ Request (application/json)
+ Response 200
### Get userId from Server [/chat/register/{sessionId}]
**Server** will send the `userId` to **User** through this API. After **User** send `username` to **Server**
+ Parameters
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
#### Get userId [GET]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ Response 201 (application/json)
### Send message to users [/chat/public]
The **Server** will send message to the users through this api.
### Receive message from server [GET]
+ Attributes
+ text: user: message (required, string) - Message from user
+ Response 201 (application/json)
### Send message to server [/chat/public/server]
Due to the structure of **Faye**, we have to use **another** channel to transfer message from Client to Server.
> **Note:** a channel must have a **single responsibility** to maintain the **stability** of the application.
>
> A channel will be a **publisher** or **subscriber**.
#### Send message [POST]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ text: message (required, string) - Message from user
+ request (application/json)
+ response 200
### Notify user status to the others [/chat/join]
When a user join or log out, their status will be notified to the others.
#### Notify user status [GET]
+ Attributes
+ text: user has joined. (required, string) - User status
+ response 200 (application/json)
|
Update Chat server mechanism
|
Update Chat server mechanism
|
API Blueprint
|
mit
|
hckhanh/demo-faye,hckhanh/demo-faye,hckhanh/demo-faye,hckhanh/demo-faye
|
87a71f9305e43e67e22cd634e973b0a482211068
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://www.google.com
# Great British Public Toilet Map
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Notes
Notes related resources of the **Notes API**
## Notes Collection [/notes]
### List all Notes [GET]
+ Response 200 (application/json)
[{
"id": 1, "title": "Jogging in park"
}, {
"id": 2, "title": "Pick-up posters from post-office"
}]
### Create a Note [POST]
+ Request (application/json)
{ "title": "Buy cheese and bread for breakfast." }
+ Response 201 (application/json)
{ "id": 3, "title": "Buy cheese and bread for breakfast." }
## Note [/notes/{id}]
A single Note object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.
### Retrieve a Note [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{ "id": 2, "title": "Pick-up posters from post-office" }
### Remove a Note [DELETE]
+ Response 204
|
FORMAT: 1A
HOST: http://gbptm-stage.herokuapp.com/api
# Great British Public Toilet Map
The GBPTM API is a service for collection, submission and discovery of Public Toilets in the UK
# Group Loos
Loos related resources of the **GBPTM API**
## Loos Collection [/loos]
### List all Loos [GET]
+ Response 200 (application/json)
[{
"id": 1, "name": "Loo 1"
}, {
"id": 2, "name": "Loo 2"
}]
|
Tweak docs
|
Tweak docs
|
API Blueprint
|
mit
|
neontribe/gbptm,neontribe/gbptm,neontribe/gbptm,jimhbanks/gbptm
|
e9d42b747b731f4156bd12aa32082501f3eba48d
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://thedogapi.co.uk/api/v1
# DogAPI
This is a simple API for retrieving and/or posting images of dogs. There are plenty of these available for cats, so why not one for dogs?
## Get dog [/dog{?limit}]
+ Parameters
+ limit (optional) - The amount of dog images you want to get. Defaults to 1, and has a maximum of 20.
### Get a random dog [GET]
+ Response 200 (application/json)
{
"data": [
{
"id": "3UHaLkCuZvA",
"url": "https://i.redd.it/yz95pef6gn6z.jpg",
"time": "2017-06-30T03:57:20.073537",
"format": "jpeg",
"verified": 1
}
],
"count": 1,
"error": null,
"api_version": "v1"
}
## Add dog [/dog{?url}]
+ Parameters
+ url - The URL of your dog image that you want to add to the database.
### Add a dog to the database [POST]
+ Response 201 (application/json)
+ Body
{
"data": [
{
"id": "aBcDeFgHiJk",
"url": "yourDogImageURL",
"time": "2017-06-30T03:57:20.073537",
"format": "jpeg",
"verified": 0
}
],
"count": 1,
"error": null,
"api_version": "v1"
}
## Count database [/count]
### See how many dogs are in the database [GET]
+ Response 200 (application/json)
+ Body
{
"data": []
"count": 168,
"error": null,
"api_version": "v1"
}
|
FORMAT: 1A
HOST: https://api.thedogapi.co.uk/v2
# DogAPI
This is a simple API for retrieving and/or posting images of dogs. There are plenty of these available for cats, so why not one for dogs?
## Get dog [/dog.php{?limit,id}]
+ Parameters
+ limit (optional) - The amount of dog images you want to get. Defaults to 1, and has a maximum of 20.
+ id (optional) - The ID of a specific dog that you want to get. If specified, limit will be ignored.
### Get a random dog [GET]
+ Response 200 (application/json)
{
"data": [
{
"id": "3UHaLkCuZvA",
"url": "https://i.redd.it/yz95pef6gn6z.jpg",
"time": "2017-06-30T03:57:20.073537",
"format": "jpeg",
"checked": 1,
"verified": 1
}
],
"count": 1,
"error": null,
"api_version": "v2",
"response_code": 200
}
|
Update documentation from Apiary
|
Update documentation from Apiary
|
API Blueprint
|
apache-2.0
|
4Kaylum/DogAPI,4Kaylum/DogAPI,4Kaylum/DogAPI
|
474a5d11313ff4acab6094c35bbe834104e45271
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://github.com/SlvrEagle23/AzuraCast
# AzuraCast
AzuraCast is a standalone, turnkey web radio management tool. Radio stations hosted by AzuraCast expose a public API for viewing now playing data, making requests and more.
## Authenticating
Some request types require an API key, either to perform administrative steps or avoid public rate-limiting. API keys can be generated from the AzuraCast global administration panel. When making an authenticated request, any of the following methods can be used to supply the key:
* The "X-API-Key" HTTP header supplied in the request
* The "key" parameter supplied via GET or POST (?key=a1b2c3...)
* The "key" parameter embedded at the end of a URL (/api/nowplaying/index/key/a1b2c3.../)
## Important Notes
* Many API calls are cached for performance reasons, and some implement rate-limits to prevent flooding the system. Typically, calls authenticated with an API key have rate limits removed.
* API signatures may change between software versions. Check the GitHub repository for more information when updating.
* All timestamps in API calls are supplied as UNIX timestamps, i.e. seconds from 1/1/1970.
## Station "Short Codes"
In lieu of a station ID, some station-related API calls allow for what is called a "shortcode". This is the name of the station, in lower case, with its special characters removed. For example, "My Awesome Radio!" would become "my_awesome_radio".
## Song identifiers.
Most database entries have an auto-incrementing unique identifier, but songs use a hash-based identification system that avoids collisions based on spacing or punctuation differences.
# Group Now Playing
Retrieve "Now Playing" information about active stations.
### GET /nowplaying
Returns all now playing data for active stations.
+ Response 200 (application/json)
{
status: "success",
result: [
{
station: {
id: 1,
name: "Pony Radio Station",
shortcode: "pony_radio_station"
},
current_song: {
id: "178ebfae95842a543f30a449f2420125",
text: "YourEnigma - On Hold (Feat. Rhyme Flow)",
artist: "YourEnigma",
title: "On Hold (Feat. Rhyme Flow)",
created: 1472973486,
play_count: 2,
last_played: 1473192908,
sh_id: null
},
listeners: {
current: 0,
unique: 0,
total: 0
},
meta: {
status: "online",
bitrate: null,
format: "audio/mpeg"
},
song_history: [
{
played_at: 1473192663,
song: {
id: "86125d7861a62e19b773a5911b490675",
text: "PhonyBrony, Feather - I'll Show You My Loyalty (1st Capital Rock Version)",
artist: "PhonyBrony, Feather",
title: "I'll Show You My Loyalty (1st Capital Rock Version)",
created: 1472973505,
play_count: 2,
last_played: 1473192663
}
},
{
played_at: 1473192423,
song: {
id: "d631a2196db79ab1e6b5e8e0db69dea4",
text: "StormWolf - BBBFF (Stormwolf Remix)",
artist: "StormWolf",
title: "BBBFF (Stormwolf Remix)",
created: 1472973497,
play_count: 3,
last_played: 1473192423
}
}
],
cache: "database"
}
]
}
### GET /nowplaying/index/id/{id}
**Station Specified by Numeric ID**
Returns a single station's now-playing information based on a station identifier.
+ Parameters
+ id (number, required) - The station ID.
+ Response 200 (application/json)
{
status: "success",
result: {
station: {
id: 1,
name: "Pony Radio Station",
shortcode: "pony_radio_station"
},
current_song: {
id: "178ebfae95842a543f30a449f2420125",
text: "YourEnigma - On Hold (Feat. Rhyme Flow)",
artist: "YourEnigma",
title: "On Hold (Feat. Rhyme Flow)",
created: 1472973486,
play_count: 2,
last_played: 1473192908,
sh_id: null
},
listeners: {
current: 0,
unique: 0,
total: 0
},
meta: {
status: "online",
bitrate: null,
format: "audio/mpeg"
},
song_history: [
{
played_at: 1473192663,
song: {
id: "86125d7861a62e19b773a5911b490675",
text: "PhonyBrony, Feather - I'll Show You My Loyalty (1st Capital Rock Version)",
artist: "PhonyBrony, Feather",
title: "I'll Show You My Loyalty (1st Capital Rock Version)",
created: 1472973505,
play_count: 2,
last_played: 1473192663
}
},
{
played_at: 1473192423,
song: {
id: "d631a2196db79ab1e6b5e8e0db69dea4",
text: "StormWolf - BBBFF (Stormwolf Remix)",
artist: "StormWolf",
title: "BBBFF (Stormwolf Remix)",
created: 1472973497,
play_count: 3,
last_played: 1473192423
}
}
],
cache: "database"
}
}
### GET /nowplaying/index/station/{shortcode}
**Station Specified by Shortcode**
Returns a single station's now-playing information based on a station's "short code" identifier.
+ Parameters
+ shortcode (string, required) - The station "short code" identifier.
+ Response 200 (application/json)
{
status: "success",
result: {
station: {
id: 1,
name: "Pony Radio Station",
shortcode: "pony_radio_station"
},
current_song: {
id: "178ebfae95842a543f30a449f2420125",
text: "YourEnigma - On Hold (Feat. Rhyme Flow)",
artist: "YourEnigma",
title: "On Hold (Feat. Rhyme Flow)",
created: 1472973486,
play_count: 2,
last_played: 1473192908,
sh_id: null
},
listeners: {
current: 0,
unique: 0,
total: 0
},
meta: {
status: "online",
bitrate: null,
format: "audio/mpeg"
},
song_history: [
{
played_at: 1473192663,
song: {
id: "86125d7861a62e19b773a5911b490675",
text: "PhonyBrony, Feather - I'll Show You My Loyalty (1st Capital Rock Version)",
artist: "PhonyBrony, Feather",
title: "I'll Show You My Loyalty (1st Capital Rock Version)",
created: 1472973505,
play_count: 2,
last_played: 1473192663
}
},
{
played_at: 1473192423,
song: {
id: "d631a2196db79ab1e6b5e8e0db69dea4",
text: "StormWolf - BBBFF (Stormwolf Remix)",
artist: "StormWolf",
title: "BBBFF (Stormwolf Remix)",
created: 1472973497,
play_count: 3,
last_played: 1473192423
}
}
],
cache: "database"
}
}
# Group Stations
Information about the service's hosted radio stations.
### GET /stations/list
List all stations from all categories.
+ Response 200 (application/json)
{
status: "success",
result: [
{
id: 1,
name: "Best Pony Radio",
shortcode: "best_pony_radio"
}
]
}
### GET /stations/index/id/{id}
Station info for the specified numeric identifier.
+ Parameters
+ id (number, required) - The station ID.
+ Response 200 (application/json)
{
status: "success",
result: {
id: 1,
name: "Best Pony Radio",
shortcode: "best_pony_radio"
}
}
### GET /stations/index/station/{shortcode}
Station info for the specified shortcode.
+ Parameters
+ shortcode (string, required) - The station "short code" identifier.
+ Response 200 (application/json)
{
status: "success",
result: {
id: 1,
name: "Best Pony Radio",
shortcode: "best_pony_radio"
}
}
# Group Song Requests
Information about available tracks that can be requested, and functionality to submit those requests programmatically.
### GET /requests/list/id/{id}
Get all currently requestable songs from the specified station.
+ Parameters
+ id (number, required) - The station ID.
+ Response 200 (application/json)
{
status: "success",
result: [
{
song: {
id: "b0df73b9260ea324ec873c8a6f90f0dc",
text: "BlackGryph0n/Baasik - Crusader (Are We There Yet)",
artist: "BlackGryph0n/Baasik",
title: "Crusader (Are We There Yet)",
created: 1472973479,
play_count: 2,
last_played: 1473029524
},
request_song_id: 5,
request_url: "/api/requests/submit/id/1/song_id/5"
},
{
song: {
id: "feea15c78f90b918d71b00972e051e19",
text: "Aviators/Omnipony - Monster",
artist: "Aviators/Omnipony",
title: "Monster",
created: 1472973479,
play_count: 4,
last_played: 1473179043
},
request_song_id: 10,
request_url: "/api/requests/submit/id/1/song_id/10"
}
]
}
### POST /requests/submit/id/{station_id}/song_id/{song_id}
Submit a request for a station to play a song with the specified ID.
+ Parameters
+ station_id (number, required) - The station ID.
+ song_id (number, required) - The song ID (supplied from the /requests/list endpoint)
+ Response 200 (application/json)
{
status: "success",
result: "Request submitted successfully."
}
# Group Utilities
Utility functions to verify the functionality of the system.
### GET /
The homepage of the API, that provides a basic ping function and a link to this documentation.
+ Response 200 (application/json)
{
status: "success",
result: "The AzuraCast API is online and functioning."
}
### GET /index/status
A basic ping function that returns the current UNIX timestamp (for caching tests).
+ Response 200 (application/json)
{
status: "success",
result: {
online: "true",
timestamp: 0123456789
}
}
### GET /index/time
Return the server's timezone configuration, as well as several formats of the current UTC and localized timestamp.
+ Response 200 (application/json)
{
status: "success",
result: {
timestamp: 1473194546,
gmt_datetime: "2016-09-06 8:42:26",
gmt_date: "September 6, 2016",
gmt_time: "8:42pm",
gmt_timezone: "GMT",
gmt_timezone_abbr: "GMT",
local_datetime: "2016-09-06 3:42:26",
local_date: "September 6, 2016",
local_time: "3:42pm",
local_timezone: "US/Central",
local_timezone_abbr: "CDT"
}
}
|
FORMAT: 1A
HOST: http://localhost:8080/api
# AzuraCast
AzuraCast is a standalone, turnkey web radio management tool. Radio stations hosted by AzuraCast expose a public API for viewing now playing data, making requests and more.
## Authenticating
Some request types require an API key, either to perform administrative steps or avoid public rate-limiting. API keys can be generated from the AzuraCast global administration panel. When making an authenticated request, any of the following methods can be used to supply the key:
* The "X-API-Key" HTTP header supplied in the request
* The "key" parameter supplied via GET or POST (?key=a1b2c3...)
* The "key" parameter embedded at the end of a URL (/api/nowplaying/index/key/a1b2c3.../)
## Important Notes
* Many API calls are cached for performance reasons, and some implement rate-limits to prevent flooding the system. Typically, calls authenticated with an API key have rate limits removed.
* API signatures may change between software versions. Check the GitHub repository for more information when updating.
* All timestamps in API calls are supplied as UNIX timestamps, i.e. seconds from 1/1/1970.
## Station "Short Codes"
In lieu of a station ID, some station-related API calls allow for what is called a "shortcode". This is the name of the station, in lower case, with its special characters removed. For example, "My Awesome Radio!" would become "my_awesome_radio".
## Song identifiers.
Most database entries have an auto-incrementing unique identifier, but songs use a hash-based identification system that avoids collisions based on spacing or punctuation differences.
# Group Now Playing
Retrieve "Now Playing" information about active stations.
### GET /nowplaying
Returns all now playing data for active stations.
+ Response 200 (application/json)
{
status: "success",
result: [
{
station: {
id: 1,
name: "Pony Radio Station",
shortcode: "pony_radio_station"
},
current_song: {
id: "178ebfae95842a543f30a449f2420125",
text: "YourEnigma - On Hold (Feat. Rhyme Flow)",
artist: "YourEnigma",
title: "On Hold (Feat. Rhyme Flow)",
created: 1472973486,
play_count: 2,
last_played: 1473192908,
sh_id: null
},
listeners: {
current: 0,
unique: 0,
total: 0
},
meta: {
status: "online",
bitrate: null,
format: "audio/mpeg"
},
song_history: [
{
played_at: 1473192663,
song: {
id: "86125d7861a62e19b773a5911b490675",
text: "PhonyBrony, Feather - I'll Show You My Loyalty (1st Capital Rock Version)",
artist: "PhonyBrony, Feather",
title: "I'll Show You My Loyalty (1st Capital Rock Version)",
created: 1472973505,
play_count: 2,
last_played: 1473192663
}
},
{
played_at: 1473192423,
song: {
id: "d631a2196db79ab1e6b5e8e0db69dea4",
text: "StormWolf - BBBFF (Stormwolf Remix)",
artist: "StormWolf",
title: "BBBFF (Stormwolf Remix)",
created: 1472973497,
play_count: 3,
last_played: 1473192423
}
}
],
cache: "database"
}
]
}
### GET /nowplaying/index/id/{id}
**Station Specified by Numeric ID**
Returns a single station's now-playing information based on a station identifier.
+ Parameters
+ id (number, required) - The station ID.
+ Response 200 (application/json)
{
status: "success",
result: {
station: {
id: 1,
name: "Pony Radio Station",
shortcode: "pony_radio_station"
},
current_song: {
id: "178ebfae95842a543f30a449f2420125",
text: "YourEnigma - On Hold (Feat. Rhyme Flow)",
artist: "YourEnigma",
title: "On Hold (Feat. Rhyme Flow)",
created: 1472973486,
play_count: 2,
last_played: 1473192908,
sh_id: null
},
listeners: {
current: 0,
unique: 0,
total: 0
},
meta: {
status: "online",
bitrate: null,
format: "audio/mpeg"
},
song_history: [
{
played_at: 1473192663,
song: {
id: "86125d7861a62e19b773a5911b490675",
text: "PhonyBrony, Feather - I'll Show You My Loyalty (1st Capital Rock Version)",
artist: "PhonyBrony, Feather",
title: "I'll Show You My Loyalty (1st Capital Rock Version)",
created: 1472973505,
play_count: 2,
last_played: 1473192663
}
},
{
played_at: 1473192423,
song: {
id: "d631a2196db79ab1e6b5e8e0db69dea4",
text: "StormWolf - BBBFF (Stormwolf Remix)",
artist: "StormWolf",
title: "BBBFF (Stormwolf Remix)",
created: 1472973497,
play_count: 3,
last_played: 1473192423
}
}
],
cache: "database"
}
}
### GET /nowplaying/index/station/{shortcode}
**Station Specified by Shortcode**
Returns a single station's now-playing information based on a station's "short code" identifier.
+ Parameters
+ shortcode (string, required) - The station "short code" identifier.
+ Response 200 (application/json)
{
status: "success",
result: {
station: {
id: 1,
name: "Pony Radio Station",
shortcode: "pony_radio_station"
},
current_song: {
id: "178ebfae95842a543f30a449f2420125",
text: "YourEnigma - On Hold (Feat. Rhyme Flow)",
artist: "YourEnigma",
title: "On Hold (Feat. Rhyme Flow)",
created: 1472973486,
play_count: 2,
last_played: 1473192908,
sh_id: null
},
listeners: {
current: 0,
unique: 0,
total: 0
},
meta: {
status: "online",
bitrate: null,
format: "audio/mpeg"
},
song_history: [
{
played_at: 1473192663,
song: {
id: "86125d7861a62e19b773a5911b490675",
text: "PhonyBrony, Feather - I'll Show You My Loyalty (1st Capital Rock Version)",
artist: "PhonyBrony, Feather",
title: "I'll Show You My Loyalty (1st Capital Rock Version)",
created: 1472973505,
play_count: 2,
last_played: 1473192663
}
},
{
played_at: 1473192423,
song: {
id: "d631a2196db79ab1e6b5e8e0db69dea4",
text: "StormWolf - BBBFF (Stormwolf Remix)",
artist: "StormWolf",
title: "BBBFF (Stormwolf Remix)",
created: 1472973497,
play_count: 3,
last_played: 1473192423
}
}
],
cache: "database"
}
}
# Group Stations
Information about the service's hosted radio stations.
### GET /stations/list
List all stations from all categories.
+ Response 200 (application/json)
{
status: "success",
result: [
{
id: 1,
name: "Best Pony Radio",
shortcode: "best_pony_radio"
}
]
}
### GET /stations/index/id/{id}
Station info for the specified numeric identifier.
+ Parameters
+ id (number, required) - The station ID.
+ Response 200 (application/json)
{
status: "success",
result: {
id: 1,
name: "Best Pony Radio",
shortcode: "best_pony_radio"
}
}
### GET /stations/index/station/{shortcode}
Station info for the specified shortcode.
+ Parameters
+ shortcode (string, required) - The station "short code" identifier.
+ Response 200 (application/json)
{
status: "success",
result: {
id: 1,
name: "Best Pony Radio",
shortcode: "best_pony_radio"
}
}
# Group Song Requests
Information about available tracks that can be requested, and functionality to submit those requests programmatically.
### GET /requests/list/id/{id}
Get all currently requestable songs from the specified station.
+ Parameters
+ id (number, required) - The station ID.
+ Response 200 (application/json)
{
status: "success",
result: [
{
song: {
id: "b0df73b9260ea324ec873c8a6f90f0dc",
text: "BlackGryph0n/Baasik - Crusader (Are We There Yet)",
artist: "BlackGryph0n/Baasik",
title: "Crusader (Are We There Yet)",
created: 1472973479,
play_count: 2,
last_played: 1473029524
},
request_song_id: 5,
request_url: "/api/requests/submit/id/1/song_id/5"
},
{
song: {
id: "feea15c78f90b918d71b00972e051e19",
text: "Aviators/Omnipony - Monster",
artist: "Aviators/Omnipony",
title: "Monster",
created: 1472973479,
play_count: 4,
last_played: 1473179043
},
request_song_id: 10,
request_url: "/api/requests/submit/id/1/song_id/10"
}
]
}
### POST /requests/submit/id/{station_id}/song_id/{song_id}
Submit a request for a station to play a song with the specified ID.
+ Parameters
+ station_id (number, required) - The station ID.
+ song_id (number, required) - The song ID (supplied from the /requests/list endpoint)
+ Response 200 (application/json)
{
status: "success",
result: "Request submitted successfully."
}
# Group Utilities
Utility functions to verify the functionality of the system.
### GET /
The homepage of the API, that provides a basic ping function and a link to this documentation.
+ Response 200 (application/json)
{
status: "success",
result: "The AzuraCast API is online and functioning."
}
### GET /index/status
A basic ping function that returns the current UNIX timestamp (for caching tests).
+ Response 200 (application/json)
{
status: "success",
result: {
online: "true",
timestamp: 0123456789
}
}
### GET /index/time
Return the server's timezone configuration, as well as several formats of the current UTC and localized timestamp.
+ Response 200 (application/json)
{
status: "success",
result: {
timestamp: 1473194546,
gmt_datetime: "2016-09-06 8:42:26",
gmt_date: "September 6, 2016",
gmt_time: "8:42pm",
gmt_timezone: "GMT",
gmt_timezone_abbr: "GMT",
local_datetime: "2016-09-06 3:42:26",
local_date: "September 6, 2016",
local_time: "3:42pm",
local_timezone: "US/Central",
local_timezone_abbr: "CDT"
}
}
|
Update the base URL to something that might possibly work.
|
Update the base URL to something that might possibly work.
|
API Blueprint
|
agpl-3.0
|
AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast,AzuraCast/AzuraCast
|
c094c828cc9a1f7ee575775dcc8b3fce2df966f5
|
doc/horizon.apib
|
doc/horizon.apib
|
FORMAT: 1A
# Horizon
The horizon description goes here
## Account [/accounts/{address}]
Represents the current state of an account as of the latest closed
ledger imported by horizon.
+ Model (application/hal+json)
{
"_links": {
"self": {
"href": "/accounts/gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs"
},
"transactions": {
"href": "/accounts/gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs/transactions{?order}{?limit}{?after}{?before}"
}
},
"id": "gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs",
"address": "gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs",
"sequence": 3,
"balances": [{
"currency": {
"type": "native"
},
"balance": 100000000
},{
"currency": {
"type": "iso4217",
"code": "USD",
"issuers": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
},
"balance": 100000000
}],
}
### View account details [GET]
+ Parameters
+ address (required, string, `gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs`) ... Address of an account
+ Response 200
[Account][]
## Transaction [/transactions/{hash}]
Represents a single transaction that has been submitted and validated by the stellar network
+ Model (application/hal+json)
{
"_links": {
"self": {
"href": "/transactions/4774bce2ddf7cf9332d5f97ab7f7bff115291d5598c7eec827f43ca58bd4fa06"
},
"account": {
"href": "/accounts/gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
}
},
"hash": "4774bce2ddf7cf9332d5f97ab7f7bff115291d5598c7eec827f43ca58bd4fa06",
"ledger": 7,
"application_order": [
7,
2
],
"account": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7",
"account_sequence": 2,
"max_fee": 10,
"fee_paid": 10,
"operation_count": 1,
}
### View transaction's details [GET]
+ Parameters
+ hash (required, string, `0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54`) ... The hex-encoded hash of a transaction
+ Response 200
[Transaction][]
## Transaction Collection [/transactions{?order}{?limit}{?after}]
+ Model (application/hal+json)
{
"_links": {
"next": {
"href": "/transactions?after=373a31&limit=1&order=asc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "/transactions/0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54"
},
"account": {
"href": "/accounts/gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
}
},
"hash": "0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54",
"ledger": 7,
"application_order": [
7,
1
],
"account": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7",
"account_sequence": 1,
"max_fee": 10,
"fee_paid": 10,
"operation_count": 1
}
]
}
}
### View a page of transaction history [GET]
+ Parameters
+ after (optional, string, `373a31`) ... A paging token
+ limit (optional, number, `10`) ... The maximum number of transactions to return in the response
+ order (string)
The order to traverse the transaction collection
+ Values
+ `asc`
+ `desc`
+ Response 200
[Transaction Collection][]
### Submitting a transaction [POST]
+ Parameters
+ tx (required, string, `ffffff`) ... The hex-encoded xdr form of the transaction to be submitted
+ Request (application/x-www-form-urlencoded)
tx=fffff
+ Response 200 (application/hal+json)
{}
|
FORMAT: 1A
# Horizon
The horizon description goes here
## Account [/accounts/{address}]
Represents the current state of an account as of the latest closed
ledger imported by horizon.
+ Model (application/hal+json)
{
"_links": {
"self": {
"href": "/accounts/gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs"
},
"transactions": {
"href": "/accounts/gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs/transactions{?order}{?limit}{?after}{?before}"
}
},
"id": "gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs",
"address": "gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs",
"sequence": 3,
"balances": [{
"currency": {
"type": "native"
},
"balance": 100000000
},{
"currency": {
"type": "iso4217",
"code": "USD",
"issuers": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
},
"balance": 100000000
}],
}
### View account details [GET]
+ Parameters
+ address (required, string, `gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs`) ... Address of an account
+ Response 200
[Account][]
## Transaction [/transactions/{hash}]
Represents a single transaction that has been submitted and validated by the stellar network
+ Model (application/hal+json)
{
"_links": {
"self": {
"href": "/transactions/4774bce2ddf7cf9332d5f97ab7f7bff115291d5598c7eec827f43ca58bd4fa06"
},
"account": {
"href": "/accounts/gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
}
},
"hash": "4774bce2ddf7cf9332d5f97ab7f7bff115291d5598c7eec827f43ca58bd4fa06",
"ledger": 7,
"application_order": [
7,
2
],
"account": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7",
"account_sequence": 2,
"max_fee": 10,
"fee_paid": 10,
"operation_count": 1,
}
### View transaction's details [GET]
+ Parameters
+ hash (required, string, `0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54`) ... The hex-encoded hash of a transaction
+ Response 200
[Transaction][]
## Transaction Collection [/transactions{?order}{?limit}{?after}]
+ Model (application/hal+json)
{
"_links": {
"next": {
"href": "/transactions?after=373a31&limit=1&order=asc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "/transactions/0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54"
},
"account": {
"href": "/accounts/gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
}
},
"hash": "0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54",
"ledger": 7,
"application_order": [
7,
1
],
"account": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7",
"account_sequence": 1,
"max_fee": 10,
"fee_paid": 10,
"operation_count": 1
}
]
}
}
### View a page of transaction history [GET]
+ Parameters
+ after (optional, string, `373a31`) ... A paging token
+ limit (optional, number, `10`) ... The maximum number of transactions to return in the response
+ order (string)
The order to traverse the transaction collection
+ Values
+ `asc`
+ `desc`
+ Response 200
[Transaction Collection][]
### Submitting a transaction [POST]
+ Parameters
+ tx (required, string, `ffffff`) ... The hex-encoded xdr form of the transaction to be submitted
+ Request (application/x-www-form-urlencoded)
tx=fffff
+ Response 200 (application/hal+json)
{
"hash": "67071d24b1859ea5f2f5315961ab84accebea8f6ec907aed728d172ba7058acf",
"result": "already_finished",
"submission_result": null,
"_links": {
"transaction": {
"href": "/transactions/67071d24b1859ea5f2f5315961ab84accebea8f6ec907aed728d172ba7058acf"
}
}
}
+ Response 201 (application/hal+json)
{
"hash": "64672a11e41f1e0530e49dcf6aedd3cf00ba4314ed240f18dfaad6730d1a9afc",
"result": "received",
"submission_result": "000000000000000a0000000000000001000000000000000000000000"
}
## Friendbot (Currency Faucet) [/friendbot]
When configured with a secret key, horizon can fund accounts to help you test your applications. Friendbot gives them out.
### Fund Account [POST]
+ Request (application/x-www-form-urlencoded)
addr=gsaKhsFcxHmo3PMeCHrvHJAcqJrLhy11WexgUiwRMmz7cpKV55w
+ Response 200 (application/hal+json)
{
"hash": "64672a11e41f1e0530e49dcf6aedd3cf00ba4314ed240f18dfaad6730d1a9afc",
"result": "received",
"submission_result": "000000000000000a0000000000000001000000000000000000000000"
}
+ Response 404 (application/hal+json)
{
"type": "not_found",
"status": 404,
"title": "Resource Missing",
"instance": "request://08a9edea-a20c-4b93-95b5-fdfff985b4c9"
}
|
Add friendbot to api blueprint
|
Add friendbot to api blueprint
|
API Blueprint
|
apache-2.0
|
stellar/horizon-importer,FredericHeem/horizon,masonforest/horizon-importer,Payshare/horizon,malandrina/horizon,matschaffer/horizon
|
0581734bb6952f51ef6d3b9908b6a042b72e8146
|
src/api.apib
|
src/api.apib
|
FORMAT: 1A
# YOUR AWESOME API NAME
*This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.*
## Authentication
+ This API uses [JWT](http://jwt.io/) for authentication,
+ Every token MUST be refreshed before its expiration time,
+ Token MUST be provided in `Authorization` header,
+ Toke MUST be provided for each request that requires authentication,
+ This API issues a **long-lived access tokens** for consumers. A long-lived JWT generally SHOULD lasts about **30 days**. If no requests are made, the token MUST expire and the user MUST go through the login flow again to get a new one.
### Example Header
```
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhNnZoQW8zRkc3dDEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE0NzA1OTg5NzIsImV4cCI6MTQ3MDY4NTM3Mn0.ltA9zZmJKszBJuuV7pTWtY7LzLXrRUfebJDhy_jGMeM
```
### Claims
+ `exp` - The exp ( *expiration time* ) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing.
+ `iat` - The iat ( *issued at* ) claim identifies the time at which the JWT was issued.
+ `sub` - The aud ( *audience* ) claim identifies the subject of this token (for e.g. a user id).
+ `iss` - The iss ( *issuer* ) claim identifies the principal that issued the JWT.
## Consumer Identification
This API uses `User-Agent` and `Application-Id` headers to identify API consumer. `Application-Id` MUST contain an UUID that uniquely identifies a particular consumer installation.
### Example Headers
```
User-Agent: Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Application-Id: 6454d937-0a18-44a8-b482-bb48684f1ed4
```
## Filtering, Ordering, Pagination & Searching
### Filtering
This API can filter returned collections based on provided query parameters. Virtually any model field can be used as a filter.
For example, when requesting a list of movies from the /movies endpoint, you may want to limit these to only those of drama genre. This could be accomplished with a request like `GET /movies?genre=drama`. Here, genre is a query parameter that implements a filter.
### Ordering
This API can sort returned collections. A generic query parameter `sort` is used to describe sorting rules. This parameter can take a list of comma separated field, each with a possible unary negative to imply descending sort order.
E.g. `GET /movies?sort=-rating` - Retrieves a list of movies in descending order of user rating.
By default all resources are ordered by their creation time, from newest to oldest.
### Pagintation
This API uses the [Link header - RFC 5988](http://tools.ietf.org/html/rfc5988#page-6) to include pagination details.
An example of a Link header is described in [GitHub documentation](https://developer.github.com/guides/traversing-with-pagination/).
This API returns total count of paged resources in `Total-Count` HTTP header.
### Searching
This API uses a generic parameter `search` to expose a full text search mechanism.
## HTTP Methods
This API uses HTTP verbs (methods) as following:
+ `GET` - *Read* - used to **read** (or retrieve) a representation of a resource,
+ `POST` - *Create* - used to **create** new resources. In particular, it's used to create subordinate resources.
+ `PUT` - *Update/Replace* - used for **update** capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. ⚠️ On successful request, replaces identified resource with the request body.
+ `PATCH` - *Update/Modify* - used for **modify** capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
+ `DELETE` - *Delete* - used to **delete** a resource identified by a URI.
## Localization
This API uses `Accept-Language` header to identify the locale.
`Accept-Language: en`
This header SHOULD be present in every request. If not, API MUST use the **english** language/locale.
## Media Type
Where applicable this API MUST use the JSON media-type. Requests with a message-body are using plain JSON to set or update resource states.
`Content-type: application/json` and `Accept: application/json` headers SHOULD be set on all requests if not stated otherwise.
## Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
## Representation of Date and Time
All exchange of date and time-related data MUST be done according to ISO 8601 standard and stored in UTC.
When returning date and time-related data `YYYY-MM-DDThh:mm:ss.SSSZ` format MUST be used.
## Resource IDs
This API uses short non-sequential url-friendly unique ids. Every resource id MUST consists of 9 url-friendly characters: `A-Z`, `a-z`, `0-9`, `_` and `-`.
### Example
`a6vhAo3FG7t1`
## Status Codes and Errors
This API uses HTTP status codes to communicate with the API consumer.
+ `200 OK` - Response to a successful GET, PUT, PATCH or DELETE.
+ `201 Created` - Response to a POST that results in a creation.
+ `204 No Content` - Response to a successful request that won't be returning a body (like a DELETE request).
+ `400 Bad Request` - Malformed request; form validation errors.
+ `401 Unauthorized` - When no or invalid authentication details are provided.
+ `403 Forbidden` - When authentication succeeded but authenticated user doesn't have access to the resource.
+ `404 Not Found` - When a non-existent resource is requested.
+ `405 Method Not Allowed` - Method not allowed.
+ `406 Not Acceptable` - Could not satisfy the request Accept header.
+ `415 Unsupported Media Type` - Unsupported media type in request.
### Error response
This API returns both, machine-readable error codes and human-readable error messages in response body when an error is encountered.
#### Example
##### Validation Error
```js
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid query parameters",
"data": {
"code": 10003,
"validation": {
"details":[
{
"message": "\"name\" is required",
"path": "name",
"type": "any.required",
"context": {
"key": "name"
}
},{
"message": "\"email\" must be a valid email",
"path": "email",
"type": "string.email",
"context": {
"value": "foo",
"key": "email"
}
}
],
"source": "query",
"keys": [ "name","email" ]
}
}
}
```
##### Generic Error
```js
{
"statusCode": 403,
"error": "Forbidden",
"message": "Your account is suspended and is not permitted to access this feature",
"data": {
"code": 13003
}
}
```
#### Error Codes Dictionary
+ `10003` - Invalid query parameters
+ `10005` - Date is not in ISO 8601 standard
+ `10010` - Invalid Content-Type
+ `10011` - Invalid User-Agent
+ `10012` - Invalid or missing Application-Id
+ `11001` - Invalid or expired token
+ `11003` - Bad authentication data - *Method requires authentication but it was not presented or was wholly invalid.*
+ `11005` - Account not allowed to access this endpoint
+ `13003` - Your account is suspended and is not permitted to access this feature
## Versioning
This API uses `Api-Version` header to identify requested version. Every **minor** version SHOULD be backward compatible. However, **major** versions MAY introduce *breaking changes*.
`Api-Version: 1.0.0`
This header SHOULD be present in every request. If not, API MUST use the newest available major release.
If requested version is not available, API SHOULD try to fall back to the next available minor release.
# Group Authentication
## Acquire access token [POST /auth/login]
**Authentication**: No
Returns a new access token.
+ Request (application/json)
+ Attributes
+ login: `[email protected]` (string) - User email address
+ password: `QXR0mi38a2` (string) - User password
+ Response 200 (application/json)
+ Attributes
+ token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....` (string) - JWT
## Refresh access token [POST /auth/refresh-token]
**Authentication**: Yes
Returns a new access token.
Tokens that are expired MUST NOT be refreshed.
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes
+ token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....` (string) - New JWT
## Register new user [POST /auth/register]
**Authentication**: No
Registers a new user (creates a user account).
+ Provided email address MUST be unique.
+ Passwords MUST have at least six characters.
+ Passwords MUST NOT contain the user name or parts of the user’s full name, such as his first name.
+ Passwords MUST use at least three of the four available character types: lowercase letters, uppercase letters, numbers, and symbols.
+ Request (application/json)
+ Attributes
+ email: `[email protected]` (string) - E-mail address.
+ password: `QXR0mi38a2` (string) - User password.
+ Response 201
# Group User
## User profile [/users/me]
Current user MUST be identified by JWT provided in the request header.
### Retrieve current user [GET]
**Authentication**: Yes
Returns the current user.
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes (User)
### Update current user [PUT]
**Authentication**: Yes
Updates user profile of the current user.
+ Request (application/json)
+ Headers
Authorization: JWT <token>
+ Attributes
+ name: `John` (string) - First name of the user
+ surname: `Doe` (string) - Last name of the user
+ Response 200 (application/json)
+ Attributes (User)
### Partially update current user [PATCH]
**Authentication**: Yes
Updates only selected fields of user profile for the current user. Request must contain a JSON with some fields of the `User` resource.
+ Request (application/json)
+ Headers
Authorization: JWT <token>
+ Attributes
+ name: `John Doe` (string) - First and second name of the user.
+ Response 200 (application/json)
+ Attributes (User)
### Delete current user account [DELETE]
**Authentication**: Yes
**Allowed user types:** *
Deletes current user account with all associated data.
After account is deleted all access tokens issued for this user MUST be invalidated.
+ Request
+ Headers
Authorization: JWT <token>
+ Response 204 (application/json)
+ Attributes (User)
## User password [/users/me/password]
### Change current user password [PUT]
**Authentication**: Yes
**Allowed user types:** *
Changes user password.
After password is changed all access tokens issued for this user MUST be invalidated.
+ Request (application/json)
+ Headers
Authorization: JWT <token>
+ Attributes
+ old_password: `secret` (string)
+ new_password: `$3C6e7` (string)
+ Response 200
+ Attributes
+ token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...` (string) - New JWT
## User avatar [/users/me/avatar]
### Set user avatar [POST]
**Authentication**: Yes
**Allowed user types:** *
Sets user avatar.
Either upload the raw binary ( **media** parameter) of the file, or its base64-encoded contents ( **media_data** parameter). Use raw binary when possible, because base64 encoding results in larger file sizes.
+ Request (multipart/form-data)
+ Headers
Authorization: JWT <token>
+ Response 200
+ Attributes
+ avatar: `https://...` (string) - Public download URL
### Delete user avatar [DELETE]
**Authentication**: Yes
**Allowed user types:** *
Restores user avatar to a *null* value.
+ Request
+ Headers
Authorization: JWT <token>
+ Response 204
## User resource collection [/users]
### Retrieve an array of Users [GET]
**Authentication**: Yes
**Allowed user types:** installer, administrator
Returns an array of `User` resources.
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes (array[User])
## User resource [/users/{id}]
+ Parameters
+ id: `a6vhAo3FG7t1` (string) - Id of the user resource.
### Retrieve the user resource [GET]
**Authentication**: Yes
**Allowed user types:** installer, administrator
Returns a single `User` resource for the given id.
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes (User)
+ Response 404
# Data Structures
## User (object)
+ id: `a6vhAo3FG7t1` (string, fixed) - Short non-sequential url-friendly unique id.
+ createdAt: `2016-07-01T15:11:09.553Z` (string) - ISO Date/time string. When this resource was created.
+ updatedAt: `2016-07-01T15:11:09.553Z` (string) - ISO Date/time string. When this resource was last updated.
+ email: `[email protected]` (string, required) - Login. Unique email address of the user.
+ facebookId: `888047057953991` (number, optional, nullable) - Facebook ID of the user if user account is linked to the Facebook account.
+ Default: `null`
+ name: `John` (string, optional, nullable) - First name of the user.
+ Default: `null`
+ surname: `Doe` (string, optional, nullable) - Last name of the user.
+ Default: `null`
+ avatar: `null` (string, optional, nullable) - URL to user avatar.
+ Default: `null`
|
FORMAT: 1A
# YOUR AWESOME API NAME
*This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.*
## Authentication
+ This API uses [JWT](http://jwt.io/) for authentication,
+ Every token MUST be refreshed before its expiration time,
+ Token MUST be provided in `Authorization` header,
+ Toke MUST be provided for each request that requires authentication,
+ This API issues a **long-lived access tokens** for consumers. A long-lived JWT generally SHOULD lasts about **30 days**. If no requests are made, the token MUST expire and the user MUST go through the login flow again to get a new one.
### Example Header
```
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhNnZoQW8zRkc3dDEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE0NzA1OTg5NzIsImV4cCI6MTQ3MDY4NTM3Mn0.ltA9zZmJKszBJuuV7pTWtY7LzLXrRUfebJDhy_jGMeM
```
### Claims
+ `exp` - The exp ( *expiration time* ) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing.
+ `iat` - The iat ( *issued at* ) claim identifies the time at which the JWT was issued.
+ `sub` - The aud ( *audience* ) claim identifies the subject of this token (for e.g. a user id).
+ `iss` - The iss ( *issuer* ) claim identifies the principal that issued the JWT.
## Consumer Identification
This API uses `User-Agent` and `Application-Id` headers to identify API consumer. `Application-Id` MUST contain an UUID that uniquely identifies a particular consumer installation.
### Example Headers
```
User-Agent: Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Application-Id: 6454d937-0a18-44a8-b482-bb48684f1ed4
```
## Filtering, Ordering, Pagination & Searching
### Filtering
This API can filter returned collections based on provided query parameters. Virtually any model field can be used as a filter.
For example, when requesting a list of movies from the /movies endpoint, you may want to limit these to only those of drama genre. This could be accomplished with a request like `GET /movies?genre=drama`. Here, genre is a query parameter that implements a filter.
### Ordering
This API can sort returned collections. A generic query parameter `sort` is used to describe sorting rules. This parameter can take a list of comma separated field, each with a possible unary negative to imply descending sort order.
E.g. `GET /movies?sort=-rating` - Retrieves a list of movies in descending order of user rating.
By default all resources are ordered by their creation time, from newest to oldest.
### Pagintation
This API uses the [Link header - RFC 5988](http://tools.ietf.org/html/rfc5988#page-6) to include pagination details.
An example of a Link header is described in [GitHub documentation](https://developer.github.com/guides/traversing-with-pagination/).
This API returns total count of paged resources in `Total-Count` HTTP header.
### Searching
This API uses a generic parameter `search` to expose a full text search mechanism.
## HTTP Methods
This API uses HTTP verbs (methods) as following:
+ `GET` - *Read* - used to **read** (or retrieve) a representation of a resource,
+ `POST` - *Create* - used to **create** new resources. In particular, it's used to create subordinate resources.
+ `PUT` - *Update/Replace* - used for **update** capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. On successful request, replaces identified resource with the request body.
+ `PATCH` - *Update/Modify* - used for **modify** capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
+ `DELETE` - *Delete* - used to **delete** a resource identified by a URI.
## Localization
This API uses `Accept-Language` header to identify the locale.
`Accept-Language: en`
This header SHOULD be present in every request. If not, API MUST use the **english** language/locale.
## Media Type
Where applicable this API MUST use the JSON media-type. Requests with a message-body are using plain JSON to set or update resource states.
`Content-type: application/json` and `Accept: application/json` headers SHOULD be set on all requests if not stated otherwise.
## Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
## Representation of Date and Time
All exchange of date and time-related data MUST be done according to ISO 8601 standard and stored in UTC.
When returning date and time-related data `YYYY-MM-DDThh:mm:ss.SSSZ` format MUST be used.
## Resource IDs
This API uses short non-sequential url-friendly unique ids. Every resource id MUST consists of 9 url-friendly characters: `A-Z`, `a-z`, `0-9`, `_` and `-`.
### Example
`a6vhAo3FG7t1`
## Status Codes and Errors
This API uses HTTP status codes to communicate with the API consumer.
+ `200 OK` - Response to a successful GET, PUT, PATCH or DELETE.
+ `201 Created` - Response to a POST that results in a creation.
+ `204 No Content` - Response to a successful request that won't be returning a body (like a DELETE request).
+ `400 Bad Request` - Malformed request; form validation errors.
+ `401 Unauthorized` - When no or invalid authentication details are provided.
+ `403 Forbidden` - When authentication succeeded but authenticated user doesn't have access to the resource.
+ `404 Not Found` - When a non-existent resource is requested.
+ `405 Method Not Allowed` - Method not allowed.
+ `406 Not Acceptable` - Could not satisfy the request Accept header.
+ `415 Unsupported Media Type` - Unsupported media type in request.
### Error response
This API returns both, machine-readable error codes and human-readable error messages in response body when an error is encountered.
#### Example
##### Validation Error
```js
{
"statusCode": 400,
"error": "Bad Request",
"message": "Invalid query parameters",
"data": {
"code": 10003,
"validation": {
"details":[
{
"message": "\"name\" is required",
"path": "name",
"type": "any.required",
"context": {
"key": "name"
}
},{
"message": "\"email\" must be a valid email",
"path": "email",
"type": "string.email",
"context": {
"value": "foo",
"key": "email"
}
}
],
"source": "query",
"keys": [ "name","email" ]
}
}
}
```
##### Generic Error
```js
{
"statusCode": 403,
"error": "Forbidden",
"message": "Your account is suspended and is not permitted to access this feature",
"data": {
"code": 13003
}
}
```
#### Error Codes Dictionary
+ `10003` - Invalid query parameters
+ `10005` - Date is not in ISO 8601 standard
+ `10010` - Invalid Content-Type
+ `10011` - Invalid User-Agent
+ `10012` - Invalid or missing Application-Id
+ `11001` - Invalid or expired token
+ `11003` - Bad authentication data - *Method requires authentication but it was not presented or was wholly invalid.*
+ `11005` - Account not allowed to access this endpoint
+ `13003` - Your account is suspended and is not permitted to access this feature
## Versioning
This API uses `Api-Version` header to identify requested version. Every **minor** version SHOULD be backward compatible. However, **major** versions MAY introduce *breaking changes*.
`Api-Version: 1.0.0`
This header SHOULD be present in every request. If not, API MUST use the newest available major release.
If requested version is not available, API SHOULD try to fall back to the next available minor release.
# Group Authentication
## User login [/auth/login]
Access tokens are required to access nearly all endpoints of this API.
### Retrieve a token [POST]
Allows to retrieve a valid JSON Web Token for username and password.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | No |
| Has restricted scope | No |
+ Request (application/json)
+ Attributes
+ login: `[email protected]` (string, required) - User email address
+ password: `QXR0mi38a2` (string, required) - User password
+ Response 200 (application/json)
+ Attributes
+ token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....` (string) - JSON Web Token.
## Refresh a token [POST /auth/refresh-token]
Allows to retrieve a new, valid JSON Web Token based on a valid JSON Web Token.
Expired tokens MUST NOT be refreshed.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes
+ token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....` (string) - New JWT
## User registration [/auth/register]
### Register a new user [POST]
Creates a new user account.
+ Provided email address MUST be unique.
+ Passwords MUST have at least six characters.
+ Passwords MUST NOT contain the user name or parts of the user’s full name, such as his first name.
+ Passwords MUST use at least three of the four available character types: lowercase letters, uppercase letters, numbers, and symbols.
After successful registration a confirmation email MUST be sent to provided address.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | No |
**Error codes**
| | | |
|-------|---------| ------------------------------------------- |
| `400` | `4001` | Password doesn't match password guidelines |
| `400` | `3001` | User already exists |
+ Request (application/json)
+ Attributes
+ email: `[email protected]` (string, required) - E-mail address.
+ password: `QXR0mi38a2` (string, required) - User password.
+ Response 201
# Group User
## Current user profile [/users/me]
Current user MUST be identifed by JWT provided in request header.
### Retrieve profile of the current user [GET]
Retrieves the profile of the current user.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes (User)
### Partialy update a profile of the current user [PATCH]
Updates a profile of the current user setting the values of the parameters passed. Any parameters not provided will be left unchanged.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
+ Request (application/json)
+ Headers
Authorization: JWT <token>
+ Attributes
+ name: `Ben` (string) - First name of the user.
+ Response 200 (application/json)
+ Attributes (User)
## User password [/users/me/password]
### Change a password of the current user [PUT]
Changes user password.
After password is changed all access tokens issued for this user prior to password change must be invalidated.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
**Error codes**
| | | |
|-------|---------| ----------------------------------------- |
| `400` | `4001` | Password doesn't match password guidelines |
+ Request (application/json)
+ Headers
Authorization: JWT <token>
+ Attributes
+ old_password: `secret` (string, required)
+ new_password: `$3C6e7` (string, required)
+ Response 200
+ Attributes
+ token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...` (string) - New JSON Web Token.
## User avatar [/users/me/avatar]
### Set user avatar [POST]
Sets user avatar.
Either upload the raw binary ( **media** parameter) of the file, or its base64-encoded contents ( **media_data** parameter). Use raw binary when possible, because base64 encoding results in larger file sizes.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
**Error codes**
| | | |
|-------|---------| --------------------- |
| `400` | `2001` | File is too large |
| `400` | `2002` | Unsupported file type |
+ Request (multipart/form-data)
+ Headers
Authorization: JWT <token>
+ Response 200
+ Attributes
+ avatar: `https://...` (string) - Public download URL
### Delete user avatar [DELETE]
Restores user avatar to the default one.
**Endpoint information**
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
+ Request
+ Headers
Authorization: JWT <token>
+ Response 204
## Users [/users]
### List all users [GET]
Returns a list of users. The users are returned in sorter order, with the most recently created user accounts appearing first.
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes (array[User])
## User [/users/{id}]
+ Parameters
+ id: `a6vhAo3FG7t1` (string) - id of the user.
### Retrieve a user [GET]
Retrieves the details of an existing user.
| | |
|-------------------------|-----|
| Requires authentication | Yes |
| Has restricted scope | No |
**Error codes**
| | | |
|-------|---------| ----------------------------- |
| `400` | `1000` | Referenced resource not found |
+ Request
+ Headers
Authorization: JWT <token>
+ Response 200 (application/json)
+ Attributes (User)
+ Response 404
# Data Structures
## User (object)
+ id: `a6vhAo3FG7t1` (string, fixed) - Short non-sequential url-friendly unique id.
+ createdAt: `2016-07-01T15:11:09.553Z` (string) - ISO Date/time string. When this resource was created.
+ updatedAt: `2016-07-01T15:11:09.553Z` (string) - ISO Date/time string. When this resource was last updated.
+ email: `[email protected]` (string, required) - Login. Unique email address of the user.
+ facebookId: `888047057953991` (number, optional, nullable) - Facebook ID of the user if user account is linked to the Facebook account.
+ Default: `null`
+ name: `John` (string, optional, nullable) - First name of the user.
+ Default: `null`
+ surname: `Doe` (string, optional, nullable) - Last name of the user.
+ Default: `null`
+ avatar: `null` (string, optional, nullable) - URL to user avatar.
+ Default: `null`
|
Update sample endpoints.
|
Update sample endpoints.
Add error codes and endpoint informations.
Clarify some descriptions.
Add required keyword to request parameters.
|
API Blueprint
|
mit
|
jsynowiec/api-blueprint-boilerplate,jsynowiec/api-blueprint-boilerplate
|
a9a5dd84a401f76de33ca56d768f72ef24dd7603
|
WEATHER-API-BLUEPRINT.apib
|
WEATHER-API-BLUEPRINT.apib
|
FORMAT: 1A
Weather API
=============================
Do you want to send [feedback](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951)?
[Roadmap for Weather API](https://github.com/MeteoGroup/weather-api/tree/roadmap)
# General information
This technical document was created for developers who are creating applications based on weather data provided by this API.
The Weather API resolves weather data based on location specified by latitude and longitude coordinates.
For weather parameters prediction API offer ["forecast" endpoint](#forecast) and for weather history parameters API offer ["observation" endpoint](#observation).
This document is using [API blueprint format](https://apiblueprint.org/documentation/).
All endpoints are **secured** with HTTP basic authorization and data are transmitted over HTTPS protocol.
If you want to get access please use [request form](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951).
# Group Observation
## Retrieve weather observation [/observation?locatedAt={locatedAt}&fields={fields}&]
#### Example
`https://api.weather.mg/observation?location=53,13`
### Observed weather for a given *latitude* and *longitude* [GET]
This resource provides data from existing weather observation stations.
These are the latest values/parameters they provide.
For any requested location a relevant station is computed.
To the relevant station, the distance and available parameters are taken into concern.
+ Parameters
+ locatedAt: `13.37788,52.5337` (string, required) - longitude,latitude; can occur multiple times for multiple stations
+ locatedAt: `joionluqqFvwqmo629nC` (string, optional) - compressed list of station locations, using Microsoft Point Compression Algorithm, is efficient for up to 400 locations
+ fields: `sunshineDurationInMinutes,airTemperatureInCelsius` (string, required) - comma separated list of parameters to be contained inside response
+ observedFromUtc: `2016-10-13T11:00:00Z` (string, optional)
+ observedUntilUtc: `2016-10-13T15:00:00Z` (string, optional)
+ observedFromLocalTime: `2016-10-13T11:00:00Z` (string, optional)
+ observedUntilLocalTime: `2016-10-13T15:00:00Z` (string, optional)
+ observedPeriod: `PT0S,PT1H,PT12H` (string, required) - comma separated list of periods to be retrieved. use iso8601 time duration notation. PT0S refers to observations at a moment in time. PT1H applies one hour aggregation.
+ Response 200 (application/json)
+ Headers
X-Request-Calls-Per-Interval: 4711
E-Tag: "x234dff"
Cache-Control: max-age=3628800
"items" : [
{
"location" : {
"latitude": 52.5337,
"longitude": 13.37788,
},
"relevantStation" : {
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"longitude" : 13.12156,
"latitude" : 52.57113
"timeZoneName" : "Europe/Berlin"
},
"observation" : [
{
"observedFromUtc": "2016-10-13T11:00:00Z",
"observedUntilUtc": "2016-10-13T12:00:00Z",
"observedPeriod" : "PT1H",
"sunshineDurationInMinutes": 15,
"windGustInKnots" : 20,
},
{
"observedFromUtc": "2016-10-13T06:00:00Z",
"observedUntilUtc": "2016-10-13T18:00:00Z",
"observedPeriod" : "PT12H",
"sunshineDurationInMinutes": 123,
"windGustInKnots" : 20,
},
{
"observedFromUtc": "2016-10-13T12:00:00Z",
"observedUntilUtc": "2016-10-13T12:00:00Z",
"observedPeriod" : "PT0S",
"airTemperatureInCelsius": 29.6,
"windSpeedInKnots" : 14
}
]
}
]
}
# Group Forecast
## Retrieve weather forecast [/forecast?locatedAt={locatedAt}&fields={fields}&validPeriod={validPeriod}&validFrom={validFrom}{&validUntil}]
### Forecasted weather for a given *latitude* and *longitude* [GET]
Weather forecast for the next 7 days.
+ Parameters
+ locatedAt: `13.37788,52.5337` (string, required) - longitude,latitude; can occur multiple times for multiple locations
+ locatedAt: `joionluqqFvwqmo629nC` (string, optional) - compressed list of station locations, using Microsoft Point Compression Algorithm, is efficient for up to 400 locations
+ fields: `airTemperatureInCelsius,dewPointTemperatureInFahrenheit,dewPointTemperatureInKelvin` (string, required) - comma separated list of parameters to be contained inside response
+ validFromUtc: `2016-10-13T11:00:00Z` (string, optional)
+ validUntilUtc: `2016-10-13T15:00:00Z` (string, optional)
+ validFromLocalTime: `2016-10-13T11:00:00Z` (string, optional)
+ validUntilLocalTime: `2016-10-13T15:00:00Z` (string, optional)
+ validPeriod: `PT0S,PT1H,PT6H` - comma separated list of periods to be retrieved. use iso8601 time duration notation. PT1H refers one hour forecast periods. PT6H applies three hours aggregation.
+ Response 200 (application/json)
+ Headers
X-Request-Calls-Per-Interval: 4712
E-Tag: "a987dff"
Cache-Control: max-age=600
+ Body
{
"items" : [
{
"location" : {
"latitude": 52.5337,
"longitude": 13.37788,
"timeZoneName" : "Europe/Berlin"
},
"relevantStation" : {
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"longitude" : 13.12156,
"latitude" : 52.57113
},
"forecast": [
{
"validFromUtc": "2016-08-25T14:00:00Z",
"validUntilUtc": "2016-08-25T14:00:00Z",
"validPeriod": "PT0S"
"airTemperatureInCelsius": 15.8,
"dewPointTemperatureInFahrenheit": 15.8,
"dewPointTemperatureInKelvin": 15.8,
"airPressureInHpa": 1012.9,
"effectiveCloudCoverInOcta": 3
"precipitationIntensityInMillimeterPerHour": 0,
"windSpeedInKnots":3,
},
{
"validFromUtc": "2016-08-25T14:00:00Z",
"validUntilUtc": "2016-08-25T15:00:00Z",
"validPeriod": "PT1H"
"minAirTemperatureInCelsius": 15.8,
"maxAirTemperatureInCelsius": 15.8,
"sunshineDurationInMinutes": 23,
"precipitationAmountInMillimeter": 0,
"windGustInKnots": 5,
},
{
"validFromUtc": "2016-08-25T14:00:00Z",
"validUntilUtc": "2016-08-25T20:00:00Z",
"validPeriod": "PT6H"
"minAirTemperatureInCelsius": 15.8,
"maxAirTemperatureInCelsius": 18.1,
"sunshineDurationInMinutes": 385,
"precipitationAmountInMillimeter": 0,
"windGustInKnots": 6,
}
]
}
}
# Group Warning
## Retrieve severe weather warnings [/warnings?location={latitudeInDegree,longitudeInDegree}]
### Example
`https://api.weather.mg/forecast?location=53,13`
### Severe Weather Warnings [GET]
THIS IS A DRAFT.
+ Parameters
+ latitudeInDegree: `52.13` (number, required) - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32
+ longitudeInDegree: `13.2` (number, required) - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864
+ Request
+ Headers
X-Authentication: <API-Key>
X-TraceId: <Trace-Id>
+ Response 200 (application/json)
+ Headers
X-Request-Calls-Per-Interval: 4712
E-Tag: "a987dff"
Cache-Control: max-age=600
+ Body
{
"location" : {
"latitude": 52.5337,
"longitude": 13.37788,
},
"warningId": "1234-5678",
"issueAt": "2016-08-03T00:00:00+02:00",
"validAt": "2016-08-03T00:00:00+02:00",
"warningSeverity": "HIGH",
"affectedRegion": {
"name": "London"
}
}
# Data Structures
## Backward compatibility
Weather API may add more parameters in the future.
Clients should irgnore unknown parameters.
Only when parameters will fundamently change, a new version might be introduced.
## Forecast Intervals
The response contains different time intervals which contain forecast in for different time spans.
Interval name | Time interval | Time span
---------------|----------------|--------------------------------
hourly | 1 hour | using time zone from requested location, today from 00:00 until 00:00 next day, plus 1 day ahead, means 48 hours in total
interval6hours | 6 hours | using time zone from requested location, today from 00:00 until 00:00 next day, plus 6 days ahead, means 28 intervals in total
halfDaily | 12 hours | using time zone from requested location, today from 00:00 until 00:00 next day, plus 6 days ahead, means 14 intervals in total
daily | 24 hours | using time zone from requested location, today from 00:00 until 00:00 next day, plus 6 days ahead, means 7 days in total
## Units
Parameter | unit
---------------|-----
minAirTemperature | Degree or Fahrenheit
maxAirTemperature | Degree or Fahrenheit
airTemperature | Degree or Fahrenheit
dewPointTemperature | Degree or Fahrenheit
precipitation | mm or inch
precipitationLastHour | mm or inch
windSpeed | m/s or km/h or m/h or BFT
windGust | in Knots or m/h or km/h
date, time, time offset | timestamps including date, time and a zime offset are encoded in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
precipitationProbabilityInPercent100based | a percentage which refers to the amount of precipitation probability
## Total Cloud Cover (number)
This symbolic letter shall embrace the total fraction of the celestial dome covered by clouds irrespective of their genus.
(WMO akronym 'N')
Value | Meaning
------|---------
0 | 0
1 | 1 okta or less, but not zero
2 | 2 oktas
3 | 3 oktas
4 | 4 oktas
5 | 5 oktas
6 | 6 oktas
7 | 7 oktas
8 | 8 oktas
9 | Sky obscured by fog and/or other meteorological phenomena
|
FORMAT: 1A
Weather API
=============================
Do you want to send [feedback](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951)?
[Roadmap for Weather API](https://github.com/MeteoGroup/weather-api/tree/roadmap)
# General information
This technical document was created for developers who are creating applications based on weather data provided by this API.
The Weather API resolves weather data based on location specified by latitude and longitude coordinates.
For weather parameters prediction API offer ["forecast" endpoint](#forecast) and for weather history parameters API offer ["observation" endpoint](#observation).
This document is using [API blueprint format](https://apiblueprint.org/documentation/).
All endpoints are **secured** with HTTP basic authorization and data are transmitted over HTTPS protocol.
If you want to get access please use [request form](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951).
# Group Observation
## Retrieve weather observation [/observation?locatedAt={locatedAt}&fields={fields}&]
#### Example
`https://api.weather.mg/observation?location=53,13` to be fixed ...
### Observed weather for a given *latitude* and *longitude* [GET]
This resource provides data from existing weather observation stations.
These are the latest values/parameters they provide.
For any requested location a relevant station is computed.
To the relevant station, the distance and available parameters are taken into concern.
HINT:
* all timestamps are meant to be UTC, or in a request provide correct offset (so that server can convert to UTC.)
* in response, timestamps are also returned as UTC
* if we foresee in future returning e.g. 'observedFrom' in local time zone, than I propose "observedFromInLocalTime" to be more explicit.
+ Parameters
+ locatedAt: `13.37788,52.5337` (string, required) - longitude,latitude; can occur multiple times for multiple stations
+ locatedAt: `joionluqqFvwqmo629nC` (string, optional) - compressed list of station locations, using Microsoft Point Compression Algorithm, is efficient for up to 400 locations
+ fields: `sunshineDurationInMinutes,airTemperatureInCelsius` (string, required) - comma separated list of parameters to be contained inside response
+ observedFrom: `2016-10-13T11:00:00Z` (string, optional)
+ observedUntil: `2016-10-13T15:00:00Z` (string, optional)
+ observedPeriod: `PT0S,PT1H,PT12H` (string, required) - comma separated list of periods to be retrieved. use iso8601 time duration notation. PT0S refers to observations at a moment in time. PT1H applies one hour aggregation.
+ Response 200 (application/json)
+ Headers
X-Request-Calls-Per-Interval: 4711
E-Tag: "x234dff"
Cache-Control: max-age=3628800
"items" : [
{
"location" : [13.37788, 52.5337],
"relevantStation" : {
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"location" : [13.36612, 52.1234],
"timeZoneName" : "Europe/Berlin"
},
"observation" : [
{
"observedFrom": "2016-10-13T11:00:00Z",
"observedUntil": "2016-10-13T12:00:00Z",
"observedPeriod" : "PT1H",
"sunshineDurationInMinutes": 15,
"windGustInKnots" : 20,
},
{
"observedFrom": "2016-10-13T06:00:00Z",
"observedUntil": "2016-10-13T18:00:00Z",
"observedPeriod" : "PT12H",
"sunshineDurationInMinutes": 123,
"windGustInKnots" : 20,
},
{
"observedFrom": "2016-10-13T12:00:00Z",
"observedUntil": "2016-10-13T12:00:00Z",
"observedPeriod" : "PT0S",
"airTemperatureInCelsius": 29.6,
"windSpeedInKnots" : 14
}
]
}
]
}
--------
Alternative
* completly flat structure.
* no prior aggregation leaves room for transposition tables approach
* again, every field must be requested in fields request parameter
"items" : [
{
"location" : [13.37788, 52.5337],
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"stationLocation" : [13.36612, 52.1234],
"stationTimeZoneName" : "Europe/Berlin"
"observedFromUtc": "2016-10-13T11:00:00Z",
"observedUntilUtc": "2016-10-13T12:00:00Z",
"observedPeriod" : "PT1H",
"sunshineDurationInMinutes": 15,
"windGustInKnots" : 20,
},
{
"location" : [13.37788, 52.5337],
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"stationLocation" : [13.36612, 52.1234],
"stationTimeZoneName" : "Europe/Berlin"
"observedFromUtc": "2016-10-13T06:00:00Z",
"observedUntilUtc": "2016-10-13T18:00:00Z",
"observedPeriod" : "PT12H",
"sunshineDurationInMinutes": 123,
"windGustInKnots" : 20,
},
{
"location" : [13.37788, 52.5337],
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"stationLocation" : [13.36612, 52.1234],
"stationTimeZoneName" : "Europe/Berlin"
"observedFromUtc": "2016-10-13T12:00:00Z",
"observedUntilUtc": "2016-10-13T12:00:00Z",
"observedPeriod" : "PT0S",
"airTemperatureInCelsius": 29.6,
"windSpeedInKnots" : 14
}
-----------------------------------
# Group Forecast
## Retrieve weather forecast [/forecast?locatedAt={locatedAt}&fields={fields}&validPeriod={validPeriod}&validFrom={validFrom}{&validUntil}]
### Forecasted weather for a given *latitude* and *longitude* [GET]
Weather forecast for the next 7 days.
+ Parameters
+ locatedAt: `13.37788,52.5337` (string, required) - longitude,latitude; can occur multiple times for multiple locations
+ locatedAt: `joionluqqFvwqmo629nC` (string, optional) - compressed list of station locations, using Microsoft Point Compression Algorithm, is efficient for up to 400 locations
+ fields: `airTemperatureInCelsius,dewPointTemperatureInFahrenheit,dewPointTemperatureInKelvin` (string, required) - comma separated list of parameters to be contained inside response
+ validFromUtc: `2016-10-13T11:00:00Z` (string, optional)
+ validUntilUtc: `2016-10-13T15:00:00Z` (string, optional)
+ validFromLocalTime: `2016-10-13T11:00:00Z` (string, optional)
+ validUntilLocalTime: `2016-10-13T15:00:00Z` (string, optional)
+ validPeriod: `PT0S,PT1H,PT6H` - comma separated list of periods to be retrieved. use iso8601 time duration notation. PT1H refers one hour forecast periods. PT6H applies three hours aggregation.
+ Response 200 (application/json)
+ Headers
X-Request-Calls-Per-Interval: 4712
E-Tag: "a987dff"
Cache-Control: max-age=600
+ Body
{
"items" : [
{
"location" : {
"latitude": 52.5337,
"longitude": 13.37788,
"timeZoneName" : "Europe/Berlin"
},
"relevantStation" : {
"meteoGroupStationId" : "abcd1234ef5678",
"stationName" : "Berlin Dahlem",
"longitude" : 13.12156,
"latitude" : 52.57113
},
"forecast": [
{
"validFromUtc": "2016-08-25T14:00:00Z",
"validUntilUtc": "2016-08-25T14:00:00Z",
"validPeriod": "PT0S"
"airTemperatureInCelsius": 15.8,
"dewPointTemperatureInFahrenheit": 15.8,
"dewPointTemperatureInKelvin": 15.8,
"airPressureInHpa": 1012.9,
"effectiveCloudCoverInOcta": 3
"precipitationIntensityInMillimeterPerHour": 0,
"windSpeedInKnots":3,
},
{
"validFromUtc": "2016-08-25T14:00:00Z",
"validUntilUtc": "2016-08-25T15:00:00Z",
"validPeriod": "PT1H"
"minAirTemperatureInCelsius": 15.8,
"maxAirTemperatureInCelsius": 15.8,
"sunshineDurationInMinutes": 23,
"precipitationAmountInMillimeter": 0,
"windGustInKnots": 5,
},
{
"validFromUtc": "2016-08-25T14:00:00Z",
"validUntilUtc": "2016-08-25T20:00:00Z",
"validPeriod": "PT6H"
"minAirTemperatureInCelsius": 15.8,
"maxAirTemperatureInCelsius": 18.1,
"sunshineDurationInMinutes": 385,
"precipitationAmountInMillimeter": 0,
"windGustInKnots": 6,
}
]
}
}
# Group Warning
## Retrieve severe weather warnings [/warnings?location={latitudeInDegree,longitudeInDegree}]
### Example
`https://api.weather.mg/forecast?location=53,13`
### Severe Weather Warnings [GET]
THIS IS A DRAFT.
+ Parameters
+ latitudeInDegree: `52.13` (number, required) - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32
+ longitudeInDegree: `13.2` (number, required) - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864
+ Request
+ Headers
X-Authentication: <API-Key>
X-TraceId: <Trace-Id>
+ Response 200 (application/json)
+ Headers
X-Request-Calls-Per-Interval: 4712
E-Tag: "a987dff"
Cache-Control: max-age=600
+ Body
{
"location" : {
"latitude": 52.5337,
"longitude": 13.37788,
},
"warningId": "1234-5678",
"issueAt": "2016-08-03T00:00:00+02:00",
"validAt": "2016-08-03T00:00:00+02:00",
"warningSeverity": "HIGH",
"affectedRegion": {
"name": "London"
}
}
# Data Structures
## Backward compatibility
Weather API may add more parameters in the future.
Clients should irgnore unknown parameters.
Only when parameters will fundamently change, a new version might be introduced.
## Forecast Intervals
The response contains different time intervals which contain forecast in for different time spans.
Interval name | Time interval | Time span
---------------|----------------|--------------------------------
hourly | 1 hour | using time zone from requested location, today from 00:00 until 00:00 next day, plus 1 day ahead, means 48 hours in total
interval6hours | 6 hours | using time zone from requested location, today from 00:00 until 00:00 next day, plus 6 days ahead, means 28 intervals in total
halfDaily | 12 hours | using time zone from requested location, today from 00:00 until 00:00 next day, plus 6 days ahead, means 14 intervals in total
daily | 24 hours | using time zone from requested location, today from 00:00 until 00:00 next day, plus 6 days ahead, means 7 days in total
## Units
Parameter | unit
---------------|-----
minAirTemperature | Degree or Fahrenheit
maxAirTemperature | Degree or Fahrenheit
airTemperature | Degree or Fahrenheit
dewPointTemperature | Degree or Fahrenheit
precipitation | mm or inch
precipitationLastHour | mm or inch
windSpeed | m/s or km/h or m/h or BFT
windGust | in Knots or m/h or km/h
date, time, time offset | timestamps including date, time and a zime offset are encoded in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
precipitationProbabilityInPercent100based | a percentage which refers to the amount of precipitation probability
## Total Cloud Cover (number)
This symbolic letter shall embrace the total fraction of the celestial dome covered by clouds irrespective of their genus.
(WMO akronym 'N')
Value | Meaning
------|---------
0 | 0
1 | 1 okta or less, but not zero
2 | 2 oktas
3 | 3 oktas
4 | 4 oktas
5 | 5 oktas
6 | 6 oktas
7 | 7 oktas
8 | 8 oktas
9 | Sky obscured by fog and/or other meteorological phenomena
|
add alternative
|
add alternative
|
API Blueprint
|
apache-2.0
|
MeteoGroup/weather-api,MeteoGroup/weather-api
|
fc11a2b90b12fc3ad96cc6688e07f5346ab94ce1
|
blueprint/api.apib
|
blueprint/api.apib
|
FORMAT: 1A
HOST: https://api.thegrid.io/
# The Grid API
# Group Long-running jobs
Several actions in the API takes a significant time.
Current examples include POST /share, /publish and /unpublish.
Performing such an action returns a Location header with a Job URL.
## Job details [/job/{id}]
### Retriving job details [GET]
+ Parameters
+ id (required, string) - Job UUID
+ Response 200 (application/json)
+ Body
```
<!-- include(examples/job-share-completed.json) -->
```
## Jobs [/job]
### Listing current jobs [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/job-share-completed.json) -->
]
```
# Group Newsfeed
## User's newsfeed [/updates{?offset,limit,measurements}]
### Fetch user's latest newsfeed [GET]
+ Parameters
+ offset (number) - Offset to use for pagination
+ limit (number) - Limit to use for pagination
+ measurements (string) - Selectively get only certain measurements
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/item-valid-minimal-item.json) -->
]
```
# Group Site Management
## Site information [/site]
### List user websites [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/site-with-config.json) -->
]
```
### Create a website [POST]
+ Request (application/json)
**Note:** the repository must be in `the-domains` organization. The repository name can later be used for sharing content to the newly-created site.
+ Body
```
<!-- include(examples/site-without-owner.json) -->
```
+ Schema
```
<!-- include(full-schema/site.json) -->
```
+ Response 201
Site was successfully created
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing site information
+ Body
## User website [/site/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Get website details [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/site.json) -->
```
### Update website details [PUT]
+ Request (application/json)
+ Body
```
<!-- include(examples/site-without-owner-with-config.json) -->
```
+ Schema
```
<!-- include(full-schema/site.json) -->
```
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/site.json) -->
```
### Delete website [DELETE]
+ Response 200
## Site DNS status [/site/{id}/dns]
+ Parameters
+ id (required, string) - Site UUID
### Check website DNS status [POST]
+ Response 200 (application/json)
+ Body
{ "valid": true }
## Website discovery [/site/discover{?url}]
### Match URL to a website [GET]
+ Parameters
+ url (required, string) - URL of the website
+ Response 302
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 409
Grid site belonging to another user was found at the URL
+ Response 404
No Grid site was found for the URL
+ Body
# Group Content Management
## Share [/share]
### Sharing content [POST]
Users can share content to The Grid. The shared items will be normalized, analyzed and made available via the item API.
Sharing creates a Job, whos progress can be monitored using the /job API.
There are typically two different things you can be sharing:
* Full article pages: share with URL
* HTML fragments: selection or img tag. Share with content, type text/html and with the URL of the originating page
Note that publishing an item to a website is a separate step. See /publish
+ Request with JSON payload (application/json)
+ Body
```
<!-- include(examples/share-url-only.json) -->
```
+ Schema
```
<!-- include(full-schema/share.json) -->
```
+ Response 202
Sharing was successful and will be processed.
+ Headers
Location: /job/b8838e11-1d97-4799-85d8-1aafec52e927
+ Body
+ Response 422
Missing required parameters
+ Body
+ Response 403
Not allowed to share to the specified website
+ Body
## Upload signing [/share/sign{?objectName,contentType}]
### Signing intent to upload [GET]
In situations where users want to share content from their local filesystem (images, Markdown files, etc), this is done by uploading them to Amazon S3. The share intent signing API provides a temporary upload URL, as well as the permanent URL where the file will reside after upload has completed.
After the file has been uploaded to S3, it can be shared to a Grid site using the normal [share flow](#content-management-share-post).
+ Parameters
+ objectName (string) - Name of the file being uploaded
+ contentType (string) - File MIME type
+ Response 422
Missing required parameters
+ Body
+ Response 200 (application/json)
A temporary upload signature has been generated. Use the provided `signedUrl` to upload via `HTTP PUT`. The `publicUrl` is the URL that the file will have after upload has completed.
+ Body
```
<!-- include(examples/sharesign-response.json) -->
```
## Items list [/item{?published,minimal,offset,limit,site,measurements}]
### Retrieve user's content items [GET]
+ Parameters
+ published (boolean) - Whether to get published or unpublished items only
+ minimal (boolean) - Whether to receive items without measurements applied (deprecated, use measurements instead)
+ offset (number) - Offset to use for pagination
+ limit (number) - Limit to use for pagination
+ site (string) - Receive only items associated with given site. Example: the-domains/mywebsite
+ blocktype (string) - Only items containing at least one block of given type
+ measurements (string) - Selectively get only certain measurements
When an item is being worked on by a user it is available via the API. Queries without selective measurements must be paginated. When using pagination, the `limit` must be smaller than 50.
+ Response 200 (application/json)
### Create an item [POST]
+ Response 201
+ Headers
Location: /item/b8838e11-1d97-4799-85d8-1aafec52e927
+ Response 422
Missing item information
+ Body
```
[
<!-- include(examples/item-valid-general-item.json) -->
]
```
## Item [/item/{id,?measurements}]
+ Parameters
+ id (required, string) - Item UUID
+ measurements (string) - Selectively get only certain measurements
### Retrieve an item [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/item.json) -->
```
+ Response 404
### Update item [PUT]
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/item.json) -->
```
+ Response 422
Missing item information
+ Body
### Update item metadata [PATCH]
+ Response 204
+ Response 422
Missing item information
+ Body
### Remove item [DELETE]
+ Response 200
## Publishing [/publish]
### Publish a items to a site [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(full-schema/publish.json) -->
```
+ Response 202
## Unpublishing [/unpublish]
### Unpublish items from a site [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(full-schema/publish.json) -->
```
+ Response 202
## Copying [/copy/{id}]
+ Parameters
+ id (required, string) - Item UUID
### Copy an item [POST]
+ Request
+ Schema
```
<!-- include(full-schema/copymove.json) -->
```
+ Response 200
Item was successfully copied. New item location can be found from the location header.
+ Headers
Location: /item/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing item information
+ Body
## Moving [/move/{id}]
+ Parameters
+ id (required, string) - Item UUID
### Move an item to another site [POST]
+ Request
+ Schema
```
<!-- include(full-schema/copymove.json) -->
```
+ Response 200
Item was successfully moved.
+ Headers
Location: /item/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing item information
+ Body
|
FORMAT: 1A
HOST: https://api.thegrid.io/
# The Grid API
# Group Long-running jobs
Several actions in the API takes a significant time.
Current examples include POST /share, /publish and /unpublish.
Performing such an action returns a Location header with a Job URL.
## Job details [/job/{id}]
### Retriving job details [GET]
+ Parameters
+ id (required, string) - Job UUID
+ Response 200 (application/json)
+ Body
```
<!-- include(examples/job-share-completed.json) -->
```
## Jobs [/job]
### Listing current jobs [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/job-share-completed.json) -->
]
```
# Group Newsfeed
## User's newsfeed [/updates{?offset,limit,measurements}]
### Fetch user's latest newsfeed [GET]
+ Parameters
+ offset (number) - Offset to use for pagination
+ limit (number) - Limit to use for pagination
+ measurements (string) - Selectively get only certain measurements
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/item-valid-minimal-item.json) -->
]
```
# Group Site Management
## Site information [/site]
### List user websites [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/site-with-config.json) -->
]
```
### Create a website [POST]
+ Request (application/json)
**Note:** the repository must be in `the-domains` organization. The repository name can later be used for sharing content to the newly-created site.
+ Body
```
<!-- include(examples/site-without-owner.json) -->
```
+ Schema
```
<!-- include(full-schema/site.json) -->
```
+ Response 201
Site was successfully created
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing site information
+ Body
## User website [/site/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Get website details [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/site.json) -->
```
### Update website details [PUT]
+ Request (application/json)
+ Body
```
<!-- include(examples/site-without-owner-with-config.json) -->
```
+ Schema
```
<!-- include(full-schema/site.json) -->
```
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/site.json) -->
```
### Delete website [DELETE]
+ Response 200
## Site DNS status [/site/{id}/dns]
+ Parameters
+ id (required, string) - Site UUID
### Check website DNS status [POST]
+ Response 200 (application/json)
+ Body
{ "valid": true }
## Website discovery [/site/discover{?url}]
### Match URL to a website [GET]
+ Parameters
+ url (required, string) - URL of the website
+ Response 302
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 409
Grid site belonging to another user was found at the URL
+ Response 404
No Grid site was found for the URL
+ Body
# Group Content Management
## Share [/share]
### Sharing content [POST]
Users can share content to The Grid. The shared items will be normalized, analyzed and made available via the item API.
Sharing creates a Job, whos progress can be monitored using the /job API.
There are typically two different things you can be sharing:
* Full article pages: share with URL
* HTML fragments: selection or img tag. Share with content, type text/html and with the URL of the originating page
Note that publishing an item to a website is a separate step. See /publish
+ Request with JSON payload (application/json)
+ Body
```
<!-- include(examples/share-url-only.json) -->
```
+ Schema
```
<!-- include(full-schema/share.json) -->
```
+ Response 202
Sharing was successful and will be processed.
+ Headers
Location: /job/b8838e11-1d97-4799-85d8-1aafec52e927
+ Body
+ Response 422
Missing required parameters
+ Body
+ Response 403
Not allowed to share to the specified website
+ Body
## Upload signing [/share/sign{?objectName,contentType}]
### Signing intent to upload [GET]
In situations where users want to share content from their local filesystem (images, Markdown files, etc), this is done by uploading them to Amazon S3. The share intent signing API provides a temporary upload URL, as well as the permanent URL where the file will reside after upload has completed.
After the file has been uploaded to S3, it can be shared to a Grid site using the normal [share flow](#content-management-share-post).
+ Parameters
+ objectName (string) - Name of the file being uploaded
+ contentType (string) - File MIME type
+ Response 422
Missing required parameters
+ Body
+ Response 200 (application/json)
A temporary upload signature has been generated. Use the provided `signedUrl` to upload via `HTTP PUT`. The `publicUrl` is the URL that the file will have after upload has completed.
+ Body
```
<!-- include(examples/sharesign-response.json) -->
```
## Items list [/item{?published,minimal,offset,limit,site,measurements}]
### Retrieve user's content items [GET]
+ Parameters
+ published (boolean) - Whether to get published or unpublished items only
+ minimal (boolean) - Whether to receive items without measurements applied (deprecated, use measurements instead)
+ offset (number) - Offset to use for pagination
+ limit (number) - Limit to use for pagination
+ site (string) - Receive only items associated with given site. Example: the-domains/mywebsite
+ blocktype (string) - Only items containing at least one block of given type
+ measurements (string) - Selectively get only certain measurements
When an item is being worked on by a user it is available via the API. Queries without selective measurements must be paginated. When using pagination, the `limit` must be smaller than 50.
+ Response 200 (application/json)
### Create an item [POST]
+ Response 201
+ Headers
Location: /item/b8838e11-1d97-4799-85d8-1aafec52e927
+ Response 422
Missing item information
+ Body
```
[
<!-- include(examples/item-valid-listing-item.json) -->
]
```
## Item [/item/{id,?measurements}]
+ Parameters
+ id (required, string) - Item UUID
+ measurements (string) - Selectively get only certain measurements
### Retrieve an item [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/item.json) -->
```
+ Body
```
<!-- include(examples/item-valid-general-item.json) -->
```
+ Response 404
### Update item [PUT]
+ Response 200 (application/json)
+ Schema
```
<!-- include(full-schema/item.json) -->
```
+ Response 422
Missing item information
+ Body
### Update item metadata [PATCH]
+ Response 204
+ Response 422
Missing item information
+ Body
### Remove item [DELETE]
+ Response 200
## Publishing [/publish]
### Publish a items to a site [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(full-schema/publish.json) -->
```
+ Response 202
## Unpublishing [/unpublish]
### Unpublish items from a site [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(full-schema/publish.json) -->
```
+ Response 202
## Copying [/copy/{id}]
+ Parameters
+ id (required, string) - Item UUID
### Copy an item [POST]
+ Request
+ Schema
```
<!-- include(full-schema/copymove.json) -->
```
+ Response 200
Item was successfully copied. New item location can be found from the location header.
+ Headers
Location: /item/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing item information
+ Body
## Moving [/move/{id}]
+ Parameters
+ id (required, string) - Item UUID
### Move an item to another site [POST]
+ Request
+ Schema
```
<!-- include(full-schema/copymove.json) -->
```
+ Response 200
Item was successfully moved.
+ Headers
Location: /item/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing item information
+ Body
|
Add example also to individual item result, refs #21
|
Add example also to individual item result, refs #21
|
API Blueprint
|
mit
|
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
|
e692e248adb849c0ba0f1b0bf50598c355a2af13
|
apiary.apib
|
apiary.apib
|
# Lion API
Lion is a basic localization service using `git` as the backend for storing translations.
## Request headers
All requests to Lion must include the following headers:
- `Lion-Api-Version`
# Group Projects
## Project collection [/projects]
### List projects [GET]
List all configured projects
+ Request (application/json)
+ Header
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"projects": [
"projectA": {
"name" "projectA" // All project details
}
]
}
## Project management [/project/{name}]
+ Parameters
+ name (required, string) ... Project name
### Get project [GET]
Fetch project details, given the projects' name.
+ Request (application/json)
+ Header
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"name": "Project name",
"resources": [
"resource1",
"..."
]
}
+ Response 404 (application/json)
+ Header
Lion-Api-Version: v1
|
# Lion API
Lion is a basic localization service using `git` as the backend for storing translations.
## Request headers
Requests should have the `Lion-Api-Version` header set. The current API version is `v1`. If the header is not set, it is assumed to be the latest version.
Example header:
- `Lion-Api-Version: v1`
# Group Projects
## Project collection [/projects]
### List projects [GET]
List all configured projects
+ Request (application/json)
+ Header
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"projects": [
"projectA": {
"name" "projectA" // All project details
}
]
}
## Project management [/project/{name}]
+ Parameters
+ name (required, string) ... Project name
### Get project [GET]
Fetch project details, given the projects' name.
+ Request (application/json)
+ Header
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"name": "Project name",
"resources": [
"resource1",
"..."
]
}
+ Response 404 (application/json)
+ Header
Lion-Api-Version: v1
|
Make the API version optional in the request
|
Make the API version optional in the request
|
API Blueprint
|
mit
|
sebdah/lion
|
ade1a64daa1c7ed7d64649b9750e87eb541a7970
|
doc/example-httpbin.apib
|
doc/example-httpbin.apib
|
--- Examples against httpbin.org ---
---
Examples of how some requests to _httpbin.org_ can be specified. Read more about
the httpbin.org API at http://httpbin.org/.
See ../README.md for details on how to test this specification.
---
# First request and response
Get a teapot from some full URL.
Leading or trailing blank lines in the body are stripped, unless you delimit
the body lines with the markers <<< (start) and >>> (end). The newlines after
<<< as well as the newline before >>> is not included in the body.
GET /status/418
> Accept: *
> User-Agent: KATT
> Host: {{<hostname}}:{{<port}}
< 418
< X-More-Info: http://tools.ietf.org/html/rfc2324
<<<
-=[ teapot ]=-
_...._
.' _ _ `.
| ."` ^ `". _,
\_;`"---"`|//
| ;/
\_ _/
`"""`
>>>
# Second request and response
Get unauthorized.
Also note that we don't expect any body.
The current date will be available to use in later requests as `{{<some_date}}.`
GET /status/401
> Accept: *
> User-Agent: KATT
< 401
< Www-Authenticate: Basic realm="Fake Realm"
< Date: {{>some_date}}
# Third request
Note that the title of this operation is "Third request", but that's just
markdown for you. You don't need to include a title, or even a description of
the operations unless you want to. In the fourth request we will skip the
description altogether.
Here we are getting a cached response.
GET /cache
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"url2": "http://httpbin.org/cache",
"headers": "{{_}}",
"args": "{{_}}",
"origin": "{{>origin}}"
}
GET /cache
> Accept: application/json
> User-Agent: KATT
> If-Modified-Since: {{<some_date}}
< 304
A fifth request to show that whitespace in JSON body is insignificant.
POST /post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
{"origin":"{{<origin}}","whoarewe":"{{<your_name}}_and_{{<my_name}}","date":"{{<some_date}}"}
< 200
< Content-Type: application/json
{
"args": "{{_}}",
"data": "{{>raw_data}}",
"files": {},
"form": {},
"headers": "{{_}}",
"origin": "{{<origin}}",
"url": "http://httpbin.org/post",
"json": {
"origin": "{{<origin}}",
"date": "{{<some_date}}",
"whoarewe": "{{>whoarewe}}"
}
}
GET /get?origin={{<origin}}&whoarewe={{<whoarewe}}
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"args": {
"whoarewe": "{{<your_name}}_and_{{<my_name}}",
"origin": "{{<origin}}"
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "http://httpbin.org/get?origin={{<origin}}&whoarewe={{<whoarewe}}"
}
|
--- Examples against httpbin.org ---
---
Examples of how some requests to _httpbin.org_ can be specified. Read more about
the httpbin.org API at http://httpbin.org/.
See ../README.md for details on how to test this specification.
---
# First request and response
Get a teapot from some full URL.
Leading or trailing blank lines in the body are stripped, unless you delimit
the body lines with the markers <<< (start) and >>> (end). The newlines after
<<< as well as the newline before >>> is not included in the body.
GET /status/418
> Accept: *
> User-Agent: KATT
> Host: {{<hostname}}:{{<port}}
< 418
< X-More-Info: http://tools.ietf.org/html/rfc2324
<<<
-=[ teapot ]=-
_...._
.' _ _ `.
| ."` ^ `". _,
\_;`"---"`|//
| ;/
\_ _/
`"""`
>>>
# Second request and response
Get unauthorized.
Also note that we don't expect any body.
The current date will be available to use in later requests as `{{<some_date}}.`
GET /status/401
> Accept: *
> User-Agent: KATT
< 401
< Www-Authenticate: Basic realm="Fake Realm"
< Date: {{>some_date}}
# Third request
Note that the title of this operation is "Third request", but that's just
markdown for you. You don't need to include a title, or even a description of
the operations unless you want to. In the fourth request we will skip the
description altogether.
Here we are getting a cached response.
GET /cache
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"url": "http://httpbin.org/cache",
"headers": "{{_}}",
"args": "{{_}}",
"origin": "{{>origin}}"
}
GET /cache
> Accept: application/json
> User-Agent: KATT
> If-Modified-Since: {{<some_date}}
< 304
A fifth request to show that whitespace in JSON body is insignificant.
POST /post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
{"origin":"{{<origin}}","whoarewe":"{{<your_name}}_and_{{<my_name}}","date":"{{<some_date}}"}
< 200
< Content-Type: application/json
{
"args": "{{_}}",
"data": "{{>raw_data}}",
"files": {},
"form": {},
"headers": "{{_}}",
"origin": "{{<origin}}",
"url": "http://httpbin.org/post",
"json": {
"origin": "{{<origin}}",
"date": "{{<some_date}}",
"whoarewe": "{{>whoarewe}}"
}
}
GET /get?origin={{<origin}}&whoarewe={{<whoarewe}}
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"args": {
"whoarewe": "{{<your_name}}_and_{{<my_name}}",
"origin": "{{<origin}}"
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "http://httpbin.org/get?origin={{<origin}}&whoarewe={{<whoarewe}}"
}
|
fix erroneous checkin
|
fix erroneous checkin
|
API Blueprint
|
apache-2.0
|
for-GET/katt
|
a351629c9d8a2495eb28785896440e5f015803ef
|
duan.apib
|
duan.apib
|
FORMAT: 1A
HOST: http://duan.dev/
# Duan
Duan is a simple app to help you generate shortened urls.
## Duan Collection [/api/duan]
### List All Duan [GET]
+ Request (application/json)
+ Response 200 (application/json)
[
{
"hash": "example",
"url": "http://www.example.com/",
"customized": "1"
},
{
"hash": "ttt",
"url": "https://twitter.com/",
"customized": "1"
}
]
### Create a New Duan [POST]
You may create your own duan using this action. It takes a JSON
object containing a url and an optional hash.
+ Request (application/json)
{
"hash": "t",
"url": "https://twitter.com/"
}
+ Response 201 (application/json)
+ Headers
Location: /api/duan/t
+ Body
{
"hash": "t",
"url": "https://twitter.com/",
"customized": "1"
}
|
FORMAT: 1A
HOST: http://duan.dev/
# Duan
Duan is a simple app to help you generate shortened urls.
## Duan Collection [/api/duan]
### List All Duan [GET]
+ Request (application/json)
+ Response 200 (application/json)
[
{
"hash": "t",
"url": "https://twitter.com/",
"customized": "1",
"created_at": {
"date": "2016-09-27 10:53:02.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
},
"updated_at": {
"date": "2016-09-27 10:53:02.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
}
},
{
"hash": "Y2I4Zm",
"url": "http://duan.dev/",
"customized": "0",
"created_at": {
"date": "2016-09-27 10:53:02.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
},
"updated_at": {
"date": "2016-09-27 10:53:02.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
}
}
]
### Create a New Duan [POST]
You may create your own duan using this action. It takes a JSON
object containing a url and an optional hash.
+ Request (application/json)
{
"hash": "t",
"url": "https://twitter.com/"
}
+ Response 201 (application/json)
+ Headers
Location: /api/duan/t
+ Body
{
"hash": "t",
"url": "https://twitter.com/",
"customized": "1",
"created_at": {
"date": "2016-09-27 10:51:59.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
},
"updated_at": {
"date": "2016-09-27 10:51:59.000000",
"timezone_type": 3,
"timezone": "Europe/Berlin"
}
}
|
Update apiary md file
|
Update apiary md file
|
API Blueprint
|
mit
|
bearzk/Duan,bearzk/Duan,bearzk/Duan
|
9f007c7df557cf42eba4c982aa23f36790878512
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# smarter-tv
Smarter TV API is a *media-center* service to store media meta-data.
# Group Video Library
Library collections are store using common objects for movies, tv-shows
## Movies [/library/movies]
### List all Movies [GET]
+ Response 200 (application/json)
[{
}]
### Add a Movie [POST]
+ Request (application/json)
{ }
+ Response 201 (application/json)
{ }
## Movie [/library/movies/{id}]
A single Movie object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Movie (tmdb) to perform action with.
### Retrieve a Movie [GET]
+ Response 200 (application/json)
{ }
### Remove a Movie [DELETE]
+ Response 204
## TV Shows [/library/tv-shows]
### List all shows [GET]
+ Response 200 (application/json)
[{
}]
|
FORMAT: 1A
# Smarter TV API
Smarter TV API is a *media-center* service to store media meta-data heavily inspired by [Trakt.tv v2 API](http://docs.trakt.apiary.io/).
## Verbs
The API uses restful verbs
Verb | Description
-------- | ----------------------------------------------------------
`GET` | Select one or more items. Success returns `200` status code.
`POST` | Create a new item. Success returns `201` status code.
`PATCH` | Update an item. Success returns `200` status code.
`DELETE` | Delete an item. Success returns `204` status code.
You can also use `PUT` verb to update an item but it's recommended to use `PATCH` instead.
## Status Codes
The API will respond with one of the following codes
Code | Description
------:| -------------------------------------------------------
`200` | Success
`201` | Success - *new resource created (with `POST`)*
`204` | Success - *no content to return (with `DELETE`)*
`400` | Bad Request - *request could'nt be parsed*
`401` | Unauthorized - *OAuth must be provided*
`403` | Forbidden - *invalid API key or unapproved app*
`404` | Not Found - *method exists, but no record found*
`405` | Method Not Found - *method doesn't exists*
`409` | Conflict - *resource allready created*
`412` | Precondition Failed - *use application/json content-type*
`422` | Unprocessable Entity - *validation errors*
`429` | Rate Limit Exceeded
`500` | Server Error
`503` | Server Unavailable - *server overloaded*
## Objects Schemas
All methods accepts and returns standardized objects validated by JSON Schemas
### Movie
### TV-Show schemas
#### TV-Show
#### Season
#### Episode
### Music schemas
#### Album
#### Song
### Person
# Group Video Library
Library collections are store using common objects for movies, tv-shows
## Movies [/library/movies]
### List all Movies [GET]
+ Response 200 (application/json)
[{
}]
### Add a Movie [POST]
+ Request (application/json)
{ }
+ Response 201 (application/json)
{ }
## Movie [/library/movies/{id}]
A single Movie object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Movie (tmdb) to perform action with.
### Retrieve a Movie [GET]
+ Response 200 (application/json)
{ }
### Remove a Movie [DELETE]
+ Response 204
## TV Shows [/library/tv-shows]
### List all shows [GET]
+ Response 200 (application/json)
[{
}]
|
Update API doc
|
Update API doc
|
API Blueprint
|
mit
|
aegypius/smarter-tv,aegypius/smarter-tv
|
72cb31ca11113739136f163da78811d1925ad158
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://tako.io
# octopodes
A prototype hypermedia API for recording the use of creative works and media objects on the World Wide Web.
# Group Works
Works related resources of the **API**
## Works Collection [/works]
### List all Works [GET]
+ Response 200 (vnd.collection+json)
{
"collection": {
"version": "1.0",
"href": "http://tako.io/works/",
"items": [
{
"href": "http://tako.io/works/ab324c53b..",
"data": [
{
"name": "creator",
"value": "John Snow",
"prompt": "Creator"
},
{
"name": "name",
"value": "The Night Watch",
"prompt": "Title"
}
],
"links": [
{
"name": "url",
"value": "http://example.com/the-night-watch",
"prompt": "URL"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/",
"prompt": "License"
}
]
}
],
"template": {
"data": [
{
"name": "url",
"value": "",
"prompt": "URL"
},
{
"name": "creator",
"value": "",
"prompt": "Creator of the Work"
},
{
"name": "license",
"value": "",
"prompt": "License"
}
]
}
}
}
### Create a Work [POST]
+ Request (vnd.collection+json)
{
"template": {
"data": [
{
"name": "name",
"value": "The Night Watch"
},
{
"name": "url",
"value": "http://example.com/the-night-watch"
},
{
"name": "creator",
"value": "John Snow"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/"
}
]
}
}
+ Response 201 (vnd.collection+json)
## Work [/works/{id}]
A single Work object with all its details
+ Parameters
+ id (required, string, `1`) ... Alphanumeric `id` of the Work to perform action with. Has example value.
### Retrieve a Work [GET]
+ Response 200 (vnd.collection+json)
{
"collection": {
"version": "1.0",
"href": "http://tako.io/works/",
"items": [
{
"href": "http://tako.io/works/ab324c53b..",
"data": [
{
"name": "creator",
"value": "John Snow",
"prompt": "Creator"
},
{
"name": "name",
"value": "The Night Watch",
"prompt": "Title"
}
],
"links": [
{
"name": "url",
"value": "http://example.com/the-night-watch",
"prompt": "URL"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/",
"prompt": "License"
}
]
}
],
"template": {
"data": [
{
"name": "url",
"value": "http://example.com/the-night-watch",
"prompt": "URL"
},
{
"name": "creator",
"value": "John Snow",
"prompt": "Creator of the Work"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/",
"prompt": "License"
}
]
}
}
}
|
FORMAT: 1A
HOST: http://project-octopus.org
# octopodes
A prototype hypermedia API for recording the use of creative works and media objects on the World Wide Web.
# Group Works
Works related resources of the **API**
## Works Collection [/works]
### List all Works [GET]
+ Response 200 (vnd.collection+json)
{
"collection": {
"version": "1.0",
"href": "http://tako.io/works/",
"items": [
{
"href": "http://project-octopus.org/works/ab324c53b..",
"data": [
{
"name": "creator",
"value": "John Snow",
"prompt": "Creator"
},
{
"name": "name",
"value": "The Night Watch",
"prompt": "Title"
}
],
"links": [
{
"name": "url",
"value": "http://example.com/the-night-watch",
"prompt": "URL"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/",
"prompt": "License"
}
]
}
],
"template": {
"data": [
{
"name": "url",
"value": "",
"prompt": "URL"
},
{
"name": "creator",
"value": "",
"prompt": "Creator of the Work"
},
{
"name": "license",
"value": "",
"prompt": "License"
}
]
}
}
}
### Create a Work [POST]
+ Request (vnd.collection+json)
{
"template": {
"data": [
{
"name": "name",
"value": "The Night Watch"
},
{
"name": "url",
"value": "http://example.com/the-night-watch"
},
{
"name": "creator",
"value": "John Snow"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/"
}
]
}
}
+ Response 201 (vnd.collection+json)
## Work [/works/{id}]
A single Work object with all its details
+ Parameters
+ id (required, string, `1`) ... Alphanumeric `id` of the Work to perform action with. Has example value.
### Retrieve a Work [GET]
+ Response 200 (vnd.collection+json)
{
"collection": {
"version": "1.0",
"href": "http://project-octopus.org/works/",
"items": [
{
"href": "http://project-octopus.org/works/ab324c53b..",
"data": [
{
"name": "creator",
"value": "John Snow",
"prompt": "Creator"
},
{
"name": "name",
"value": "The Night Watch",
"prompt": "Title"
}
],
"links": [
{
"name": "url",
"value": "http://example.com/the-night-watch",
"prompt": "URL"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/",
"prompt": "License"
}
]
}
],
"template": {
"data": [
{
"name": "url",
"value": "http://example.com/the-night-watch",
"prompt": "URL"
},
{
"name": "creator",
"value": "John Snow",
"prompt": "Creator of the Work"
},
{
"name": "license",
"value": "https://creativecommons.org/publicdomain/zero/1.0/",
"prompt": "License"
}
]
}
}
}
|
Update apib manually
|
Update apib manually
|
API Blueprint
|
apache-2.0
|
project-octopus/octopodes,project-octopus/octopodes
|
75099dca8eb643ffaeb9722cce2a6496d90cb7d2
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://localhost:3993
# scifgif
Humorous image microservice for isolated networks - xkcd and giphy full text search API
# xkcd
xkcd comic endpoints
## Random Xkcd Comic [/xkcd]
### Retrieve Random Xkcd Comic [GET]
## Xkcd by Number [/xkcd/number/{number}]
### Retrieve Xkcd by Number [GET]
+ Parameters
+ number: `1319` (number, required) - The xkcd comic ID
## Xkcd Search [/xkcd/search]
### Retrieve Xkcd Search [GET]
+ ```query```: Query (string, required) - Search terms
## Xkcd Slash [/xkcd/slash]
### Post xkcd slash query [POST]
+ ```text```: Query (string, required) - Search terms
## Xkcd Webhook [/xkcd/new_post]
### Post xkcd outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
# giphy
Giphy GIF endpoints
## Random Giphy [/giphy]
### Retrieve Random Giphy Gif [GET]
## Giphy Search [/giphy/search]
### Retrieve Giphy Search [GET]
+ ```query```: Query (string, required) - Search terms
## Giphy Slash [/giphy/slash]
### Post giphy slash query [POST]
+ ```text```: Query (string, required) - Search terms
## Giphy Webhook [/giphy/new_post]
### Post Giphy outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
# image
image endpoints
## Get Image [/image/{folder}/{file}]
### Retrieve Image [GET]
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
### Delete Image [DELETE]
Allows users to delete possibly offensive images
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
+ Response 200 (text/plain)
image successfully removed
|
FORMAT: 1A
HOST: http://localhost:3993
# scifgif
Humorous image microservice for isolated networks - xkcd and giphy full text search API
# xkcd
xkcd comic endpoints
# giphy
Giphy GIF endpoints
# image
image endpoints
## xkcd Random [/xkcd]
### Retrieve Random Xkcd Comic [GET]
## xkcd Number [/xkcd/number/{number}]
### Retrieve Xkcd by Number [GET]
+ Parameters
+ number: `1319` (number, required) - The xkcd comic ID
## xkcd Search [/xkcd/search]
### Perform Xkcd Search [GET]
+ ```query```: Query (string, required) - Search terms
## xkcd Slash [/xkcd/slash]
### Post xkcd slash query [POST]
+ ```text```: Query (string, required) - Search terms
## xkcd Webhook [/xkcd/new_post]
### Post xkcd outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
## giphy Random [/giphy]
### Retrieve Random Giphy Gif [GET]
## giphy Search [/giphy/search]
### Retrieve Giphy Search [GET]
+ ```query```: Query (string, required) - Search terms
## giphy Slash [/giphy/slash]
### Post giphy slash query [POST]
+ ```text```: Query (string, required) - Search terms
## giphy Webhook [/giphy/new_post]
### Post Giphy outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
## image [/image/{folder}/{file}]
### Retrieve Image [GET]
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
### Delete Image [DELETE]
Allows users to delete possibly offensive images
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
+ Response 200 (text/plain)
image successfully removed
|
update API docs
|
update API docs
|
API Blueprint
|
mit
|
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
|
1bea16c3bd6d85d1b2a5bae1fd2081d0af198b26
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# Admiral
Admiral is a deployment management system for Fleet and CoreOS. Unlike other deployment systems, Admiral also allows for automatic deployment and scaling of Fleet units.
# Configuration
Configuration for Admiral is stored directly in Etcd under the namespace specified by the command line parameter `--ns` (the default is `/admiral`). If this namespace is changed after the application has been launched for the first time already, then unexpected behavior will occur, as Admiral will likely believe it was just installed fresh and without any configuration set.
All configuration keys listed in this section are children of the root namespace. For example, a configuration item listed as `/config/enabled` will be located at `/admiral/config/enabled` with the default namespace.
## API Configuration
Configuration items for the general API.
### Authentication and Registration
#### `/config/registration/enabled`
A boolean indicating whether registration is enabled or not. If the configuration item does not exist, the server will default to disabling registration (i.e. disable registration).
# Admiral API Root [/v1]
This resource simply represents the root of the Admiral API. It provides a basic JSON response as validation that the API server is running.
## Retrieve the API Information [GET]
+ Response 200 (application/json)
{
"name": "Admiral API",
"version": 1
}
## Group Authentication
Resources related to authenticating users.
## Login [/v1/login]
### Login [POST]
Authenticates a user and returns a token that the client should use for further interactions with the API server.
Requests should be made with a JSON object containing the following items:
+ Request (application/json)
{
"username": "johndoe",
"password": "password"
}
+ Response 200 (application/json)
{
"token": "API token"
}
+ Response 401 (application/json)
{
"error": 401,
"message": "The specified user was invalid."
}
## Registration [/v1/register]
### Register [POST]
Registers a user with the specified information, and returns a new token if the registration was successful. Registration must be enabled on the server or this endpoint will return an error.
+ Request (application/json)
{
"username": "johndoe",
"password": "password"
}
+ Response 200 (application/json)
{
"token": "API token"
}
+ Response 500 (application/json)
{
"error": 500,
"message": "The server is not accepting registration."
}
## Group Apps & Services
## Applications [/v1/applications]
### Get Applications [GET]
Retrieves all of the applications.
+ Response 200 (application/json)
[
{
"id": "Application ID",
"name": "Application name",
"...": "..."
}
]
### Create Application [POST]
Creates a new application
+ Request (application/json)
{
"name": "Application Name"
}
+ Response 200 (application/json)
{
"id": "9ce05e8c-19fe-4872-b4c6-6b6c6a6968e1",
"name": "Application Name"
}
## Application [/v1/applications/{application_id}]
### Get Application [GET]
Get the specified application by its ID.
+ Response 200 (application/json)
{
"id": "9ce05e8c-19fe-4872-b4c6-6b6c6a6968e1",
"name": "Application Name"
}
### Delete Application [DELETE]
Delete the application with the specified ID.
+ Response 200 (application/json)
{
"ok": true
}
## Group Cluster
## Machines [/v1/machines]
### Get Machines [GET]
Retrieves the current machines in the cluster.
+ Response 200 (application/json)
[
{
"machine": "Machine ID",
"ip": "192.168.0.1",
"metadata": {
"key": "value"
}
}
]
+ Response 500 (application/json)
{
"error": 500,
"message": "There was a problem fetching the machines."
}
|
FORMAT: 1A
# Admiral
Admiral is a deployment management system for Fleet and CoreOS. Unlike other deployment systems, Admiral also allows for automatic deployment and scaling of Fleet units.
# Configuration
Configuration for Admiral is stored directly in Etcd under the namespace specified by the command line parameter `--ns` (the default is `/admiral`). If this namespace is changed after the application has been launched for the first time already, then unexpected behavior will occur, as Admiral will likely believe it was just installed fresh and without any configuration set.
All configuration keys listed in this section are children of the root namespace. For example, a configuration item listed as `/config/enabled` will be located at `/admiral/config/enabled` with the default namespace.
## API Configuration
Configuration items for the general API.
### Authentication and Registration
#### `/config/registration/enabled`
A boolean indicating whether registration is enabled or not. If the configuration item does not exist, the server will default to disabling registration (i.e. disable registration).
# Admiral API Root [/v1]
This resource simply represents the root of the Admiral API. It provides a basic JSON response as validation that the API server is running.
## Retrieve the API Information [GET]
+ Response 200 (application/json)
{
"name": "Admiral API",
"version": 1
}
## Group Authentication
Resources related to authenticating users.
## Login [/v1/login]
### Login [POST]
Authenticates a user and returns a token that the client should use for further interactions with the API server.
Requests should be made with a JSON object containing the following items:
+ Request (application/json)
{
"username": "johndoe",
"password": "password"
}
+ Response 200 (application/json)
{
"token": "API token"
}
+ Response 401 (application/json)
{
"error": 401,
"message": "The specified user was invalid."
}
## Registration [/v1/register]
### Register [POST]
Registers a user with the specified information, and returns a new token if the registration was successful. Registration must be enabled on the server or this endpoint will return an error.
+ Request (application/json)
{
"username": "johndoe",
"password": "password"
}
+ Response 200 (application/json)
{
"token": "API token"
}
+ Response 500 (application/json)
{
"error": 500,
"message": "The server is not accepting registration."
}
## Group Apps & Services
## Applications [/v1/applications]
### Get Applications [GET]
Retrieves all of the applications.
+ Response 200 (application/json)
[
{
"id": "Application ID",
"name": "Application name",
"...": "..."
}
]
### Create Application [POST]
Creates a new application with the specified fields.
+ Request (application/json)
{
"name": "Application Name"
}
+ Response 200 (application/json)
{
"id": "9ce05e8c-19fe-4872-b4c6-6b6c6a6968e1",
"name": "Application Name"
}
## Application [/v1/applications/{application_id}]
### Get Application [GET]
Get the specified application by its ID.
+ Response 200 (application/json)
{
"id": "9ce05e8c-19fe-4872-b4c6-6b6c6a6968e1",
"name": "Application Name"
}
### Delete Application [DELETE]
Delete the application with the specified ID.
+ Response 200 (application/json)
{
"ok": true
}
## Group Cluster
## Machines [/v1/machines]
### Get Machines [GET]
Retrieves the current machines in the cluster.
+ Response 200 (application/json)
[
{
"machine": "Machine ID",
"ip": "192.168.0.1",
"metadata": {
"key": "value"
}
}
]
+ Response 500 (application/json)
{
"error": 500,
"message": "There was a problem fetching the machines."
}
|
Update create application API endpoint description
|
Update create application API endpoint description
|
API Blueprint
|
mit
|
andrewmunsell/admiral
|
19dd580b7616fda07b4c3fce3ec1657d11e10cc5
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# SCU Evals
The SCU Evals API powers the SCU Evals front-end by managing all the data and actions.
## Meta [/]
### Get API Status [GET]
+ Response 200 (application/json)
+ Attributes
+ status: ok (string, required)
## Authentication [/auth]
### Authenticate New/Old User [POST]
+ Request (application/json)
+ Attributes
+ id_token (string, required)
+ Response 200 (application/json)
+ Attributes
+ status: ok, new, incomplete (enum[string], required, fixed)
+ jwt (string, required)
+ Response 500 (application/json)
+ Attributes
+ message: `failed to get certificates from Google: <reason>` (string, required)
+ Response 401 (application/json)
+ Attributes
+ message: `token is expired` (string, required)
+ Response 422 (application/json)
+ Attributes
+ message (enum[string], required, fixed-type)
+ `invalid id_token`
+ `invalid id_token: <reason>`
+ `invalid id_token format: <reason>`
+ Response 403 (application/json)
+ Attributes
+ status: non-student (string, required, fixed)
### Validate User [GET /auth/validate]
+ Response 200 (application/json)
+ Attributes
+ jwt (string, required) - New JWT
### Authenticate API Key [POST /auth/api]
+ Request (application/json)
+ Attributes
+ api_key (string, required)
+ Response 200 (application/json)
+ Attributes
+ jwt (string, required)
## Classes [/classes/{quarter_id}/{professor_id}/{course_id}]
### Get Class Details [GET]
+ Parameters
+ quarter_id: 3900 (number) - The ID of the quarter that the class was taught
+ professor_id: 1 (number) - The ID of the professor that taught the class
+ course_id: 1 (number) - The ID of the course that was taught
+ Response 200 (application/json)
+ Attributes
+ course (Course, required)
+ quarter (Quarter, required)
+ professor (Professor, required)
+ user_posted: false (boolean, required)
Whether the current user has posted an
evaluation or not for this combination
+ Response 404 (application/json)
+ Attributes
+ message: class does not exist (string, required, fixed)
## Courses [/courses]
### List All Courses [GET /courses{?quarter_id,professor_id}]
+ Parameters
+ quarter_id (optional, number) - Limit the list to courses that were taught during the specified quarter
+ professor_id (optional, number) - Limit the list to courses that were taught by the specified professor
+ Response 200 (application/json)
+ Attributes (array[Course], fixed-type)
### Post Courses [POST]
+ Request (application/json)
+ Attributes
+ courses (array, fixed-type)
+ (object, required)
+ term: 3900 (string, required)
+ subject: ANTH (string, required)
+ catalog_nbr: 1 (number, required)
+ class_descr: Intro to Bio Anth (string, required)
+ instr_1: Doe, John (string, required)
+ instr_2 (string, required)
+ instr_3 (string, required)
+ Response 200 (application/json)
+ Attributes
+ result: success (string, fixed)
+ updated_count: 248 (number, required)
+ Response 422 (application/json)
+ Attributes
+ message (enum[string], required, fixed)
+ Members
+ `The request was well-formed but was unable to be followed due to semantic errors.`
+ missing department to COEN
### Get Course Details [GET /courses/{id}{?embed}]
+ Parameters
+ id: 1 (number) - The course for which to get details
+ embed (enum[string], optional)
Which other data to embed.
Specifying `professors` gives you a list of professors that has taught the course.
+ Members
+ `professors`
+ Response 200 (application/json)
Example response with the professors embedded.
+ Attributes (Course, required)
+ evaluations (array, required, fixed-type)
+ (Evaluation, required)
+ user_vote: true (boolean, required)
+ quarter_id: 3900 (number, required)
+ professor (Professor, required)
+ author (required)
+ self: false (boolean, required)
+ majors: 1, 3 (array[number], required)
+ graduation_year: 2020 (number, required)
+ professors (array[Professor], optional)
+ Response 404 (application/json)
+ Attributes
+ message: course with the specified id not found (string, required, fixed)
## Departments [/departments]
### List All Departments [GET]
+ Response 200 (application/json)
+ Attributes (array[Department], required, fixed-type)
### Post Departments [POST]
+ Request (application/json)
+ Attributes
+ departments (array, required, fixed-type)
+ (object)
+ value: ACTG (string, required)
+ label: `Accounting (ACTG)` (string, required)
+ school: BUS (string, required)
+ Response 200 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ updated_count: 74 (number, required)
+ Response 422 (application/json)
+ Attributes
+ message: `The request was well-formed but was unable to be followed due to semantic errors.` (string, required, fixed)
## Evaluations [/evaluations]
### List All Your Own Evaluations [GET]
+ Response 200 (application/json)
+ Attributes (array, required, fixed-type)
+ (Evaluation)
+ quarter_id: 3900 (number, required)
+ professor (Professor, required)
+ course (Course, required)
### List Recent Evaluations [GET /evaluations/recent{?count}]
+ Parameters
+ count (number, optional) - How many recent evaluations to return.
+ Default: 10
+ Response 200 (application/json)
+ Attributes (array, required)
+ (Evaluation, required)
+ quarter_id: 3900 (number, required)
+ professor (Professor, required)
+ course (Course, required)
### Get Evaluation Details [GET /evaluations/{id}]
+ Parameters
+ id: 1 (number, required)
+ Response 200 (application/json)
+ Attributes (Evaluation, required)
+ Response 404 (application/json)
+ Attributes
+ message: `evaluation with the specified id not found` (string, required, fixed)
### Submit Evaluation [POST]
+ Request (application/json)
+ Attributes
+ quarter_id: 3900 (number, required)
+ professor_id: 1 (number, required)
+ course_id: 1 (number, required)
+ display_grad_year: false (boolean, required)
+ display_majors: true (boolean, required)
+ evaluation (EvaluationDataV1, required)
+ Response 201 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ Response 422 (application/json)
+ Attributes
+ message: `invalid quarter/course/professor combination` (string, required, fixed)
+ Response 409
+ Attributes
+ message: `evaluation for this combination already exists` (string, required, fixed)
### Delete Evaluation [DELETE /evaluations/{id}]
+ Parameters
+ id: 1 (number, required)
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ message: `evaluation with the specified id not found` (string, required, fixed)
+ Response 403 (application/json)
+ Attributes
+ message: `you are only allowed to delete your own evaluations` (string, required, fixed)
## Evaluation Votes [/evaluations/{id}/vote]
+ Parameters
+ id: 1 (number, required)
### Add/Overwrite Vote [PUT]
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ message: `evaluation with the specified id not found` (string, required, fixed)
+ Response 403 (application/json)
+ Attributes
+ message: `not allowed to vote on your own evaluations` (string, required, fixed)
### Delete Vote [DELETE /evaluations/{eval_id}/vote/{vote_id}]
+ Parameters
+ eval_id: 1 (number, required)
+ vote_id: 1 (number, required)
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ message (enum[string], required, fixed)
+ `evaluation with the specified id not found`
+ `vote not found`
## Majors [/majors]
### List All Majors [GET]
+ Response 200 (application/json)
+ Attributes (array[Major], required, fixed-type)
### Post Majors [POST]
+ Request (application/json)
+ Attributes
+ majors (array[string], required, fixed-type)
+ Response 200 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ Response 422 (application/json)
+ Attributes
+ message: `failed to insert majors: <db error>` (string, required)
## Professors [/professors]
### List All Professors [GET /professors{?course_id,quarter_id}]
+ Parameters
+ course_id: 1 (number, optional) - Limit the list to professors that taught the specified course.
+ quarter_id: 3900 (number, optional) - Limit the list to professors who taught during the specified quarter.
+ Response 200 (application/json)
+ Attributes (array[Professor], required, fixed-type)
### Get Professor Details [GET /professors/{id}{?embed}]
+ Parameters
+ id: 1 (number) - The professor for which to get details.
+ embed (enum[string], optional)
Which other data to embed.
Specifying `courses` gives you a list of courses that this professor has taught.
+ Members
+ `courses`
+ Response 200 (application/json)
Example response with the courses embedded.
+ Attributes (Professor, required)
+ evaluations (array, required, fixed-type)
+ (Evaluation, required)
+ user_vote: true (boolean, required)
+ quarter_id: 3900 (number, required)
+ course (Course, required)
+ author (required)
+ self: false (boolean, required)
+ majors: 1, 3 (array[number], required)
+ graduation_year: 2020 (number, required)
+ courses (array[Course], optional)
+ Response 404 (application/json)
+ Attributes
+ message: professor with the specified id not found (string, required, fixed)
## Quarters [/quarters{?course_id,professor_id}]
### List All Quarters [GET]
+ Parameters
+ course_id: 1 (number, optional) - Limit the list to quarters during which the specified course was taught.
+ professor_id: 1 (number, optional) - Limit the list to quarters during which the specified professor taught.
+ Response 200 (application/json)
+ Attributes (array[Quarter], required, fixed-type)
## Search [/search{?q,limit}]
+ Parameters
+ q: Mat (string, required) - The search query.
+ limit (number, optional) - Limit the number of results. Max is 50.
+ Default: 50
### Search For Classes And Professors [GET]
+ Response 200 (application/json)
+ Attributes
+ courses (array[Course], required, fixed-type)
+ professors (array[Professor], required, fixed-type)
## Students [/students/{id}]
+ Parameters
+ id: 1 (number, required)
### Update Info [PUT]
+ Request (application/json)
+ Attributes
+ graduation_year: 2020 (number, required)
+ gender: m, f, o (enum[string], required, fixed)
+ majors: 1, 4 (array[number], required) - Between 1 and 3 major IDs.
+ Response 200 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ jwt (string, required)
+ Response 403 (application/json)
+ Attributes
+ message: `you do not have the rights to modify another student` (string, required, fixed)
+ Response 422 (application/json)
+ Attributes
+ message: `invalid major(s) specified` (string, required, fixed)
# Data Structures
## Course (object)
+ id: 1 (number, required)
+ number: 42 (number, required)
+ title: What is Life (string, required)
+ department_id: 3 (number, required)
## Department (object)
+ id: 1 (number, required)
+ abbr: COEN (string, required)
+ name: Computer Science & Engineering (string, required)
+ school: EGR (string, required)
## Evaluation (object)
+ id: 1 (number, required)
+ version: 1 (number, required)
+ post_time: `2018-02-06T22:24:11.098122-08:00` (string, required) - Post time in ISO 8601
+ data (EvaluationDataV1, required)
+ votes_score: `-3` (number, required)
## EvaluationDataV1 (object)
+ attitude: 1 (number, required)
+ availability: 1 (number, required)
+ clarity: 1 (number, required)
+ grading_speed: 1 (number, required)
+ resourcefulness: 1 (number, required)
+ easiness: 1 (number, required)
+ workload: 1 (number, required)
+ recommended: 1 (number, required)
+ comment: Love the lectures (string, required)
## Major (object)
+ id: 1 (number, required)
+ name: Mathematics (string, required)
## Professor (object)
+ id: 1 (number, required)
+ first_name: John (string, required)
+ last_name: Doe (string, required)
## Quarter (object)
+ id: 1 (number, required)
+ year: 2018 (number, required)
+ name: Spring (string, required)
+ current: true (boolean, required)
## Student (User)
+ gender: m, f, o (enum[string], required)
+ graduation_year: 2020 (number, required)
+ majors (array[number], required) - An array of majors ids
## User (object)
+ id: 1 (number, required)
+ university_id: 1 (number, required)
+ email: [email protected] (string, required)
+ first_name: John (string, required)
+ last_name: Doe (string, required)
+ picture: https://foo.bar/d3hj2d2lk8 (string, required) - The URL to the user's picture
+ roles (array[number], required) - An array of roles ids
|
FORMAT: 1A
# SCU Evals
The SCU Evals API powers the SCU Evals front-end by managing all the data and actions.
## Meta [/]
### Get API Status [GET]
+ Response 200 (application/json)
+ Attributes
+ status: ok (string, required)
## Authentication [/auth]
### Authenticate New/Old User [POST]
+ Request (application/json)
+ Attributes
+ id_token (string, required)
+ Response 200 (application/json)
+ Attributes
+ status: ok, new, incomplete (enum[string], required, fixed)
+ jwt (string, required)
+ Response 500 (application/json)
+ Attributes
+ message: `failed to get certificates from Google: <reason>` (string, required)
+ Response 401 (application/json)
+ Attributes
+ message: `token is expired` (string, required)
+ Response 422 (application/json)
+ Attributes
+ message (enum[string], required, fixed-type)
+ `invalid id_token`
+ `invalid id_token: <reason>`
+ `invalid id_token format: <reason>`
+ Response 403 (application/json)
+ Attributes
+ status: non-student (string, required, fixed)
### Validate User [GET /auth/validate]
+ Response 200 (application/json)
+ Attributes
+ jwt (string, required) - New JWT
### Authenticate API Key [POST /auth/api]
+ Request (application/json)
+ Attributes
+ api_key (string, required)
+ Response 200 (application/json)
+ Attributes
+ jwt (string, required)
## Classes [/classes/{quarter_id}/{professor_id}/{course_id}]
### Get Class Details [GET]
+ Parameters
+ quarter_id: 3900 (number) - The ID of the quarter that the class was taught
+ professor_id: 1 (number) - The ID of the professor that taught the class
+ course_id: 1 (number) - The ID of the course that was taught
+ Response 200 (application/json)
+ Attributes
+ course (Course, required)
+ quarter (Quarter, required)
+ professor (Professor, required)
+ user_posted: false (boolean, required)
Whether the current user has posted an
evaluation or not for this combination
+ Response 404 (application/json)
+ Attributes
+ message: class does not exist (string, required, fixed)
## Courses [/courses]
### List All Courses [GET /courses{?quarter_id,professor_id}]
+ Parameters
+ quarter_id (optional, number) - Limit the list to courses that were taught during the specified quarter
+ professor_id (optional, number) - Limit the list to courses that were taught by the specified professor
+ Response 200 (application/json)
+ Attributes (array[Course], fixed-type)
### Post Courses [POST]
+ Request (application/json)
+ Attributes
+ courses (array, fixed-type)
+ (object, required)
+ term: 3900 (string, required)
+ subject: ANTH (string, required)
+ catalog_nbr: 1 (number, required)
+ class_descr: Intro to Bio Anth (string, required)
+ instr_1: Doe, John (string, required)
+ instr_2 (string, required)
+ instr_3 (string, required)
+ Response 200 (application/json)
+ Attributes
+ result: success (string, fixed)
+ updated_count: 248 (number, required)
+ Response 422 (application/json)
+ Attributes
+ message (enum[string], required, fixed)
+ Members
+ `The request was well-formed but was unable to be followed due to semantic errors.`
+ missing department to COEN
### Get Course Details [GET /courses/{id}{?embed}]
+ Parameters
+ id: 1 (number) - The course for which to get details
+ embed (enum[string], optional)
Which other data to embed.
Specifying `professors` gives you a list of professors that has taught the course.
+ Members
+ `professors`
+ Response 200 (application/json)
Example response with the professors embedded.
+ Attributes (Course, required)
+ evaluations (array, required, fixed-type)
+ (Evaluation, required)
+ user_vote: true (boolean, required)
+ quarter_id: 3900 (number, required)
+ professor (Professor, required)
+ author (required)
+ self: false (boolean, required)
+ majors: 1, 3 (array[number], required)
+ graduation_year: 2020 (number, required)
+ professors (array[Professor], optional)
+ Response 404 (application/json)
+ Attributes
+ message: course with the specified id not found (string, required, fixed)
## Departments [/departments]
### List All Departments [GET]
+ Response 200 (application/json)
+ Attributes (array[Department], required, fixed-type)
### Post Departments [POST]
+ Request (application/json)
+ Attributes
+ departments (array, required, fixed-type)
+ (object)
+ value: ACTG (string, required)
+ label: `Accounting (ACTG)` (string, required)
+ school: BUS (string, required)
+ Response 200 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ updated_count: 74 (number, required)
+ Response 422 (application/json)
+ Attributes
+ message: `The request was well-formed but was unable to be followed due to semantic errors.` (string, required, fixed)
## Evaluations [/evaluations]
### List All Your Own Evaluations [GET]
+ Response 200 (application/json)
+ Attributes (array, required, fixed-type)
+ (Evaluation)
+ quarter_id: 3900 (number, required)
+ professor (Professor, required)
+ course (Course, required)
### List Recent Evaluations [GET /evaluations/recent{?count}]
+ Parameters
+ count (number, optional) - How many recent evaluations to return.
+ Default: 10
+ Response 200 (application/json)
+ Attributes (array, required)
+ (Evaluation, required)
+ quarter_id: 3900 (number, required)
+ professor (Professor, required)
+ course (Course, required)
### Get Evaluation Details [GET /evaluations/{id}]
+ Parameters
+ id: 1 (number, required)
+ Response 200 (application/json)
+ Attributes (Evaluation, required)
+ Response 404 (application/json)
+ Attributes
+ message: `evaluation with the specified id not found` (string, required, fixed)
### Submit Evaluation [POST]
+ Request (application/json)
+ Attributes
+ quarter_id: 3900 (number, required)
+ professor_id: 1 (number, required)
+ course_id: 1 (number, required)
+ display_grad_year: false (boolean, required)
+ display_majors: true (boolean, required)
+ evaluation (EvaluationDataV1, required)
+ Response 201 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ Response 422 (application/json)
+ Attributes
+ message: `invalid quarter/course/professor combination` (string, required, fixed)
+ Response 409
+ Attributes
+ message: `evaluation for this combination already exists` (string, required, fixed)
### Delete Evaluation [DELETE /evaluations/{id}]
+ Parameters
+ id: 1 (number, required)
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ message: `evaluation with the specified id not found` (string, required, fixed)
+ Response 403 (application/json)
+ Attributes
+ message: `you are only allowed to delete your own evaluations` (string, required, fixed)
## Evaluation Votes [/evaluations/{id}/vote]
+ Parameters
+ id: 1 (number, required)
### Add/Overwrite Vote [PUT]
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ message: `evaluation with the specified id not found` (string, required, fixed)
+ Response 403 (application/json)
+ Attributes
+ message: `not allowed to vote on your own evaluations` (string, required, fixed)
### Delete Vote [DELETE /evaluations/{eval_id}/vote/{vote_id}]
+ Parameters
+ eval_id: 1 (number, required)
+ vote_id: 1 (number, required)
+ Response 204 (application/json)
+ Response 404 (application/json)
+ Attributes
+ message (enum[string], required, fixed)
+ `evaluation with the specified id not found`
+ `vote not found`
## Majors [/majors]
### List All Majors [GET]
+ Response 200 (application/json)
+ Attributes (array[Major], required, fixed-type)
### Post Majors [POST]
+ Request (application/json)
+ Attributes
+ majors (array[string], required, fixed-type)
+ Response 200 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ Response 422 (application/json)
+ Attributes
+ message: `failed to insert majors: <db error>` (string, required)
## Professors [/professors]
### List All Professors [GET /professors{?course_id,quarter_id}]
+ Parameters
+ course_id: 1 (number, optional) - Limit the list to professors that taught the specified course.
+ quarter_id: 3900 (number, optional) - Limit the list to professors who taught during the specified quarter.
+ Response 200 (application/json)
+ Attributes (array[Professor], required, fixed-type)
### Get Professor Details [GET /professors/{id}{?embed}]
+ Parameters
+ id: 1 (number) - The professor for which to get details.
+ embed (enum[string], optional)
Which other data to embed.
Specifying `courses` gives you a list of courses that this professor has taught.
+ Members
+ `courses`
+ Response 200 (application/json)
Example response with the courses embedded.
+ Attributes (Professor, required)
+ evaluations (array, required, fixed-type)
+ (Evaluation, required)
+ user_vote: true (boolean, required)
+ quarter_id: 3900 (number, required)
+ course (Course, required)
+ author (required)
+ self: false (boolean, required)
+ majors: 1, 3 (array[number], required)
+ graduation_year: 2020 (number, required)
+ courses (array[Course], optional)
+ Response 404 (application/json)
+ Attributes
+ message: professor with the specified id not found (string, required, fixed)
## Quarters [/quarters{?course_id,professor_id}]
### List All Quarters [GET]
+ Parameters
+ course_id: 1 (number, optional) - Limit the list to quarters during which the specified course was taught.
+ professor_id: 1 (number, optional) - Limit the list to quarters during which the specified professor taught.
+ Response 200 (application/json)
+ Attributes (array[Quarter], required, fixed-type)
## Search [/search{?q,limit}]
+ Parameters
+ q: Mat (string, required) - The search query.
+ limit (number, optional) - Limit the number of results. Max is 50.
+ Default: 50
### Search For Classes And Professors [GET]
+ Response 200 (application/json)
+ Attributes
+ courses (array[Course], required, fixed-type)
+ professors (array[Professor], required, fixed-type)
## Students [/students/{id}]
+ Parameters
+ id: 1 (number, required)
### Update Info [PATCH]
+ Request (application/json)
+ Attributes
+ graduation_year: 2020 (number, required)
+ gender: m, f, o (enum[string], required, fixed)
+ majors: 1, 4 (array[number], required) - Between 1 and 3 major IDs.
+ Response 200 (application/json)
+ Attributes
+ result: success (string, required, fixed)
+ jwt (string, required)
+ Response 403 (application/json)
+ Attributes
+ message: `you do not have the rights to modify another student` (string, required, fixed)
+ Response 422 (application/json)
+ Attributes
+ message: `invalid major(s) specified` (string, required, fixed)
# Data Structures
## Course (object)
+ id: 1 (number, required)
+ number: 42 (number, required)
+ title: What is Life (string, required)
+ department_id: 3 (number, required)
## Department (object)
+ id: 1 (number, required)
+ abbr: COEN (string, required)
+ name: Computer Science & Engineering (string, required)
+ school: EGR (string, required)
## Evaluation (object)
+ id: 1 (number, required)
+ version: 1 (number, required)
+ post_time: `2018-02-06T22:24:11.098122-08:00` (string, required) - Post time in ISO 8601
+ data (EvaluationDataV1, required)
+ votes_score: `-3` (number, required)
## EvaluationDataV1 (object)
+ attitude: 1 (number, required)
+ availability: 1 (number, required)
+ clarity: 1 (number, required)
+ grading_speed: 1 (number, required)
+ resourcefulness: 1 (number, required)
+ easiness: 1 (number, required)
+ workload: 1 (number, required)
+ recommended: 1 (number, required)
+ comment: Love the lectures (string, required)
## Major (object)
+ id: 1 (number, required)
+ name: Mathematics (string, required)
## Professor (object)
+ id: 1 (number, required)
+ first_name: John (string, required)
+ last_name: Doe (string, required)
## Quarter (object)
+ id: 1 (number, required)
+ year: 2018 (number, required)
+ name: Spring (string, required)
+ current: true (boolean, required)
## Student (User)
+ gender: m, f, o (enum[string], required)
+ graduation_year: 2020 (number, required)
+ majors (array[number], required) - An array of majors ids
## User (object)
+ id: 1 (number, required)
+ university_id: 1 (number, required)
+ email: [email protected] (string, required)
+ first_name: John (string, required)
+ last_name: Doe (string, required)
+ picture: https://foo.bar/d3hj2d2lk8 (string, required) - The URL to the user's picture
+ roles (array[number], required) - An array of roles ids
|
Fix wrong request method in docs
|
Fix wrong request method in docs
|
API Blueprint
|
agpl-3.0
|
SCUEvals/scuevals-api,SCUEvals/scuevals-api
|
ef95c8362fbb21943dd8ee70e5c12748eaa17b2a
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://journeyapp.no-domain-yet.com/v1
# Journey
Journey helps you organize your trips, allowing you to maximize your experiences at every destination you visit and to relive those moments when you return home.
The Journey API allows consumers to access and create trips, which contain lists of places users want to go for their destinations.
## Authentication [/login]
Journey uses JSON Web Tokens for the API server's authentication. This means the server does not maintain sessions for each connection. Once the server authenticates a client and provides a JSON Web Token, all subsequent API requests (except for user account creation) need to include that token in the HTTP `Authorization` header.
### Login [POST]
Log in with either a username or email, as well as the password. The API returns the user object and a JSON Web Token if authentication is successful.
+ Request (application/json)
{
"username": "amy",
"password": "abc123"
}
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Doe",
"__v": 0,
"signupDate": "2016-06-29T02:44:52.928Z"
},
"token": "JWT <JWT_TOKEN>"
}
## User Management [/users]
### User Sign Up [POST]
Create a new user account. Requires user to provide a username, email, and password. Optionally, user can provide a full name.
The API returns the user object and a JSON Web Token if account creation is successful, meaning that the user will already be logged in.
+ Request (application/json)
{
"username": "amy",
"email": "[email protected]",
"password": "abc123",
"name": "Amy Doe"
}
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Doe",
"__v": 0,
"signupDate": "2016-07-27T02:44:52.928Z"
},
"token": "JWT <JWT_TOKEN>"
}
### Get User Information [GET /users/{userId}]
Retrieve information about a user. Only allowed on currently authenticated user.
+ Parameters
+ userId (string) - User ID to fetch information for.
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Doe",
"__v": 0,
"signupDate": "2016-07-27T02:44:52.928Z"
}
}
### Update User Information [PUT /users/{userId}]
Updates the user. Only allowed on currently authenticated user.
+ Parameters
+ userId (string) - User ID to update information for.
+ Request (application/json)
{
"email": "[email protected]",
"name": "Amy Emily Doe"
}
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Emily Doe",
"__v": 0,
"signupDate": "2016-07-27T02:44:52.928Z"
}
}
### Get User's trips [GET /users/{userId}/trips?page={page}]
Get all the trips created by the currently authenticated user, in reverse chronological order. Only a subset of each trip object is returned in this route. To get full details about the trip, use GET /trips/{tripId}.
+ Parameters
+ userId (string) - User ID to get entries for.
+ page (number) - Page # to return based on every page of 10 trips.
+ Response 200 (application/json)
{
"page": 1,
"results": 2,
"trips": [
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"visibility": "private"
},
{
"_id": "578edda250b26fc5d3c6baa9",
"creator": "5785e22fdff4328371f8e781",
"title": "Amy and Adam Take Vietnam!",
"startDate": "2016-09-22"
"endDate": "2016-09-27",
"destinations": [
"Vietnam"
],
"visibility": "public"
}
]
}
### Get User's entries [GET /users/{userId}/entries?count={count}&page={page}&maxDate={maxDate}]
Get all journey entries created by the currently authenticated user, in reverse chronological order.
+ Parameters
+ userId (string) - User ID to get entries for.
+ count (number) - Number of items to return. Default is 20
+ page (number) - Page # to return based on the count per page.
+ maxDate (string) - Cut-off date for first entry to return, in ISODate format
+ Response 200 (application/json)
{
"page": 1,
"results": 2,
"entries": [
{
"_id": "578ede2a50b26fc5d3c6baaa",
"creator": "5785e22fdff4328371f8e781",
"type": "video",
"message": "And here's a video showing him scooting around",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/4daba8e3-78c4-4ef2-b187-06b9d97b3228",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773233
]
},
"date": "2016-07-20T02:12:58.332Z"
},
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Check out this cute picture of Mochi!",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/e7b5b426-0d6b-4325-9d4e-8d2ba6fc8502",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773224
]
},
"date": "2016-07-20T02:10:42.442Z"
}
]
}
## Trip Management [/trips]
Users can create and manage trips on the Journey app. Each trip specifies a list of destinations that the user is visiting, as well as lists of places the user wants to visit and has already visited.
Each trip includes the following:
* Date created
* Trip creator
* A title
* A list of destinations (cities or countries)
* A list of places to visit
* (COMING SOON) A trip plan, which is a list of places that represents an itinerary
* Visibility (public or private)
### Create a trip [POST]
Creates a new trip. Only a title is required during creation. Returns the newly created trip upon success.
+ Request (application/json)
{
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"visibility": "private"
}
+ Response 200 (application/json)
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"wishlist": [],
"visibility": "private"
}
## Journey Entries [/entries]
The concept of journey entries may be deprecated as I transition the app towards a trip planning experience.
Each journey entry includes the following:
* Date created
* User who created it
* a location (lat/lng coordinates)
* an entry type (text, photos, video, audio)
* entry contents (URL to media saved to Amazon S3)
* a message (required for text entries)
### Create an entry [POST]
Create a journey entry. Returns an updated list of the user's entries upon successful creation.
* The type of the entry is required.
* Contents is required if the user is creating a `video`, `audio`, or `photo` entry.
* Message is required if the user is creating a `text` entry.
+ Request (application/json)
{
"type": "photo",
"contents": "http://s3.amazon.com/journey/photo.jpg",
"message": "Picture of Amy and Adam!",
"loc": {
"type": "Point",
"coordinates": [
-122.431397,
37.773982
]
}
}
+ Response 200 (application/json)
{
"page": 1,
"results": 3,
"entries": [
{
"_id": "578ede2a50b26fc5d3c6badd",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Picture of Amy and Adam!",
"contents": "http://s3.amazon.com/journey/photo.jpg",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431397,
37.773982
]
},
"date": "2016-07-27T15:02:57.912Z"
},
{
"_id": "578ede2a50b26fc5d3c6baaa",
"creator": "5785e22fdff4328371f8e781",
"type": "video",
"message": "And here's a video showing him scooting around",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/4daba8e3-78c4-4ef2-b187-06b9d97b3228",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773233
]
},
"date": "2016-07-20T02:12:58.332Z"
},
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Check out this cute picture of Mochi!",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/e7b5b426-0d6b-4325-9d4e-8d2ba6fc8502",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773224
]
},
"date": "2016-07-20T02:10:42.442Z"
}
]
}
### Get an entry [GET /entries/{entryId}]
Fetches details for a specific entry created by the currently authenticated user.
+ Parameters
+ entryId (string) - Entry ID
+ Response 200 (application/json)
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Check out this cute picture of Mochi!",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/e7b5b426-0d6b-4325-9d4e-8d2ba6fc8502",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773224
]
},
"date": "2016-07-20T02:10:42.442Z"
}
### Delete an entry [DELETE /entries/{entryId}]
Removes an entry, first confirming that the entry was created by the current user. The contents are also deleted from S3 if they exist.
+ Parameters
+ entryId (string) - Entry ID
+ Response 200 (application/json)
{
"message": "Entry deleted."
}
|
FORMAT: 1A
HOST: http://journeyapp.no-domain-yet.com/v1
# Journey
Journey helps you organize your trips, allowing you to maximize your experiences at every destination you visit and to relive those moments when you return home.
The Journey API allows consumers to access and create trips, which contain lists of places users want to go for their destinations.
## Authentication [/login]
Journey uses JSON Web Tokens for the API server's authentication. This means the server does not maintain sessions for each connection. Once the server authenticates a client and provides a JSON Web Token, all subsequent API requests (except for user account creation) need to include that token in the HTTP `Authorization` header.
### Login [POST]
Log in with either a username or email, as well as the password. The API returns the user object and a JSON Web Token if authentication is successful.
+ Request (application/json)
{
"username": "amy",
"password": "abc123"
}
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Doe",
"__v": 0,
"signupDate": "2016-06-29T02:44:52.928Z"
},
"token": "JWT <JWT_TOKEN>"
}
## User Management [/users]
### User Sign Up [POST]
Create a new user account. Requires user to provide a username, email, and password. Optionally, user can provide a full name.
The API returns the user object and a JSON Web Token if account creation is successful, meaning that the user will already be logged in.
+ Request (application/json)
{
"username": "amy",
"email": "[email protected]",
"password": "abc123",
"name": "Amy Doe"
}
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Doe",
"__v": 0,
"signupDate": "2016-07-27T02:44:52.928Z"
},
"token": "JWT <JWT_TOKEN>"
}
### Get User Information [GET /users/{userId}]
Retrieve information about a user. Only allowed on currently authenticated user.
+ Parameters
+ userId (string) - User ID to fetch information for.
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Doe",
"__v": 0,
"signupDate": "2016-07-27T02:44:52.928Z"
}
}
### Update User Information [PUT /users/{userId}]
Updates the user. Only allowed on currently authenticated user.
+ Parameters
+ userId (string) - User ID to update information for.
+ Request (application/json)
{
"email": "[email protected]",
"name": "Amy Emily Doe"
}
+ Response 200 (application/json)
{
"user": {
"_id": "57733624ed070136a557dddd",
"username": "amy",
"email": "[email protected]",
"name": "Amy Emily Doe",
"__v": 0,
"signupDate": "2016-07-27T02:44:52.928Z"
}
}
### Get User's trips [GET /users/{userId}/trips?page={page}]
Get all the trips created by the currently authenticated user, in reverse chronological order. Only a subset of each trip object is returned in this route. To get full details about the trip, use GET /trips/{tripId}.
+ Parameters
+ userId (string) - User ID to get entries for.
+ page (number) - Page # to return based on every page of 10 trips.
+ Response 200 (application/json)
{
"page": 1,
"results": 2,
"trips": [
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"visibility": "private"
},
{
"_id": "578edda250b26fc5d3c6baa9",
"creator": "5785e22fdff4328371f8e781",
"title": "Amy and Adam Take Vietnam!",
"startDate": "2016-09-22"
"endDate": "2016-09-27",
"destinations": [
"Vietnam"
],
"visibility": "public"
}
]
}
### Get User's entries [GET /users/{userId}/entries?count={count}&page={page}&maxDate={maxDate}]
Get all journey entries created by the currently authenticated user, in reverse chronological order.
+ Parameters
+ userId (string) - User ID to get entries for.
+ count (number) - Number of items to return. Default is 20
+ page (number) - Page # to return based on the count per page.
+ maxDate (string) - Cut-off date for first entry to return, in ISODate format
+ Response 200 (application/json)
{
"page": 1,
"results": 2,
"entries": [
{
"_id": "578ede2a50b26fc5d3c6baaa",
"creator": "5785e22fdff4328371f8e781",
"type": "video",
"message": "And here's a video showing him scooting around",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/4daba8e3-78c4-4ef2-b187-06b9d97b3228",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773233
]
},
"date": "2016-07-20T02:12:58.332Z"
},
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Check out this cute picture of Mochi!",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/e7b5b426-0d6b-4325-9d4e-8d2ba6fc8502",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773224
]
},
"date": "2016-07-20T02:10:42.442Z"
}
]
}
## Trip Management [/trips]
Users can create and manage trips on the Journey app. Each trip specifies a list of destinations that the user is visiting, as well as lists of places the user wants to visit and has already visited.
Each trip includes the following:
* Date created
* Trip creator
* A title
* A list of destinations (cities or countries)
* A list of places to visit
* (COMING SOON) A trip plan, which is a list of places that represents an itinerary
* Visibility (public or private)
### Create a trip [POST]
Creates a new trip. Only a title is required during creation. Returns the newly created trip upon success.
+ Request (application/json)
{
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"visibility": "private"
}
+ Response 200 (application/json)
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"wishlist": [],
"itinerary": [],
"visibility": "private"
}
### Get a trip [GET /trips/{tripId}]
Gets details about a particular trip created by the currently authenticated user. Returns the full details about the trip.
+ Parameters
+ tripId (string) - Trip ID to get details for.
+ Response 200 (application/json)
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"title": "Paris and Marseille",
"startDate": "2016-08-15"
"endDate": "2016-08-20",
"destinations": [
"Paris, France",
"Marseille, France"
],
"wishlist": [],
"itinerary": [],
"visibility": "private"
}
## Journey Entries [/entries]
The concept of journey entries may be deprecated as I transition the app towards a trip planning experience.
Each journey entry includes the following:
* Date created
* User who created it
* a location (lat/lng coordinates)
* an entry type (text, photos, video, audio)
* entry contents (URL to media saved to Amazon S3)
* a message (required for text entries)
### Create an entry [POST]
Create a journey entry. Returns an updated list of the user's entries upon successful creation.
* The type of the entry is required.
* Contents is required if the user is creating a `video`, `audio`, or `photo` entry.
* Message is required if the user is creating a `text` entry.
+ Request (application/json)
{
"type": "photo",
"contents": "http://s3.amazon.com/journey/photo.jpg",
"message": "Picture of Amy and Adam!",
"loc": {
"type": "Point",
"coordinates": [
-122.431397,
37.773982
]
}
}
+ Response 200 (application/json)
{
"page": 1,
"results": 3,
"entries": [
{
"_id": "578ede2a50b26fc5d3c6badd",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Picture of Amy and Adam!",
"contents": "http://s3.amazon.com/journey/photo.jpg",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431397,
37.773982
]
},
"date": "2016-07-27T15:02:57.912Z"
},
{
"_id": "578ede2a50b26fc5d3c6baaa",
"creator": "5785e22fdff4328371f8e781",
"type": "video",
"message": "And here's a video showing him scooting around",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/4daba8e3-78c4-4ef2-b187-06b9d97b3228",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773233
]
},
"date": "2016-07-20T02:12:58.332Z"
},
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Check out this cute picture of Mochi!",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/e7b5b426-0d6b-4325-9d4e-8d2ba6fc8502",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773224
]
},
"date": "2016-07-20T02:10:42.442Z"
}
]
}
### Get an entry [GET /entries/{entryId}]
Fetches details for a specific entry created by the currently authenticated user.
+ Parameters
+ entryId (string) - Entry ID
+ Response 200 (application/json)
{
"_id": "578edda250b26fc5d3c6baa8",
"creator": "5785e22fdff4328371f8e781",
"type": "photo",
"message": "Check out this cute picture of Mochi!",
"contents": "https://s3-us-west-1.amazonaws.com/journey.media/e7b5b426-0d6b-4325-9d4e-8d2ba6fc8502",
"__v": 0,
"loc": {
"type": "Point",
"coordinates": [
-122.431301,
37.773224
]
},
"date": "2016-07-20T02:10:42.442Z"
}
### Delete an entry [DELETE /entries/{entryId}]
Removes an entry, first confirming that the entry was created by the current user. The contents are also deleted from S3 if they exist.
+ Parameters
+ entryId (string) - Entry ID
+ Response 200 (application/json)
{
"message": "Entry deleted."
}
|
Add API documentation for GET /users/trips route
|
Add API documentation for GET /users/trips route
[#127139351]
|
API Blueprint
|
mit
|
heymanhn/journey-backend
|
f3993dc3596b5c3345665476f3f2f093683d96c6
|
source/composer.apib
|
source/composer.apib
|
## API Description Composer [/composer]
Reverse the parsing process--compose an API description format.
### Compose [POST]
#### Input Media Types
##### API Elements
API Elements is supported, you can send an [API Elements API
Category](http://api-elements.readthedocs.io/en/latest/element-definitions/#category-base-api-element)
to the composer using the `application/vnd.refract+json` content type. You may
also send an [API Elements Parse
Result](http://api-elements.readthedocs.io/en/latest/element-definitions/#parse-result-elements)
as `application/vnd.refract.parse-result+json`.
```
application/vnd.refract+json
application/vnd.refract.parse-result+json
```
#### Output Media Types
##### API Blueprint
```
text/vnd.apiblueprint
```
API Blueprint as defined in its [specification](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md).
+ Relation: compose
+ Request Compose API Blueprint from API Elements API (application/vnd.refract+json)
:[](fixtures/apib/normal.refract.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Compose API Blueprint from API Elements Parse Result (application/vnd.refract.parse-result+json)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Unknown Content Type (application/vnd.apiblueprint.ast+json)
{}
+ Response 415 (application/vnd.error+json)
+ Attributes
+ statusCode: 415
+ message: ``Unsupported Content-Type `application/vnd.apiblueprint.ast+json`. Supported: application/vnd.refract+json, application/vnd.refract.parse-result+json. API Blueprint AST is no longer supported.``
+ name: Rest Error
|
## API Description Composer [/composer]
Reverse the parsing process--compose an API description format.
### Compose [POST]
#### Input Media Types
##### API Elements
API Elements is supported, you can send an [API Elements API
Category](http://api-elements.readthedocs.io/en/latest/element-definitions/#category-base-api-element)
to the composer using the `application/vnd.refract+json` content type. You may
also send an [API Elements Parse
Result](http://api-elements.readthedocs.io/en/latest/element-definitions/#parse-result-elements)
as `application/vnd.refract.parse-result+json`.
```
application/vnd.refract+json
application/vnd.refract.parse-result+json
```
#### Output Media Types
##### API Blueprint
```
text/vnd.apiblueprint
```
API Blueprint as defined in its [specification](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md).
+ Relation: compose
+ Request Compose API Blueprint from API Elements API (application/vnd.refract+json)
:[](fixtures/apib/normal.refract.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Compose API Blueprint from API Elements Parse Result (application/vnd.refract.parse-result+json)
:[](fixtures/apib/normal.refract.parse-result.json)
+ Response 200 (text/vnd.apiblueprint)
:[](fixtures/apib/composer.apib)
+ Request Unknown Content Type (application/vnd.apiblueprint.ast+json)
{}
+ Response 415 (application/vnd.error+json)
+ Attributes
+ statusCode: 415 (number)
+ message: ``Unsupported Content-Type `application/vnd.apiblueprint.ast+json`. Supported: application/vnd.refract+json, application/vnd.refract.parse-result+json. API Blueprint AST is no longer supported.``
+ name: Rest Error
|
Correct statusCode to a number in composer error route
|
fix: Correct statusCode to a number in composer error route
|
API Blueprint
|
mit
|
apiaryio/api.apiblueprint.org,apiaryio/api.apiblueprint.org
|
82c2759989a01bed6ef32242d95c3842430b9a7b
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://se.zhuangty.com/
# CaμsAPI
CaμsAPI is an API to promote utility learning assistant on wechat end.
## User Register [/users/register]
### A User Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key",
"username": "Valid username(e.g. 2014000000 or abc14)",
"password": "Right-password-of-this-id"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"existed": "true/false",
"information": {
"studentnumber": Stundent number,
"department": "Department",
"position": "undergrate/master/doctor/teacher",
"email": "Email",
"realname": "Real name"
}
}
+ Response 401 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## User Cancel [/students/{username}/cancel]
### A User Cancel His Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username"
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Courses List [/learnhelper/{username}/courses]
### A Student Get His Courses List [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"courses": [
{
"coursename": "Course Name",
"courseid": "Course ID",
"unreadnotice": Unread Notice Number,
"newfile": New File Number,
"unsubmittedoperations": Unsubmitted Operations Number
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Notices List [/learnhelper/{username}/courses/{courseid}/notices]
### Get All Notices Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"notices": [
{
"sequencenum": Sequence Number,
"title": "Title",
"publishtime": "Publish Time",
"state": "read/unread",
"content": "Content"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Documents List [/learnhelper/{username}/courses/{courseid}/documents]
### Get All Documents Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"documents": [
{
"sequencenum": Sequence Number,
"title": "Title",
"explanation": "Brief explanation",
"updatingtime": "Updating Time",
"state": "new/previous",
"size": "Size of file",
"url": "File url"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Assignments List [/learnhelper/{username}/courses/{courseid}/assignments]
### Get All Assignments Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"assignments": [
{
"sequencenum": Sequence Number,
"title": "Title",
"detail": "Detail of the assignment",
"startdate": "Start date",
"duedate": "Due Time",
"evaluatingteacher": "Evaluating teacher",
"evaluatingdate": "Evaluating date",
"comment": "Comment of teacher",
"grade": Grade of the homework
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Week Curriculum [/schedule/{username}/{week}]
### Get Curriculum Of A Week [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"classes": [
{
"coursid": "Course ID",
"coursename": "Course name",
"time": "[[1 to 7,1 to 6]]",
"teacher": "Teacher",
"classroom": "Classroom"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Semester Curriculum [/schedule/{username}]
### Get Curriculum Of A Semester [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"classes": [
{
"coursid": "Course ID",
"coursename": "Course name",
"time": "[[1 to 7,1 to 6]]",
"teacher": "Teacher",
"classroom": "Classroom",
"weeks": "array of [1,16]"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## HS Library [/library/hs]
### Get studyrooms of HS Library [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"areas": [
{
"name": "Name of study area",
"left": number of left seats,
"used": number of used seats
}
]
}
|
FORMAT: 1A
HOST: http://se.zhuangty.com:8000/
# CaμsAPI
CaμsAPI is an API to promote utility learning assistant on wechat end.
## User Register [/users/register]
### A User Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key",
"username": "Valid username(e.g. 2014000000 or abc14)",
"password": "Right-password-of-this-id"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"existed": "true/false",
"information": {
"studentnumber": Stundent number,
"department": "Department",
"position": "undergrate/master/doctor/teacher",
"email": "Email",
"realname": "Real name"
}
}
+ Response 401 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## User Cancel [/students/{username}/cancel]
### A User Cancel His Register [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username"
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Courses List [/learnhelper/{username}/courses]
### A Student Get His Courses List [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"courses": [
{
"coursename": "Course Name",
"courseid": "Course ID",
"unreadnotice": Unread Notice Number,
"newfile": New File Number,
"unsubmittedoperations": Unsubmitted Operations Number
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Notices List [/learnhelper/{username}/courses/{courseid}/notices]
### Get All Notices Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"notices": [
{
"sequencenum": Sequence Number,
"title": "Title",
"publishtime": "Publish Time",
"state": "read/unread",
"content": "Content"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Documents List [/learnhelper/{username}/courses/{courseid}/documents]
### Get All Documents Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"documents": [
{
"sequencenum": Sequence Number,
"title": "Title",
"explanation": "Brief explanation",
"updatingtime": "Updating Time",
"state": "new/previous",
"size": "Size of file",
"url": "File url"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Course Assignments List [/learnhelper/{username}/courses/{courseid}/assignments]
### Get All Assignments Of A Course [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"assignments": [
{
"sequencenum": Sequence Number,
"title": "Title",
"detail": "Detail of the assignment",
"startdate": "Start date",
"duedate": "Due Time",
"evaluatingteacher": "Evaluating teacher",
"evaluatingdate": "Evaluating date",
"comment": "Comment of teacher",
"grade": Grade of the homework
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Week Curriculum [/schedule/{username}/{week}]
### Get Curriculum Of A Week [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"classes": [
{
"coursid": "Course ID",
"coursename": "Course name",
"time": "[[1 to 7,1 to 6]]",
"teacher": "Teacher",
"classroom": "Classroom"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## Student Semester Curriculum [/schedule/{username}]
### Get Curriculum Of A Semester [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"username": "Request username",
"classes": [
{
"coursid": "Course ID",
"coursename": "Course name",
"time": "[[1 to 7,1 to 6]]",
"teacher": "Teacher",
"classroom": "Classroom",
"weeks": "array of [1,16]"
}
]
}
+ Response 400 (application/json)
{
"message": "Failure",
"username": "Request username"
}
## HS Library [/library/hs]
### Get studyrooms of HS Library [POST]
+ Request (application/json)
{
"apikey": "API Key",
"apisecret": "API Secret Key"
}
+ Response 200 (application/json)
{
"message": "Success",
"areas": [
{
"name": "Name of study area",
"left": number of left seats,
"used": number of used seats
}
]
}
|
Update Host Address
|
Update Host Address
|
API Blueprint
|
mit
|
TennyZhuang/CamusAPI,TennyZhuang/CamusAPI
|
8cf78f6a1c13de7b13593e9f1f966b34ee565421
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://www.nuswhispers.com/api/
# NUSWhispers API
REST API for NUSWhispers platform. Powered by Laravel backend.
# Group Confessions
## Confession Collection [/confessions/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Featured Confessions [GET]
+ Response 200 (application/json)
### Create a New Confession [POST]
+ Request (application/json)
{
"content": "Confession content. Hello World!",
"image": "http://foobar.com/image.png",
"categories": []
"captcha": "12345"
}
+ Response 200 (application/json)
## Popular Confessions [/confessions/popular/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Popular Confessions [GET]
+ Response 200 (application/json)
## Recent Confessions [/confessions/recent/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Recent Confessions [GET]
+ Response 200 (application/json)
## Favourite Confessions [/confessions/favourites/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Favourite Confessions [GET]
+ Response 200 (application/json)
## Confessions by Category [/confessions/category/{category_id}/{?timestamp,count,offset}]
+ Parameters
+ category_id: `10` (number, required) - ID of the confession category.
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Confessions by Category [GET]
+ Response 200 (application/json)
## Confessions by Tag [/confessions/tag/{slug}/{?timestamp,count,offset}]
+ Parameters
+ slug: `whattodo` (string, required) - Slug of the confession tag.
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Confessions by Tag [GET]
+ Response 200 (application/json)
## Confessions by Search Term [/confessions/search/{query}/{?timestamp,count,offset}]
+ Parameters
+ query: `hello` (string) - Search query.
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Confessions by Search Term [GET]
+ Response 200 (application/json)
## Confession [/confessions/{confession_id}]
+ Parameters
+ confession_id (number) - ID of the confession.
### View a Single Confession [GET]
+ Response 200 (application/json)
# Group Categories
## Categories Collection [/categories]
### List Categories [GET]
+ Response 200 (application/json)
## Category [/categories/{category_id}]
+ Parameters
+ category_id: `10` (number) - ID of the category.
### View a Category Detail [GET]
+ Response 200 (application/json)
# Group Tags
## Tags Collection [/tags]
### List Tags [GET]
+ Response 200 (application/json)
## Popular Tags [/tags/top/{num}]
+ Parameters
+ num: `5` (number, optional) - Number of top tags to return. Maximum is `20`.
+ Default: `5`
### List Popular Tags [GET]
+ Response 200 (application/json)
## Tag [/tags/{tag_id}]
+ Parameters
+ tag_id: `1` (number) - ID of the tag.
### View a Tag Detail [GET]
+ Response 200 (application/json)
|
FORMAT: 1A
HOST: http://www.nuswhispers.com/api/
# NUSWhispers API
REST API for NUSWhispers platform. Powered by Laravel backend.
# Group Confessions
## Confession Collection [/confessions/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Featured Confessions [GET]
+ Response 200 (application/json)
### Create a New Confession [POST]
+ Request (application/json)
{
"content": "Confession content. Hello World!",
"image": "http://foobar.com/image.png",
"categories": []
"api_key": "12345"
}
+ Response 200 (application/json)
## Popular Confessions [/confessions/popular/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Popular Confessions [GET]
+ Response 200 (application/json)
## Recent Confessions [/confessions/recent/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Recent Confessions [GET]
+ Response 200 (application/json)
## Favourite Confessions [/confessions/favourites/{?timestamp,count,offset}]
+ Parameters
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Favourite Confessions [GET]
+ Response 200 (application/json)
## Confessions by Category [/confessions/category/{category_id}/{?timestamp,count,offset}]
+ Parameters
+ category_id: `10` (number, required) - ID of the confession category.
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Confessions by Category [GET]
+ Response 200 (application/json)
## Confessions by Tag [/confessions/tag/{slug}/{?timestamp,count,offset}]
+ Parameters
+ slug: `whattodo` (string, required) - Slug of the confession tag.
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Confessions by Tag [GET]
+ Response 200 (application/json)
## Confessions by Search Term [/confessions/search/{query}/{?timestamp,count,offset}]
+ Parameters
+ query: `hello` (string) - Search query.
+ timestamp: `1457257656` (number, optional) - Retrieve confessions up to this UNIX timestamp.
+ count: `10` (number, optional) - Number of confessions to retrieve. Maximum is `10` (default).
+ Default: `10`
+ offset: `0` (number, optional) - Skips a specified number of confessions.
### List Confessions by Search Term [GET]
+ Response 200 (application/json)
## Confession [/confessions/{confession_id}]
+ Parameters
+ confession_id (number) - ID of the confession.
### View a Single Confession [GET]
+ Response 200 (application/json)
# Group Categories
## Categories Collection [/categories]
### List Categories [GET]
+ Response 200 (application/json)
## Category [/categories/{category_id}]
+ Parameters
+ category_id: `10` (number) - ID of the category.
### View a Category Detail [GET]
+ Response 200 (application/json)
# Group Tags
## Tags Collection [/tags]
### List Tags [GET]
+ Response 200 (application/json)
## Popular Tags [/tags/top/{num}]
+ Parameters
+ num: `5` (number, optional) - Number of top tags to return. Maximum is `20`.
+ Default: `5`
### List Popular Tags [GET]
+ Response 200 (application/json)
## Tag [/tags/{tag_id}]
+ Parameters
+ tag_id: `1` (number) - ID of the tag.
### View a Tag Detail [GET]
+ Response 200 (application/json)
|
Update API docs to cover api_key input when submitting confessions
|
Update API docs to cover api_key input when submitting confessions
|
API Blueprint
|
mit
|
nusmodifications/nuswhispers,nusmodifications/nuswhispers,nusmodifications/nuswhispers
|
ac8a2ec2071aac956984fa537e3447554b89659f
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2.
# Orchestrator Hooks
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
*Note:* Orchestrator does not clone the repository and simply use git information
as meta-information for locating totem.yml. This file need not be present in git repository and can be stored in other config providers like s3, etcd.
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo"
}
}
+ Response 202 (application/vnd.orch.task.v1+json)
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2. All public facing api use /external as route path prefix.
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
*Note: Orchestrator does not clone the repository and simply use git information
as meta-information for locating totem.yml. This file need not be present in git repository and can be stored in other config providers like s3, etcd.*
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo:latest"
}
}
+ Response 202 (application/vnd.orch.task.v1+json)
+ Headers
Location: /tasks/94ddd430-5e66-48d9-a1b4-f996b6bd2489
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
## Get Asynchronous Task Status [GET /tasks/{task_id}]
Gets status for asynchronous job created as a result of posting a new callback hook to orchestrator.
*Note: The job status can also be obtained from elasticsearch if totem is setup to sync mongo with ES.*
+ Parameters
+ task_id (required, string, `c47d3c50-2877-4119-850e-71aaae3d53ba`) ... Task ID (`task_id`)
+ Request
+ Headers
Accept: application/json
+ Response 200
+ Body
{
"output": {
"config": {
"deployers": {},
"enabled": true,
"hooks": {
"builder": {
"image-factory": {
"enabled": true
}
},
"ci": {
"travis": {
"enabled": false
}
},
"scm-create": {
"github-create": {
"enabled": true
}
},
"scm-push": {
"github-push": {
"enabled": true
}
}
},
"notifications": {},
"scm": {
"auth": {
"token": ""
},
"type": "github"
},
"security": {
"profile": "default"
}
},
"force-deploy": false,
"hooks": {
"builder": {
"image-factory": {
"status": "pending"
}
},
"ci": {},
"scm-create": {
"github-create": {
"status": "pending"
}
},
"scm-push": {
"github-push": {
"status": "pending"
}
}
},
"meta-info": {
"git": {
"commit": "c4084c20ba721be7c9d5d625c7749659cc4fd702",
"commit-set": [
"c4084c20ba721be7c9d5d625c7749659cc4fd702"
],
"owner": "totem",
"ref": "develop",
"repo": "cluster-orchestrator"
},
"job-id": "ac572a97-f285-4917-8ff4-4ecb8a142488"
},
"state": "NOOP"
},
"status": "READY"
}
|
Add location header.
|
Add location header.
|
API Blueprint
|
mit
|
totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator
|
e0fca06e335a4dba862d1448876a2a53f6ec2a6c
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# elasticthought
REST API wrapper for Caffe
# Group User
Related resources of the **User API**
## Users Collection [/users]
### Create a User [POST]
+ Request (application/json)
{
"username": "foo",
"email": "[email protected]",
"password": "bar"
}
+ Response 201
# Group Data
Related resources of the **Data API**
## Datafiles Collection [/datafiles]
### Create a Datafile [POST]
The url passed in the JSON must point to a .tar.gz file. That is currently the only format allowed.
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{ "url": "http://s3.com/mnist-data.tar.gz" }
+ Response 201 (application/json)
{ "id": "datafile-uuid" }
## Datasets Collection [/datasets]
### Create a Dataset [POST]
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{
"datafile-id": "datafile-uuid",
"training": {
"split-percentage": 0.7
},
"testing": {
"split-percentage": 0.3
}
}
+ Response 201 (application/json)
{
"_id": "dataset-uuid"
"datafile-id": "datafile-uuid",
"processing-state": "pending",
"training": {
"split-percentage": 0.7
},
"testing": {
"split-percentage": 0.3
}
}
# Group Training
Related resources of the **Training API**
## Solvers Collection [/solvers]
### Create a Solver [POST]
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{
"dataset-id": "<dataset-id>",
"specification-url": "http://s3.com/mnist_solver.prototxt",
"specification-net-url": "http://s3.com/mnist_train_test.prototxt"
}
+ Response 201 (application/json)
{ "id": "solver-uuid" }
## Training Jobs Collection [/training-jobs]
After a solver is defined, create a training job that will use the solver to train a model.
### Create a Training Job [POST]
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{
"solver": "solver-uuid"
}
+ Response 201 (application/json)
{
"id": "training-job-uuid",
"processing-state": "pending"
}
## Training Job Status [/training-jobs/{id}/status]
The status of the Training Job
+ Parameters
+ id (required, string, `training-job-uuid`) ... The id of the training job.
### Training Job Status [GET]
+ Request
+ Headers
Authorization: Token 527d11fe429f3426cb8dbeba183a0d80
+ Response 200 (application/json)
{
"id": "training-job-uuid",
"state": "running",
"loss": 0.0013,
"last-iteration": 2000,
"max-iterations": 10000,
"logs": "/training-jobs/{training-job-uuid}/logs"
}
## Training Job Logs [/training-jobs/{id}/logs]
The logs of the Training Job. Currently returns entire text file, but in the future
it will support websocket streaming.
+ Parameters
+ id (required, string, `training-job-uuid`) ... The id of the training job.
### Training Job Logs [GET]
+ Request
+ Headers
Authorization: Token 527d11fe429f3426cb8dbeba183a0d80
+ Response 200 (text/plain)
# Group Prediction
Related resources of the **Prediction API**
|
FORMAT: 1A
# elasticthought
REST API wrapper for Caffe
# Group User
Related resources of the **User API**
## Users Collection [/users]
### Create a User [POST]
+ Request (application/json)
{
"username": "foo",
"email": "[email protected]",
"password": "bar"
}
+ Response 201
# Group Data
Related resources of the **Data API**
## Datafiles Collection [/datafiles]
### Create a Datafile [POST]
The url passed in the JSON must point to a .tar.gz file. That is currently the only format allowed.
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{ "url": "http://s3.com/mnist-data.tar.gz" }
+ Response 201 (application/json)
{ "id": "datafile-uuid" }
## Datasets Collection [/datasets]
### Create a Dataset [POST]
If you want to split a single datafile, pass the same datafile id in both the training and the testing sections, and non-zero split percentages.
Otherwise if you've already split your data into two datafiles, specify different datafile id's, and give 0.0 for the split-percentages.
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{
"training": {
"datafile-id": "datafile-uuid",
"split-percentage": 0.7
},
"testing": {
"datafile-id": "datafile-uuid",
"split-percentage": 0.3
}
}
+ Schema
{
"$schema":"http://json-schema.org/draft-04/schema#",
"title":"Add Dataset Request",
"description":"A request to create a new Dataset from a Datafile or set of Datafiles",
"type":"object",
"properties":{
"training":{
"description":"The training portion of the dataset.",
"type":"object",
"properties":{
"datafile-id": {
"type": "string",
"description": "The id of the Datafile object"
},
"split-percentage": {
"type": "number",
"description": "The percent of datafile that should be used for training. Or 0.0 if passing two distinct Datafile id's in training/testing"
}
}
},
"testing":{
"description":"The testing portion of the dataset.",
"type":"object",
"properties":{
"datafile-id": {
"type": "string",
"description": "The id of the Datafile object"
},
"split-percentage": {
"type": "number",
"description": "The percent of datafile that should be used for training. Or 0.0 if passing two distinct Datafile id's in training/testing"
}
}
}
}
"required":[
"training",
"testing"
],
"additionalProperties":false
}
+ Response 201 (application/json)
{
"_id": "dataset-uuid"
"datafile-id": "datafile-uuid",
"processing-state": "pending",
"training": {
"split-percentage": 0.7
},
"testing": {
"split-percentage": 0.3
}
}
# Group Training
Related resources of the **Training API**
## Solvers Collection [/solvers]
### Create a Solver [POST]
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{
"dataset-id": "<dataset-id>",
"specification-url": "http://s3.com/mnist_solver.prototxt",
"specification-net-url": "http://s3.com/mnist_train_test.prototxt"
}
+ Response 201 (application/json)
{ "id": "solver-uuid" }
## Training Jobs Collection [/training-jobs]
After a solver is defined, create a training job that will use the solver to train a model.
### Create a Training Job [POST]
+ Request (application/json)
+ Header
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
+ Body
{
"solver": "solver-uuid"
}
+ Response 201 (application/json)
{
"id": "training-job-uuid",
"processing-state": "pending"
}
## Training Job Status [/training-jobs/{id}/status]
The status of the Training Job
+ Parameters
+ id (required, string, `training-job-uuid`) ... The id of the training job.
### Training Job Status [GET]
+ Request
+ Headers
Authorization: Token 527d11fe429f3426cb8dbeba183a0d80
+ Response 200 (application/json)
{
"id": "training-job-uuid",
"state": "running",
"loss": 0.0013,
"last-iteration": 2000,
"max-iterations": 10000,
"logs": "/training-jobs/{training-job-uuid}/logs"
}
## Training Job Logs [/training-jobs/{id}/logs]
The logs of the Training Job. Currently returns entire text file, but in the future
it will support websocket streaming.
+ Parameters
+ id (required, string, `training-job-uuid`) ... The id of the training job.
### Training Job Logs [GET]
+ Request
+ Headers
Authorization: Token 527d11fe429f3426cb8dbeba183a0d80
+ Response 200 (text/plain)
# Group Prediction
Related resources of the **Prediction API**
|
Update rest api docs
|
Update rest api docs
|
API Blueprint
|
apache-2.0
|
tleyden/elastic-thought,tleyden/elastic-thought,aaam/elastic-thought,aaam/elastic-thought,aaam/elastic-thought,tleyden/elastic-thought
|
6d6cdc709f8d933a63ca84bb374c107c85daf168
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
Category related resources of the **Money Advice Service**.
## Categories Collection [/{locale}/categories.json]
A collection of categories including their subcategories
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Categories.
+ Values
+ `en`
+ `cy`
### Retrieve all Categories [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/categories>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "life-events",
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"subCategories": [
{
"id": "setting-up-home",
"title": "Setting up home",
"description": "Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n",
"subCategories": [
]
},
{
"id": "young-people-and-money",
"title": "Leaving school or college",
"description": "",
"subCategories": [
]
},
{
"id": "having-a-baby",
"title": "Having a baby",
"description": "",
"subCategories": [
]
}
]
},
{
"id": "managing-your-money",
"title": "Managing your money",
"description": "",
"subCategories": [
]
},
{
"id": "money-topics",
"title": "Money topics",
"description": "",
"subCategories": [
]
},
{
"id": "tools--resources",
"title": "Tools & resources",
"description": "",
"subCategories": [
]
},
{
"id": "news",
"title": "News",
"description": "",
"subCategories": [
]
}
]
## Category [/{locale}/categories/{id}]
A single category object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Category.
+ Values
+ `en`
+ `cy`
+ id (required, string, `life-events`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories/life-events>; rel="canonical"; title="Life events", <https://www.moneyadviceservice.org.uk/cy/categories/life-events>; rel="alternate"; hreflang="cy"; title="Digwyddiadau bywyd"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"contents":[
{
"id":"setting-up-home",
"type":"category",
"title":"Setting up home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"id":"how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you've moved in"
}
]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve an Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="canonical"; title="Where to go to get free debt advice", <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="canonical"; title="Action plan – Prepare for the cost of having a baby", <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
Category related resources of the **Money Advice Service**.
## Categories Collection [/{locale}/categories.json]
A collection of categories including their subcategories
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Categories.
+ Values
+ `en`
+ `cy`
### Retrieve all Categories [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories; rel="canonical", <https://www.moneyadviceservice.org.uk/cy/categories>; rel="alternate"; hreflang="cy"
+ Body
[
{
"id": "life-events",
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"subCategories": [
{
"id": "setting-up-home",
"title": "Setting up home",
"description": "Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n",
"subCategories": [
]
},
{
"id": "young-people-and-money",
"title": "Leaving school or college",
"description": "",
"subCategories": [
]
},
{
"id": "having-a-baby",
"title": "Having a baby",
"description": "",
"subCategories": [
]
}
]
},
{
"id": "managing-your-money",
"title": "Managing your money",
"description": "",
"subCategories": [
]
},
{
"id": "money-topics",
"title": "Money topics",
"description": "",
"subCategories": [
]
},
{
"id": "tools--resources",
"title": "Tools & resources",
"description": "",
"subCategories": [
]
},
{
"id": "news",
"title": "News",
"description": "",
"subCategories": [
]
}
]
## Category [/{locale}/categories/{id}]
A single category object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Category.
+ Values
+ `en`
+ `cy`
+ id (required, string, `life-events`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/categories/life-events>; rel="canonical"; title="Life events", <https://www.moneyadviceservice.org.uk/cy/categories/life-events>; rel="alternate"; hreflang="cy"; title="Digwyddiadau bywyd"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"contents":[
{
"id":"setting-up-home",
"type":"category",
"title":"Setting up home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"id":"how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you've moved in"
}
]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve an Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="canonical"; title="Where to go to get free debt advice", <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="canonical"; title="Action plan – Prepare for the cost of having a baby", <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
|
Remove HTML entities from JSON
|
Remove HTML entities from JSON
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
d0964795f1b60801b56cb1826ebfd492c6cf1ad6
|
blueprint/index.apib
|
blueprint/index.apib
|
FORMAT: 1A
HOST: https://thegrid.io/
# The Grid API
Want to straight to the details?
* [Authentication](authentication.html)
* [Content Management](api.html)
* [User Management](passport.html)
* [Design Systems](designsystem.html)
# Purpose
[The Grid](https://thegrid.io/) is a next-generation web publishing platform.
The service provides a complete user experience for making, editing content
across multiple devices, but also has a complete API available.
This document describes that API and how it can be used by developers, including third-party.
Functionality provided includes
* Web page auto-design, layout and publishing
* Content import and analysis
* Image processing
* Handling payments (TDB)
What The Grid is not.
Not a web-hosting platform to run arbitrary PHP/Python/Ruby or databases on.
# Access
API access is available to all users on The Grid.
If you wish to develop with The Grid, [become a founding member now](https://thegrid.io/).
*Note: we are currently in pre-order and are not auto-activating users yet.*
When your plan has been activated, you may log in and register new apps
on your [accounts page](https://passport.thegrid.io/)
# API quotas
API usage is tracked against the app ID and user UUID which is used to authenticate the request.
We reserve the right to impose quotas (soft or hard), especially on heavy processing operations
like image analytics and page solving.
If you think your app or user may hit quotas limits, get in touch.
# Example uses
## Mobile apps
Either single-purpose apps, or full-featured The Grid apps
for platforms which are not officially supported
like Windows Phone, Firefox OS, Jolla etc
## Social media integration
Like a Twitter or Facebook app which syncs content to your The Grid site.
## Content migration
For importing all of the content from your current website,
like Wordpress, Squarespace, Medium or Tumblr
## Embedded/autonomous devices
Devices that automatically publish their state or results,
for instance a timelapse camera or 3d-printer.
## Desktop & web app integration
For instance "Share to The Grid" functionality.
## Log in with The Grid
Letting users use their The Grid account instead of having
to do a new username/password signup.
## Custom content editing user interfaces
Using specialized user interactions, making use of new technology
or increased accessibility
# Known consumers
Existing examples of apps and libraries using this API.
* [Flowhub](https://flowhub.io) and [noflo-ui](https://github.com/noflo/noflo-ui)
* The Grid Android app
* The Grid iOS app
* The Grid Chrome extension
* [thegrid.io](https://thegrid.io) website, including purchasing process
Libraries
* [passport-thegrid](https://www.npmjs.com/package/passport-thegrid):
Authentication strategy for [Passport.js](http://passportjs.org/)
# Issues or Questions?
This API documentation is [on GitHub](https://github.com/the-grid/apidocs).
Got any questions or found issues in the documentation?
[File issues](https://github.com/the-grid/apidocs/issues)
or create a [pull request](https://github.com/the-grid/apidocs/pulls).
|
FORMAT: 1A
HOST: https://thegrid.io/
# The Grid API
Want to straight to the details?
* [Authentication](authentication.html)
* [Content Management](api.html)
* [User Management](passport.html)
* [Design Systems](designsystem.html)
# Purpose
[The Grid](https://thegrid.io/) is a next-generation web publishing platform.
The service provides a full user experience for making, editing content
across multiple devices, but also has a complete API available.
This document describes that API and how it can be used by developers, including third-party.
Functionality provided includes
* Web page auto-design, layout and publishing
* Content import and analysis
* Image processing
* Handling payments (TBD)
What The Grid is not:
Not a web-hosting platform to run arbitrary PHP/Python/Ruby or databases on.
The Grid API is based on HTTP REST with JSON payloads and OAuth2 authentication.
It can be used from any programming language with libraries supporting these technologies.
Popular choices include Python, Ruby, JavaScript, Java, C#.
# Access
API access is available to all users on The Grid.
If you wish to develop with The Grid, [become a founding member now](https://thegrid.io/).
*Note: we are currently in pre-order and are not auto-activating users yet.*
When your plan has been activated, you may log in and register new apps
on your [accounts page](https://passport.thegrid.io/)
# API quotas
API usage is tracked against the app ID and user UUID which is used to authenticate the request.
We reserve the right to impose quotas (soft or hard), especially on heavy processing operations
like image analytics and page solving.
If you think your app or user may hit quotas limits, get in touch.
# Example uses
## Mobile apps
Either single-purpose apps, or full-featured The Grid apps
for platforms which are not officially supported
like Windows Phone, Firefox OS, Jolla etc
## Social media integration
Like a Twitter or Facebook app which syncs content to your The Grid site.
## Content migration
For importing all of the content from your current website,
like Wordpress, Squarespace, Medium or Tumblr
## Embedded/autonomous devices
Devices that automatically publish their state or results,
for instance a timelapse camera or 3d-printer.
## Desktop & web app integration
For instance "Share to The Grid" functionality.
## Log in with The Grid
Letting users use their The Grid account instead of having
to do a new username/password signup.
## Custom content editing user interfaces
Using specialized user interactions, making use of new technology
or increased accessibility
# Known consumers
Existing examples of apps and libraries using this API.
* [Flowhub](https://flowhub.io) and [noflo-ui](https://github.com/noflo/noflo-ui)
* The Grid Android app
* The Grid iOS app
* The Grid Chrome extension
* [thegrid.io](https://thegrid.io) website, including purchasing process
Libraries
* [passport-thegrid](https://www.npmjs.com/package/passport-thegrid):
Authentication strategy for [Passport.js](http://passportjs.org/)
# Issues or Questions?
This API documentation is [on GitHub](https://github.com/the-grid/apidocs).
Got any questions or found issues in the documentation?
[File issues](https://github.com/the-grid/apidocs/issues)
or create a [pull request](https://github.com/the-grid/apidocs/pulls).
|
Add paragraph about programming language support
|
index: Add paragraph about programming language support
|
API Blueprint
|
mit
|
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
|
127ff86aec9cc1b19a4d22019542eda93160e701
|
Documentation/Api/RestApi.apib
|
Documentation/Api/RestApi.apib
|
FORMAT: 1A
# phpList REST API v2
# Group Authentication
Resources related to login and logout.
## Session [/api/v2/sessions]
### Create a new session (log in) [POST]
Given valid login data, this will generate a login token that will be
valid for 1 hour. It takes a JSON object containing the following key-value pairs:
+ `loginName` (string): the login name ofe the administrator to log in
+ `password` (string): the plain text password
The login token then can be passed as a `authenticationToken` cookie for requests
that require authentication.
+ Request (application/json)
{
"loginName": "admin",
"password": "eetIc/Gropvoc1"
}
+ Response 201 (application/json)
+ Body
{
"id": 241,
"key": "2cfe100561473c6cdd99c9e2f26fa974",
"expiry": "2017-07-20T18:22:48+00:00"
}
+ Response 400 (application/json)
+ Body
{
"code": 1500559729794,
"message": "No data",
"description": "The request does not contain any data."
}
+ Response 400 (application/json)
+ Body
{
"code": 1500562402438,
"message": "Invalid JSON data",
"description": "The data in the request is invalid JSON."
}
+ Response 400 (application/json)
+ Body
{
"code": 1500562647846,
"message": "Incomplete credentials",
"description": "The request does not contain both loginName and password."
}
+ Response 401 (application/json)
+ Body
{
"code": 1500567098798,
"message": "Not authorized",
"description": "The user name and password did not match any existing user."
}
|
FORMAT: 1A
HOST: https://example.com/api/v2
# phpList REST API v2
# Group Authentication
Resources related to login and logout.
## Session [/sessions]
### Create a new session (log in) [POST]
Given valid login data, this will generate a login token that will be
valid for 1 hour. It takes a JSON object containing the following key-value pairs:
+ `loginName` (string): the login name ofe the administrator to log in
+ `password` (string): the plain text password
The login token then can be passed as a `authenticationToken` cookie for requests
that require authentication.
+ Request (application/json)
{
"loginName": "admin",
"password": "eetIc/Gropvoc1"
}
+ Response 201 (application/json)
+ Body
{
"id": 241,
"key": "2cfe100561473c6cdd99c9e2f26fa974",
"expiry": "2017-07-20T18:22:48+00:00"
}
+ Response 400 (application/json)
+ Body
{
"code": 1500559729794,
"message": "No data",
"description": "The request does not contain any data."
}
+ Response 400 (application/json)
+ Body
{
"code": 1500562402438,
"message": "Invalid JSON data",
"description": "The data in the request is invalid JSON."
}
+ Response 400 (application/json)
+ Body
{
"code": 1500562647846,
"message": "Incomplete credentials",
"description": "The request does not contain both loginName and password."
}
+ Response 401 (application/json)
+ Body
{
"code": 1500567098798,
"message": "Not authorized",
"description": "The user name and password did not match any existing user."
}
|
Document the HOST and prefix in the REST API documentation (#31)
|
[TASK] Document the HOST and prefix in the REST API documentation (#31)
Fixes #29
|
API Blueprint
|
agpl-3.0
|
phpList/rest-api
|
bc78c6023cbc72145a63ceea4d82a2313f4018b0
|
doc/example-httpbin.apib
|
doc/example-httpbin.apib
|
--- Examples against httpbin.org ---
---
Examples of how some requests to _httpbin.org_ can be specified. Read more about
the httpbin.org API at http://httpbin.org/.
See ../README.md for details on how to test this specification.
---
# First request and response
Get a teapot from some full URL.
Leading or trailing blank lines in the body are stripped, unless you delimit
the body lines with the markers <<< (start) and >>> (end). The newlines after
<<< as well as the newline before >>> is not included in the body.
GET /status/418
> Accept: *
> User-Agent: KATT
> Host: {{<hostname}}:{{<port}}
< 418
< X-More-Info: http://tools.ietf.org/html/rfc2324
<<<
-=[ teapot ]=-
_...._
.' _ _ `.
| ."` ^ `". _,
\_;`"---"`|//
| ;/
\_ _/
`"""`
>>>
# Second request and response
Get unauthorized.
Also note that we don't expect any body.
The current date will be available to use in later requests as `{{<some_date}}.`
GET /status/401
> Accept: *
> User-Agent: KATT
< 401
< Www-Authenticate: Basic realm="Fake Realm"
< Date: {{>some_date}}
# Third request
Note that the title of this operation is "Third request", but that's just
markdown for you. You don't need to include a title, or even a description of
the operations unless you want to. In the fourth request we will skip the
description altogether.
Here we are getting a cached response.
GET /cache
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"url": "http://httpbin.org/cache",
"headers": "{{_}}",
"args": "{{_}}",
"origin": "{{>origin}}"
}
GET /cache
> Accept: application/json
> User-Agent: KATT
> If-Modified-Since: {{<some_date}}
< 304
A fifth request to show that whitespace in JSON body is insignificant.
POST /post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
{"origin":"{{<origin}}","whoarewe":"{{<your_name}}_and_{{<my_name}}","date":"{{<some_date}}"}
< 200
< Content-Type: application/json
{
"args": "{{_}}",
"data": "{{>raw_data}}",
"files": {},
"form": {},
"headers": "{{_}}",
"origin": "{{<origin}}",
"url": "http://httpbin.org/post",
"json": {
"origin": "{{<origin}}",
"date": "{{<some_date}}",
"whoarewe": "{{>whoarewe}}"
}
}
GET /get?origin={{<origin}}&whoarewe={{<whoarewe}}
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"args": {
"whoarewe": "{{<your_name}}_and_{{<my_name}}",
"origin": "{{<origin}}"
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "http://httpbin.org/get?origin={{<origin}}&whoarewe={{<whoarewe}}"
}
|
--- Examples against httpbin.org ---
---
Examples of how some requests to _httpbin.org_ can be specified. Read more about
the httpbin.org API at http://httpbin.org/.
See ../README.md for details on how to test this specification.
---
# First request and response
Get a teapot from some full URL.
Leading or trailing blank lines in the body are stripped, unless you delimit
the body lines with the markers <<< (start) and >>> (end). The newlines after
<<< as well as the newline before >>> is not included in the body.
GET /status/418
> Accept: *
> User-Agent: KATT
> Host: {{<hostname}}:{{<port}}
< 418
< X-More-Info: http://tools.ietf.org/html/rfc2324
<<<
-=[ teapot ]=-
_...._
.' _ _ `.
| ."` ^ `". _,
\_;`"---"`|//
| ;/
\_ _/
`"""`
>>>
# Second request and response
Get unauthorized.
Also note that we don't expect any body.
The current date will be available to use in later requests as `{{<some_date}}.`
GET /status/401
> Accept: *
> User-Agent: KATT
< 401
< Www-Authenticate: Basic realm="Fake Realm"
< Date: {{>some_date}}
# Third request
Note that the title of this operation is "Third request", but that's just
markdown for you. You don't need to include a title, or even a description of
the operations unless you want to. In the fourth request we will skip the
description altogether.
Here we are getting a cached response.
GET /cache
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"url": "http://httpbin.org/cache",
"headers": "{{_}}",
"args": "{{_}}",
"origin": "{{>origin}}"
}
GET /cache
> Accept: application/json
> User-Agent: KATT
> If-Modified-Since: {{<some_date}}
< 304
A fifth request to show that whitespace in JSON body is insignificant.
POST /post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
{"origin":"{{<origin}}","whoarewe":"{{<your_name}}_and_{{<my_name}}","date":"{{<some_date}}"}
< 200
< Content-Type: application/json
{
"args": "{{_}}",
"data": "{{>raw_data}}",
"files": {},
"form": {},
"headers": "{{_}}",
"origin": "{{<origin}}",
"url": "http://httpbin.org/post",
"json": {
"origin": "{{<origin}}",
"date": "{{<some_date}}",
"whoarewe": "{{>whoarewe}}"
}
}
GET /get?whoarewe={{<whoarewe}}&origin={{<origin}}
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"args": {
"whoarewe": "{{<your_name}}_and_{{<my_name}}",
"origin": "{{<origin}}{{_}}"
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "http://httpbin.org/get?origin={{<origin}}{{_}}"
}
|
make example APIB work via proxies
|
make example APIB work via proxies
|
API Blueprint
|
apache-2.0
|
for-GET/katt
|
52f1da2ce71e99a8d7150b8404d7dd0210fcfb4f
|
apiary.apib
|
apiary.apib
|
FORMAT:alpha-1
HOST: https://aceofblades-bschmoker.c9users.io
# Ace of Blades
Take a regular deck and remove all face cards, leave only the ace of spades and numbered cards (37 total)
Start each player with starts with 5 cards from a shuffled deck
> Win by discarding your entire hand, or having the fewest cards when the draw pile is empty
## Starting a New Game [/new]
Create a new game for two players
+ Parameters
+ creator_id (required, number) - unique ID for player creating the game
+ rival_id (required, number) - unique ID for opponent player to challenge
### Start a new game [GET]
+ Response 200 (application/json)
{
"game_id": '42',
"player_id" : '31337',
"hand" : [ {value: '2', suit:'diamonds']
## Playing the Game [/play]
Make a move or check the current game state
### Get the current game state [GET]
Get information about a given game (including their current hand) for a player
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - Your player ID
+ Response 200 (application/json)
{
"game_id": '42',
"creator_id": '31337',
"rival_id": '8888',
"status": "active",
"hand" : {
"player_id" : '31337'
"cards": [ {value: '2', suit:'diamonds'}]
}
}
+ Response 401
player_id was invalid for the provided game_
### Play a Card [POST]
Choose a card value to play.
Until your opponent chooses their card for this round, you may update the card you wish to play
After the round is resolved, both players draw a card from the shuffled deck
Once the deck is empty, the player with the fewest cards wins.
If your card is *lower* than our opponents, your card is discarded and theirs returns to their hand.
If both cards are the same value, both are discarded
Playing the Ace of Spades lets you discard any card while *also* discarding your opponent's card
After playing the Ace, it moves to your opponent's hand
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - your unique player ID
+ card (required, number) - the card value you wish to play (suits are ignored)
+ ace (optional, boolean) - whether you want to play the ace of spades
+ Request (application/json)
{
"game_id": '42',
"player_id": '31337',
"card": '7'
}
+ Response 200 (application/json)
Once both players have chosen a card value, the server will resolve the round and update each player's hand
+ Response 401
player_id was invalid for the provided game_
+ Response 403
player_id did not have the selected card
|
FORMAT:alpha-1
HOST: https://aceofblades-bschmoker.c9users.io
# Ace of Blades
Take a regular deck and remove all face cards, leave only the ace of spades and numbered cards (37 total)
Start each player with starts with 5 cards from a shuffled deck
## The Choice
Each round, players choose a card value to play
> Multiple cards of different suits and identical value are treated as one card with no advantage or disadvantage to playing them
## The Showdown
Card values are compared and judged:
- Discard all cards of the lowest value
- If all cards are the same value, they are all discarded
- If the Ace of Spades was played, all cards are discarded
If either player has the Ace of Spades, they may play it and choose any card value to discard
> After playing the Ace, it transfers to the opposing player
## The Aftermath
After the showdown, both players draw a card from the shuffled deck
> Win by discarding your entire hand, or having the fewest cards when the draw pile is empty
## Starting a New Game [/new]
Create a new game for two players
+ Parameters
+ creator_id (required, number) - unique ID for player creating the game
+ rival_id (required, number) - unique ID for opponent player to challenge
### Start a new game [GET]
+ Response 200 (application/json)
{
"game_id": '42',
"player_id" : '31337',
"hand" : [ {value: '2', suit:'diamonds']
## Playing the Game [/play]
Make a move or check the current game state
### Show your Hand [GET]
Get the current hand for a specified player and game
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - Your player ID
+ Response 200 (application/json)
{
"game_id": '42',
"creator_id": '31337',
"rival_id": '8888',
"status": "active",
"hand" : {
"player_id" : '31337'
"cards": [ {value: '2', suit:'diamonds'}]
}
}
+ Response 401
player_id was invalid for the provided game_
### Play a Card [POST]
Choose a card value to play.
Until your opponent chooses their card for this round, you may update your choice
Playing the Ace of Spades lets you discard any card while *also* discarding your opponent's card
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - your unique player ID
+ card (required, number) - the card value you wish to play (suits are ignored)
+ ace (optional, boolean) - whether you want to play the ace of spades
+ Request (application/json)
{
"game_id": '42',
"player_id": '31337',
"card": '7'
}
+ Response 200 (application/json)
Once both players have chosen a card value, the server will resolve the round and update each player's hand
+ Response 401
player_id was invalid for the provided game_
+ Response 403
player_id did not have the selected card
|
update api spec
|
update api spec
|
API Blueprint
|
mit
|
bschmoker/aceofblades,bschmoker/highnoon
|
c6c47f4c41219e5ed44ee46efde39c6c6b530014
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://localhost:8001
# demo-faye
This is API blueprint document for my demo on Faye for **Android** and **Node.js**
## Structures
### Client side
This app has two component, Android and Web app.
You can use web app by hit the main page.
1. Android app
2. Web app
### Server side
The main duty of `Server side` is register new user and receiver user message and response to the others.
# Web App [/]
You can enter the web chat interface with this API.
## Open Web App [GET]
+ Response 200 (text/html)
## Group Chat API
### Functions
* Register a new user
* Receive message from Server
* Send message to Server
* Notify others user whether a user is joined or left.
### Mechanism
When a **User** connects to server. He will input his username and push his `sessionId` and `username` to the **Server**.
After that, the **Server** will save the **User** information to database and response the `userId` to **User**.
Now, he can talk to other users. When he push a message. The **Server** will receive it and broadcasts to the others.
When a user *joins* or *leave* the room. Other people will be *notified* by **Server**.
### Register a new user [/chat/register]
**User** connects to the **Server** and acquire a `userId`
#### Send user information [POST]
+ Attributes
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
+ username: user (required, string) - Username of the user
+ Request (application/json)
+ Response 200 (application/json)
### Get userId from Server [/chat/register/{sessionId}]
**Server** will send the `userId` to **User** through this API. After **User** send `username` to **Server**
+ Parameters
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
#### Get userId [GET]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ Response 201 (application/json)
### Send message to users [/chat/public]
The **Server** will send message to the users through this api.
### Receive message from server [GET]
+ Attributes
+ text: user: message (required, string) - Message from user
+ Response 201 (application/json)
### Send message to server [/chat/public/server]
Due to the structure of **Faye**, we have to use **another** channel to transfer message from Client to Server.
> **Note:** a channel must have a **single responsibility** to maintain the **stability** of the application.
>
> A channel will be a **publisher** or **subscriber**.
#### Send message [POST]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ text: message (required, string) - Message from user
+ request (application/json)
+ response 200
### Notify user status to the others [/chat/join]
When a user join or log out, their status will be notified to the others.
#### Notify user status [GET]
+ Attributes
+ text: user has joined. (required, string) - User status
+ response 200 (application/json)
|
FORMAT: 1A
HOST: http://localhost:8001
# demo-faye
This is API blueprint document for my demo on Faye for **Android** and **Node.js**
## Structures
### Client side
This app has two component, Android and Web app.
You can use web app by hit the main page.
1. Android app
2. Web app (http://localhost:8001)
### Server side
The main duty of **Server** side is register new user and receiver user message for responding to the others.
# Web App [/]
You can enter the web chat interface with this API.
## Open Web App [GET]
+ Response 200 (text/html)
## Group Chat API
### Functions
* Register a new user
* Receive message from Server
* Send message to Server
* Notify others user whether a user is joined or left.
### Mechanism
When a **User** connects to server. He will input his username and push his `sessionId` and `username` to the **Server**.
After that, the **Server** will save the **User** information to database and response the `userId` to **User**.
Now, he can talk to other users. When he push a message. The **Server** will receive it and broadcasts to the others.
When a user *joins* or *leave* the room. Other people will be *notified* by **Server**.
### Register a new user [/chat/register]
**User** connects to the **Server** and acquire a `userId`
#### Send user information [POST]
+ Attributes
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
+ username: user (required, string) - Username of the user
+ Request (application/json)
+ Response 200
### Get userId from Server [/chat/register/{sessionId}]
**Server** will send the `userId` to **User** through this API. After **User** send `username` to **Server**
+ Parameters
+ sessionId: 1441428112793 (required, string) - The current sessionId of the user
#### Get userId [GET]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ Response 201 (application/json)
### Send message to users [/chat/public]
The **Server** will send message to the users through this api.
### Receive message from server [GET]
+ Attributes
+ text: user: message (required, string) - Message from user
+ Response 201 (application/json)
### Send message to server [/chat/public/server]
Due to the structure of **Faye**, we have to use **another** channel to transfer message from Client to Server.
> **Note:** a channel must have a **single responsibility** to maintain the **stability** of the application.
>
> A channel will be a **publisher** or **subscriber**.
#### Send message [POST]
+ Attributes
+ userId: 1441428112793 (required, string) - The unique id of the user
+ text: message (required, string) - Message from user
+ request (application/json)
+ response 200
### Notify user status to the others [/chat/join]
When a user join or log out, their status will be notified to the others.
#### Notify user status [GET]
+ Attributes
+ text: user has joined. (required, string) - User status
+ response 200 (application/json)
|
Update API Blueprint
|
Update API Blueprint
|
API Blueprint
|
mit
|
hckhanh/demo-faye,hckhanh/demo-faye,hckhanh/demo-faye,hckhanh/demo-faye
|
ad0670d02b05f669cde193144388db618038593b
|
src/api.apib
|
src/api.apib
|
FORMAT: 1A
# YOUR AWESOME API NAME
*This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.*
## Authentication
+ This API uses [JWT](http://jwt.io/) for authentication,
+ Every token MUST be refreshed before its expiration time,
+ Token MUST be provided in `Authorization` header,
+ Toke MUST be provided for each request that requires authentication,
+ This API issues a **long-lived acces tokens** for consumers. A long-lived JWT generally SHOULD lasts about **30 days**. If no requests are made, the token MUST expire and the user MUST go through the login flow again to get a new one.
### Example Header
```
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhNnZoQW8zRkc3dDEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE0NzA1OTg5NzIsImV4cCI6MTQ3MDY4NTM3Mn0.ltA9zZmJKszBJuuV7pTWtY7LzLXrRUfebJDhy_jGMeM
```
### Claims
+ `exp` - The exp ( *expiration time* ) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing.
+ `iat` - The iat ( *issued at* ) claim identifies the time at which the JWT was issued.
+ `sub` - The aud ( *audience* ) claim identifies the subject of this token (for e.g. a user id).
+ `iss` - The iss ( *issuer* ) claim identifies the principal that issued the JWT.
## Consumer Identification
This API uses `User-Agent` and `Application-Id` headers to identify API consumer. `Application-Id` MUST contain an UUID that uniquely identifies a particular consumer installation.
### Example Headers
```
User-Agent: Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Application-Id: 6454d937-0a18-44a8-b482-bb48684f1ed4
```
## Filtering, Ordering, Pagination & Searching
### Filtering
This API can filter returned collections based on provided query parameters. Virtually any model field can be used as a filter.
For example, when requesting a list of movies from the /movies endpoint, you may want to limit these to only those of drama genre. This could be accomplished with a request like `GET /movies?genre=drama`. Here, genre is a query parameter that implements a filter.
### Ordering
This API can sort returned collections. A generic query parameter `sort` is used to describe sorting rules. This parameter can take a list of comma separated field, each with a possible unary negative to imply descending sort order.
E.g. `GET /movies?sort=-rating` - Retrieves a list of movies in descending order of user rating.
By default all resources are ordered by their creation time, from newest to oldest.
### Pagintation
This API uses the [Link header - RFC 5988](http://tools.ietf.org/html/rfc5988#page-6) to include pagination details.
An example of a Link header is described in [GitHub documentation](https://developer.github.com/guides/traversing-with-pagination/).
This API returns total count of paged resources in `Total-Count` HTTP header.
### Searching
This API uses a generic parameter `search` to expose a full text search mechanism.
## HTTP Methods
This API uses HTTP verbs (methods) as following:
+ `GET` - *Read* - used to **read** (or retrieve) a representation of a resource,
+ `POST` - *Create* - used to **create** new resources. In particular, it's used to create subordinate resources.
+ `PUT` - *Update/Replace* - used for **update** capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. ⚠️ On successful request, replaces identified resource with the request body.
+ `PATCH` - *Update/Modify* - used for **modify** capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
+ `DELETE` - *Delete* - used to **delete** a resource identified by a URI.
## Localization
This API uses `Accept-Language` header to identify the locale.
`Accept-Language: en`
This header SHOULD be present in every request. If not, API MUST use the **english** language/locale.
## Media Type
Where applicable this API MUST use the JSON media-type. Requests with a message-body are using plain JSON to set or update resource states.
`Content-type: application/json` and `Accept: application/json` headers SHOULD be set on all requests if not stated otherwise.
|
FORMAT: 1A
# YOUR AWESOME API NAME
*This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.*
## Authentication
+ This API uses [JWT](http://jwt.io/) for authentication,
+ Every token MUST be refreshed before its expiration time,
+ Token MUST be provided in `Authorization` header,
+ Toke MUST be provided for each request that requires authentication,
+ This API issues a **long-lived acces tokens** for consumers. A long-lived JWT generally SHOULD lasts about **30 days**. If no requests are made, the token MUST expire and the user MUST go through the login flow again to get a new one.
### Example Header
```
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhNnZoQW8zRkc3dDEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE0NzA1OTg5NzIsImV4cCI6MTQ3MDY4NTM3Mn0.ltA9zZmJKszBJuuV7pTWtY7LzLXrRUfebJDhy_jGMeM
```
### Claims
+ `exp` - The exp ( *expiration time* ) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing.
+ `iat` - The iat ( *issued at* ) claim identifies the time at which the JWT was issued.
+ `sub` - The aud ( *audience* ) claim identifies the subject of this token (for e.g. a user id).
+ `iss` - The iss ( *issuer* ) claim identifies the principal that issued the JWT.
## Consumer Identification
This API uses `User-Agent` and `Application-Id` headers to identify API consumer. `Application-Id` MUST contain an UUID that uniquely identifies a particular consumer installation.
### Example Headers
```
User-Agent: Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Application-Id: 6454d937-0a18-44a8-b482-bb48684f1ed4
```
## Filtering, Ordering, Pagination & Searching
### Filtering
This API can filter returned collections based on provided query parameters. Virtually any model field can be used as a filter.
For example, when requesting a list of movies from the /movies endpoint, you may want to limit these to only those of drama genre. This could be accomplished with a request like `GET /movies?genre=drama`. Here, genre is a query parameter that implements a filter.
### Ordering
This API can sort returned collections. A generic query parameter `sort` is used to describe sorting rules. This parameter can take a list of comma separated field, each with a possible unary negative to imply descending sort order.
E.g. `GET /movies?sort=-rating` - Retrieves a list of movies in descending order of user rating.
By default all resources are ordered by their creation time, from newest to oldest.
### Pagintation
This API uses the [Link header - RFC 5988](http://tools.ietf.org/html/rfc5988#page-6) to include pagination details.
An example of a Link header is described in [GitHub documentation](https://developer.github.com/guides/traversing-with-pagination/).
This API returns total count of paged resources in `Total-Count` HTTP header.
### Searching
This API uses a generic parameter `search` to expose a full text search mechanism.
## HTTP Methods
This API uses HTTP verbs (methods) as following:
+ `GET` - *Read* - used to **read** (or retrieve) a representation of a resource,
+ `POST` - *Create* - used to **create** new resources. In particular, it's used to create subordinate resources.
+ `PUT` - *Update/Replace* - used for **update** capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. ⚠️ On successful request, replaces identified resource with the request body.
+ `PATCH` - *Update/Modify* - used for **modify** capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
+ `DELETE` - *Delete* - used to **delete** a resource identified by a URI.
## Localization
This API uses `Accept-Language` header to identify the locale.
`Accept-Language: en`
This header SHOULD be present in every request. If not, API MUST use the **english** language/locale.
## Media Type
Where applicable this API MUST use the JSON media-type. Requests with a message-body are using plain JSON to set or update resource states.
`Content-type: application/json` and `Accept: application/json` headers SHOULD be set on all requests if not stated otherwise.
## Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119](https://www.ietf.org/rfc/rfc2119).
|
Add RFC2119 notational conventions
|
Add RFC2119 notational conventions
|
API Blueprint
|
mit
|
jsynowiec/api-blueprint-boilerplate,jsynowiec/api-blueprint-boilerplate
|
0f7fbfc326bd5d9f5d668def9b53c2eec1c23421
|
apiary.apib
|
apiary.apib
|
HOST: https://dfw.barbican.api.rackspacecloud.com/v1/
--- Barbican API v1 ---
---
Barbican is a ReST based key management service. It is built with
[OpenStack](http://www.openstack.org/) in mind, but can bse used outside
an OpenStack implementation.
More information can be found on [GitHub](https://github.com/cloudkeep/barbican).
---
--
Secrets Resource
The following is a description of the resources dealing with generic secrets.
These can be encryption keys or anything else a user wants to store in a secure,
auditable manner
--
Allows a user to list all secrets in a tenant. Note: the actual secret
should not be listed here, a user must make a separate call to get the
secret details to view the secret.
GET /secrets
< 200
< Content-Type: application/json
{
"name": "AES key"
"algorithm": "AES"
"cypher_type": "CDC"
"bit_length": 256
"content_types": {
"default": "text/plain"
}
"expiration": "2013-05-08T16:21:38.134160"
"id": "2eb5a8d8-2202-4f46-b64d-89e26eb25487"
"mime_type": "text/plain"
}
Allows a user to create a new secret. This call expects the user to
provide a secret. To have the API generate a secret, see the provisioning
API.
POST /secrets
> Content-Type: application/json
{ "product":"1AB23ORM", "quantity": 2 }
< 201
< Content-Type: application/json
{ "status": "created", "url": "/shopping-cart/2" }
-- Payment Resources --
This resource allows you to submit payment information to process your *shopping cart* items
POST /payment
{ "cc": "12345678900", "cvc": "123", "expiry": "0112" }
< 200
{ "receipt": "/payment/receipt/1" }
|
HOST: https://dfw.barbican.api.rackspacecloud.com/v1/
--- Barbican API v1 ---
---
Barbican is a ReST based key management service. It is built with
[OpenStack](http://www.openstack.org/) in mind, but can be used outside
an OpenStack implementation.
More information can be found on [GitHub](https://github.com/cloudkeep/barbican).
---
--
Secrets Resource
The following is a description of the resources dealing with generic secrets.
These can be encryption keys or anything else a user wants to store in a secure,
auditable manner
--
Allows a user to list all secrets in a tenant. Note: the actual secret
should not be listed here, a user must make a separate call to get the
secret details to view the secret.
GET /secrets
< 200
< Content-Type: application/json
{
"name": "AES key"
"algorithm": "AES"
"cypher_type": "CDC"
"bit_length": 256
"content_types": {
"default": "text/plain"
}
"expiration": "2013-05-08T16:21:38.134160"
"id": "2eb5a8d8-2202-4f46-b64d-89e26eb25487"
"mime_type": "text/plain"
}
Allows a user to create a new secret. This call expects the user to
provide a secret. To have the API generate a secret, see the provisioning
API.
POST /secrets
> Content-Type: application/json
{ "product":"1AB23ORM", "quantity": 2 }
< 201
< Content-Type: application/json
{ "status": "created", "url": "/shopping-cart/2" }
-- Payment Resources --
This resource allows you to submit payment information to process your *shopping cart* items
POST /payment
{ "cc": "12345678900", "cvc": "123", "expiry": "0112" }
< 200
{ "receipt": "/payment/receipt/1" }
|
Correct a typo in apiary.apib
|
Correct a typo in apiary.apib
Change-Id: I76ce15a8a776b574c4e52f243297cf186fb0ad83
|
API Blueprint
|
apache-2.0
|
openstack/barbican,openstack/barbican
|
f8f124f83746479c177dc6b29afe3758520bb8dd
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# inpassing
A web API for managing the lending and borrowing of passes.
## Org [/orgs]
+ Attribute
+ id: 2 (number)
+ name: Locust Valley High School (string)
### Create a new org [POST]
+ Request (application/json)
{
"name": "Locust Valley High School"
}
+ Response 201
+ Headers
Location: /orgs/2
### Search orgs by name [GET /orgs/search{?q}]
+ Parameters
- q: `Locust Valley` (string) - Query string
+ Response 200 (application/json)
[
{
"id": 2,
"name": "Locust Valley High School"
}
]
### Query an org [GET /orgs/{id}]
+ Parameters
- id (number) - Org ID
+ Request Anonymous
Without authentication, only basic information about an org will be returned.
+ Body
+ Response 200 (application/json)
+ Attributes (Org)
+ Request Authenticated
Use authentication to get more information about an org relevant to the user's role in that org.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Org)
+ greeting_fmt: `Today is a {} day` (string) - The greeting format
## User [/users]
+ Attributes
+ id (number)
+ first_name (string)
+ last_name (string)
+ email (string)
+ moderates (array[Org])
+ participates (array[Org])
+ passes (array[Pass])
### Create a user [POST]
+ Request (application/json)
+ Attributes
+ first_name: Luke (string) - User first name
+ last_name: San Antonio Bialecki (string) - User last name
+ email: `[email protected]` (string) - User email (used to log in)
+ password: `iUs3tHe$aMepAs$wOrdF0rEvEritHiNg` (string) - User password
+ Response 201
+ Headers
Location: /users/2
### Authenticate as user [POST /users/auth]
+ Request (application/json)
{
"email": "[email protected]",
"password": "iUs3tHe$aMepAs$wOrdF0rEvEritHiNg"
}
+ Response 200 (application/json)
{
"access_token": "<JWT_TOKEN>"
}
+ Response 403 (application/json)
{
"msg": "invalid username or password"
}
## Self [/me]
### Query self [GET]
+ Request
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Body
{
"id": 2,
"first_name": "Luke"
"last_name": "San Antonio Bialecki",
"email": "[email protected]",
"participates": [
{
"id": 2,
"name": "Locust Valley High School"
}
],
"moderates": [
{
"id": 1,
"name": "Test org"
}
],
"passes": [
{
"id": 3,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-03:23:00:12",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": "2017-02-04:07:42:12",
"assigned_state_id": 2,
"assigned_spot_num": 15
},
{
"id": 4,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-06:13:55:32",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": null,
"assigned_state_id": null,
"assigned_spot_num": null
}
]
}
## Pass [/passes{?org_id,user_id,verified}]
+ Attributes
+ id: 2 (number) - The pass ID
+ org_id: 1 (number) - The org that this pass belongs to
+ owner_id: 3 (number, nullable) - The user owner of the pass
+ request_time: `2017-02-03;23:00:12` (string) - Date and time of the pass request
+ requested_state_id: 2 (number) - Pass state requested by the user
+ requested_spot_num: 20 (number) - Pass spot requested by the user
+ assigned_time: `2017-02-03;23:15:12` (string, nullable) - Date and time when the pass was assigned / verified
+ assigned_state_id: 2 (number, nullable) - Pass state assigned to this pass
+ assigned_spot_num: 25 (number, nullable) - Pass spot number assigned to this pass
### Query pass collection [GET]
Filters all the passes that the user has access to.
If the user is the mod of an org, all org passes are available to filter.
+ Parameters
+ org_id (number, optional) - Return passes associated with this Org
+ user_id (number, optional) - Return passes associated with this user
+ verified (boolean, optional) - Filter verified passes. If this is null or omitted, all passes will be returned.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Pass])
### Request a new pass [POST]
Requests a new pass from an Org on behalf of the authenticated user.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Attributes
+ org_id: 2 (number) - The Org that the pass is to be requested from
+ state_id: 1 (number) - The requested day state of the pass
+ spot_num: 25 (number) - The requested spot number
+ Response 201 (application/json)
Note that although the pass object exists, the org will still need to verify it for it to be useful.
+ Header
Location: /passes/2
+ Attributes (Pass)
+ assigned_time - null
+ assigned_state_id - null
+ assigned_spot_num - null
### Query pass [GET /passes/{id}]
Get specific pass object
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Pass)
+ Response 403 (application/json)
You can only query passes that you would have access to either as an org moderator or a user!
+ Body
{
"msg": "not authenticated to view this pass",
"error_code": "foreign_pass"
}
### Assign pass [PUT /passes/{id}/assign]
Used to verify passes or re-assign them to different states or spot numbers.
Any changes to the pass resulting from this call will result in `assigned_time` being updated.
+ Request
+ Header
Authorization: Bearer JWT
+ Attributes
+ state_id (number, optional) - The new state of the pass
+ spot_num (number, optional) - The new spot number of the pass
+ Response 200 (application/json)
+ Attributes (Pass)
### Lend a pass [POST /passes/{pass_id}/lend]
Creates a request to lend a pass on behalf of the user for every day in the date range.
The pass will not be lent out on days that the user does not have access to the pass,
but it is not an error to include these days in the date range.
+ Parameters
+ pass_id (number) - The pass to lend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Borrow a pass [POST /passes/borrow]
Creates a request to borrow a pass on behalf of the user for every day in the date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
# Data Structures
## Date
+ date: `2017-03-05` (string) - Date
## Date Range (object)
+ start_date: `2017-11-15` (string) - Start date
+ end_date: `2018-01-04` (string) - End date
## Date Selection (enum)
+ (Date)
+ (Date Range)
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# inpassing
A web API for managing the lending and borrowing of passes.
## Org [/orgs]
+ Attribute
+ id: 2 (number)
+ name: Locust Valley High School (string)
### Create a new org [POST]
+ Request (application/json)
{
"name": "Locust Valley High School"
}
+ Response 201
+ Headers
Location: /orgs/2
### Search orgs by name [GET /orgs/search{?q}]
+ Parameters
- q: `Locust Valley` (string) - Query string
+ Response 200 (application/json)
[
{
"id": 2,
"name": "Locust Valley High School"
}
]
### Query an org [GET /orgs/{id}]
+ Parameters
- id (number) - Org ID
+ Request Anonymous
Without authentication, only basic information about an org will be returned.
+ Body
+ Response 200 (application/json)
+ Attributes (Org)
+ Request Authenticated
Use authentication to get more information about an org relevant to the user's role in that org.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Org)
+ greeting_fmt: `Today is a {} day` (string) - The greeting format
## Day State [/orgs/{org_id}/daystates]
+ Attributes
+ id: 1 (number) - The ID of the day state.
+ Include Day State Create
### Query states [GET]
Return information about an org day state.
+ Parameters
+ org_id: 2 (number) - The org whose states are to be queried.
+ Request
The authenticated user must be a participant or moderator of the org to query states.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Day State])
### Create a state [POST]
Creates a new day state associated with a given organization.
+ Parameters
+ org_id: 2 (number) - The org that will receive the new state.
+ Request
The authenticated user must moderate the org
+ Header
Authorization: Bearer JWT
+ Attributes (Day State Create)
+ Response 201 (application/json)
+ Attributes (Day State)
### Update a state [PUT /orgs/{org_id}/daystates/{daystate_id}]
Changes the identifier and/or greeting of a day state.
+ Request (application/json)
+ Header
Authorization: Bearer JWT
+ Attributes
+ identifier: `A` (string, optional)
+ greeting: `Updated greeting - A day` (string, optional)
+ Response 200 (application/json)
+ Attributes (Day State)
### Get the current day state [GET /orgs/{org_id}/daystates/current]
Returns the current day state, this will change on a day by day basis.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
+ Response 404 (application/json)
This occurs when an org has no rules defined for day states (or no day states to begin with).
+ Body
## User [/users]
+ Attributes
+ id (number)
+ first_name (string)
+ last_name (string)
+ email (string)
+ moderates (array[Org])
+ participates (array[Org])
+ passes (array[Pass])
### Create a user [POST]
+ Request (application/json)
+ Attributes
+ first_name: Luke (string) - User first name
+ last_name: San Antonio Bialecki (string) - User last name
+ email: `[email protected]` (string) - User email (used to log in)
+ password: `iUs3tHe$aMepAs$wOrdF0rEvEritHiNg` (string) - User password
+ Response 201
+ Headers
Location: /users/2
### Authenticate as user [POST /users/auth]
+ Request (application/json)
{
"email": "[email protected]",
"password": "iUs3tHe$aMepAs$wOrdF0rEvEritHiNg"
}
+ Response 200 (application/json)
{
"access_token": "<JWT_TOKEN>"
}
+ Response 403 (application/json)
{
"msg": "invalid username or password"
}
## Self [/me]
### Query self [GET]
+ Request
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Body
{
"id": 2,
"first_name": "Luke"
"last_name": "San Antonio Bialecki",
"email": "[email protected]",
"participates": [
{
"id": 2,
"name": "Locust Valley High School"
}
],
"moderates": [
{
"id": 1,
"name": "Test org"
}
],
"passes": [
{
"id": 3,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-03:23:00:12",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": "2017-02-04:07:42:12",
"assigned_state_id": 2,
"assigned_spot_num": 15
},
{
"id": 4,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-06:13:55:32",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": null,
"assigned_state_id": null,
"assigned_spot_num": null
}
]
}
## Pass [/passes{?org_id,user_id,verified}]
+ Attributes
+ id: 2 (number) - The pass ID
+ org_id: 1 (number) - The org that this pass belongs to
+ owner_id: 3 (number, nullable) - The user owner of the pass
+ request_time: `2017-02-03;23:00:12` (string) - Date and time of the pass request
+ requested_state_id: 2 (number) - Pass state requested by the user
+ requested_spot_num: 20 (number) - Pass spot requested by the user
+ assigned_time: `2017-02-03;23:15:12` (string, nullable) - Date and time when the pass was assigned / verified
+ assigned_state_id: 2 (number, nullable) - Pass state assigned to this pass
+ assigned_spot_num: 25 (number, nullable) - Pass spot number assigned to this pass
### Query pass collection [GET]
Filters all the passes that the user has access to.
If the user is the mod of an org, all org passes are available to filter.
+ Parameters
+ org_id (number, optional) - Return passes associated with this Org
+ user_id (number, optional) - Return passes associated with this user
+ verified (boolean, optional) - Filter verified passes. If this is null or omitted, all passes will be returned.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Pass])
### Request a new pass [POST]
Requests a new pass from an Org on behalf of the authenticated user.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Attributes
+ org_id: 2 (number) - The Org that the pass is to be requested from
+ state_id: 1 (number) - The requested day state of the pass
+ spot_num: 25 (number) - The requested spot number
+ Response 201 (application/json)
Note that although the pass object exists, the org will still need to verify it for it to be useful.
+ Header
Location: /passes/2
+ Attributes (Pass)
+ assigned_time - null
+ assigned_state_id - null
+ assigned_spot_num - null
### Query pass [GET /passes/{id}]
Get specific pass object
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Pass)
+ Response 403 (application/json)
You can only query passes that you would have access to either as an org moderator or a user!
+ Body
{
"msg": "not authenticated to view this pass",
"error_code": "foreign_pass"
}
### Assign pass [PUT /passes/{id}/assign]
Used to verify passes or re-assign them to different states or spot numbers.
Any changes to the pass resulting from this call will result in `assigned_time` being updated.
+ Request
+ Header
Authorization: Bearer JWT
+ Attributes
+ state_id (number, optional) - The new state of the pass
+ spot_num (number, optional) - The new spot number of the pass
+ Response 200 (application/json)
+ Attributes (Pass)
### Lend a pass [POST /passes/{pass_id}/lend]
Creates a request to lend a pass on behalf of the user for every day in the date range.
The pass will not be lent out on days that the user does not have access to the pass,
but it is not an error to include these days in the date range.
+ Parameters
+ pass_id (number) - The pass to lend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Borrow a pass [POST /passes/borrow]
Creates a request to borrow a pass on behalf of the user for every day in the date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
# Data Structures
## Date
+ date: `2017-03-05` (string) - Date
## Date Range (object)
+ start_date: `2017-11-15` (string) - Start date
+ end_date: `2018-01-04` (string) - End date
## Date Selection (enum)
+ (Date)
+ (Date Range)
## Day State Create (object)
+ identifier: M (string) - A recognizable short name / character for the state
+ greeting: `Today is a Monday` (string) - The greeting used to inform clients of the state of the current day.
|
Update API doc with Day State functionality
|
Update API doc with Day State functionality
This is the first step (the second step being actual implementation) of fixing
issue #4.
|
API Blueprint
|
mit
|
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
|
390fe21cca8b9cf9d89e083a0924e5ca2249668b
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/articles/{id}]
A single Article object with all its details
+ Parameters
+ id (required, string, `foo-bar`) ... String `id` of the Article to perform action with. Has example value.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt"
}
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/articles/{id}]
A single Article object with all its details
+ Parameters
+ id (required, string, `foo-bar`) ... String `id` of the Article to perform action with. Has example value.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
|
Add article body to API Blueprint
|
Add article body to API Blueprint
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
7c041b51566d1ebc840615bec5d25a45738d9110
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# cluster-orchestrator
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Notes
Notes related resources of the **Notes API**
## Notes Collection [/notes]
### List all Notes [GET]
+ Response 200 (application/json)
[{
"id": 1, "title": "Jogging in park"
}, {
"id": 2, "title": "Pick-up posters from post-office"
}]
### Create a Note [POST]
+ Request (application/json)
{ "title": "Buy cheese and bread for breakfast." }
+ Response 201 (application/json)
{ "id": 3, "title": "Buy cheese and bread for breakfast." }
## Note [/notes/{id}]
A single Note object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.
### Retrieve a Note [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{ "id": 2, "title": "Pick-up posters from post-office" }
### Remove a Note [DELETE]
+ Response 204
|
FORMAT: 1A
# cluster-orchestrator
API for orchestrator used in totem v2.
# Orchestrator Hooks
## Generic Internal Hook [POST /hooks/generic]
API for posting custom callback hook to internal orchestrator api.
+ Request
+ Headers
Content-Type: application/vnd.orch.generic.hook.v1+json
Accept: application/vnd.orch.task.v1+json, application/json
+ Schema
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"type": "object",
"title": "Schema for Generic Hook payload",
"id": "#generic-hook-v1",
"properties": {
"git": {
"description": "Git meta-information used for locating totem.yml."
"$ref": "#/definitions/git"
},
"name": {
"description": "Name of the hook (e.g. image-factory)",
"type": "string",
"maxLength": 100
},
"type": {
"description": "Type of the hook (e.g. builder, ci)",
"enum": ["builder", "ci", "scm-create", "scm-push"]
},
"status": {
"description": "Status for the hook (failed, success)",
"enum": ["success", "failed"]
},
"result": {
"description": "Result object",
"type": "object"
},
"force-deploy": {
"description": "Force deploy the image on receiving this hook (ignore status)",
"type": "boolean"
}
},
"additionalProperties": false,
"required": ["name", "type", "git"],
"definitions": {
"git": {
"properties": {
"owner": {
"title": "Owner/Organization of the SCM repository (e.g. totem)",
"type": "string",
"maxLength": 100
},
"repo": {
"title": "SCM repository name (e.g.: spec-python)",
"type": "string",
"maxLength": 100
},
"ref": {
"title": "Branch or tag name",
"type": "string",
"maxLength": 100
},
"commit": {
"title": "Git SHA Commit ID",
"type": ["string", "null"],
"maxLength": 100
}
},
"additionalProperties": false,
"required": ["owner", "repo", "ref"]
}
}
}
+ Body
{
"git":{
"owner": "totem",
"repo": "totem-demo",
"ref": "master",
"commit": "75863c8b181c00a6e0f70ed3a876edc1b3a6a662"
},
"type": "builder",
"name": "mybuilder",
"status": "success",
"force-deploy": true,
"result": {
"image": "totem/totem-demo"
}
}
+ Response 200 (pplication/vnd.orch.task.v1+json)
+ Body
{
"task_id": "81b5de1c-a7af-4bc2-9593-644645f655bc"
}
|
Add generic internal hook
|
Add generic internal hook
|
API Blueprint
|
mit
|
totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator
|
7610a74cd4a914a37975173ab0423857682551e9
|
apiary.apib
|
apiary.apib
|
HOST: https://api.loader.io/v2
--- loader.io API load testing documentation ---
---
All requests require an API key. While you can specify the API key in the body of your request, we’d prefer it be passed via the loaderio-Auth header. You can do this as follows:
In the Header: loaderio-Auth: {api_key}
In the Body: api_key={api_key}
---
--
Application Resources
--
List registered applications
GET /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
},
{
"app": "google.com",
"status": "unverified",
"app_id": "b579bbed7ef480e7318ac4d7b69e5caa"
}
]
Application status
GET /apps/{app_id}
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
}
Register a new application
Format: myapp.com or www.myapp.com (note: myapp.com & www.myapp.com are different applications)
POST /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
{
"app": "gonnacrushya.com"
}
< 200
< Content-Type: application/json
{
"message": "success",
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"verification_id": "loaderio-0f2fabf74c5451cf71dce7cf43987477"
}
Verify a registered application
POST /apps/{app_id}/verify
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message": "success"
}
--
Test Resources
--
List of load tests
GET /tests
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ header: "value", header2: "value2" },
"request_params":{ param: "value", param2: "value2" },
"authentication":{login: "login", password: "password", type: "basic"}
}
]
}
]
Create a new load test
POST /tests
> loaderio-Auth: {api_key}
> Content-type: application/json
{
"initial": 0,
"total": 60,
"duration": 60,
"callback": "http://gonnacrushya.com/loader-callback",
"name": "GonnaCrushYa Home Page",
"timeout": 10000,
"callback_email": "[email protected]",
"test_type": "cycling",
"notes": "Going to kicks the crap out of this server",
"scheduled_at": "2013-5-15 3:30:00",
"urls": [
{
"url": "http://gonnacrushya.com",
"request_type": "GET",
"post_body": "post body params go here",
"payload_file_url": "http://loader.io/payload_file.yml",
"authentication": {"login": "login", "password": "secret", "type": "basic"},
"headers": { "header1": "value1", "header2": "value2" },
"request_params": { "params1": "value1", "params2": "value2" }
}
]
}
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
Load test status
GET /tests/{test_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ header: "value", header2: "value2" },
"request_params":{ param: "value", param2: "value2" },
"authentication":{login: "login", password: "password", type: "basic"}
}
]
}
Load test results
GET /tests/{test_id}/results
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ header: "value", header2: "value2" },
"request_params":{ param: "value", param2: "value2" },
"authentication":{login: "login", password: "password", type: "basic"}
}
],
"results_data": {
"started_at": "2013-05-09T23:31:25+03:00",
"public_results_url": "http://loader.io/results/0642ee5387b4ee35b581b6bf1332c70b",
"avg_response_time": 7,
"avg_error_rate": 0.0,
"success": 213154,
"error": 0,
"timeout_error": 0,
"network_error": 0,
"data_sent": 470857186,
"data_received": 23666310
}
}
}
Run load test
PUT /tests/{test_id}/run
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
Stop load test
PUT /tests/{test_id}/stop
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"message":"success",
"test_id":"1187538bb5d5fd60a1b99a6e67978c15",
"status":"finished",
"summary_id":"7c55ad8408f7c4326b7fa0e069b7a011"
}
--
Test results
--
Load test results
GET /tests/{test_id}/summaries
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
[
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
]
Load test individual result
GET /tests/{test_id}/summaries/{summary_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
--
Servers
--
Load test server's ip addresses
GET /servers
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"ip_addresses": ["127.0.0.1"]
}
|
HOST: https://api.loader.io/v2
--- loader.io API load testing documentation ---
---
All requests require an API key. While you can specify the API key in the body of your request, we’d prefer it be passed via the loaderio-Auth header. You can do this as follows:
In the Header: loaderio-Auth: {api_key}
In the Body: api_key={api_key}
---
--
Application Resources
--
List registered applications
GET /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
},
{
"app": "google.com",
"status": "unverified",
"app_id": "b579bbed7ef480e7318ac4d7b69e5caa"
}
]
Application status
GET /apps/{app_id}
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Register a new application
Format: myapp.com or www.myapp.com (note: myapp.com & www.myapp.com are different applications)
POST /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
{
"app": "gonnacrushya.com"
}
< 200
< Content-Type: application/json
{
"message": "success",
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"verification_id": "loaderio-0f2fabf74c5451cf71dce7cf43987477"
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["We are unable to register this app"]
}
Verify a registered application
POST /apps/{app_id}/verify
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message": "success"
}
+++++
< 422
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message":"error",
"errors":["can't verify domain gonnacrushya.com"]
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
--
Test Resources
--
List of load tests
GET /tests
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{ "param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
]
List of active load tests (verified, not archived)
GET /tests/active
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{ "param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
]
Create a new load test
POST /tests
> loaderio-Auth: {api_key}
> Content-type: application/json
{
"initial": 0,
"total": 60,
"duration": 60,
"callback": "http://gonnacrushya.com/loader-callback",
"name": "GonnaCrushYa Home Page",
"timeout": 10000,
"callback_email": "[email protected]",
"test_type": "cycling",
"notes": "Going to kicks the crap out of this server",
"scheduled_at": "2013-5-15 3:30:00",
"urls": [
{
"url": "http://gonnacrushya.com",
"request_type": "GET",
"post_body": "post body params go here",
"payload_file_url": "http://loader.io/payload_file.yml",
"authentication": {"login": "login", "password": "secret", "type": "basic"},
"headers": { "header1": "value1", "header2": "value2" },
"request_params": { "params1": "value1", "params2": "value2" }
}
]
}
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"processing"
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
+++++
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"unverified"
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["can't create test"]
}
Load test status
GET /tests/{test_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{"param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Run load test
PUT /tests/{test_id}/run
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"processing"
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["Can't run test for unverified application"]
}
Stop load test
PUT /tests/{test_id}/stop
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"message":"success",
"test_id":"1187538bb5d5fd60a1b99a6e67978c15",
"status":"finished",
"summary_id":"7c55ad8408f7c4326b7fa0e069b7a011"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["Can't stop test with finished status"]
}
--
Test results
--
Load test results
GET /tests/{test_id}/summaries
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
[
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
]
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Load test result
GET /tests/{test_id}/summaries/{summary_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
--
Servers
--
Load test server's ip addresses
GET /servers
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"ip_addresses": ["127.0.0.1"]
}
|
Update docs
|
[#51206839] Update docs
|
API Blueprint
|
mit
|
sendgridlabs/loaderio-docs,sendgridlabs/loaderio-docs
|
4e3d63bee6a8309b07ba609bf679cc3a1a075ac5
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://openocr.yourserver.com
# openocr
OpenOCR REST API - See http://www.openocr.net
# Group OpenOCR
Related resources of the **OpenOCR API**
If you are writing in Go, it's easier to just use the [open-ocr-client](https://github.com/tleyden/open-ocr-client) library, which uses this API.
## OCR Decode via URL [/ocr]
### OCR Decode [POST]
Decode the image given in the image url parameter and return the decoded OCR text
+ Request (application/json)
+ Body
{
"img_url":"http://bit.ly/ocrimage",
"engine":"tesseract",
"engine_args":{
"config_vars":{
"tessedit_char_whitelist":"0123456789"
},
"psm":"3"
}
}
+ Schema
{
"$schema":"http://json-schema.org/draft-04/schema#",
"title":"OpenOCR OCR Processing Request",
"description":"A request to convert an image into text",
"type":"object",
"properties":{
"img_url":{
"description":"The URL of the image to process.",
"type":"string"
},
"engine":{
"description":"The OCR engine to use",
"enum":[
"tesseract",
"go_tesseract",
"mock"
]
},
"engine_args":{
"type":"object",
"description":"The OCR engine arguments to pass (engine-specific)",
"properties":{
"config_vars":{
"type":"object",
"description":"Config vars - equivalent of -c args to tesseract"
},
"psm":{
"description":"Page Segment Mode, equivalent of -psm arg to tesseract",
"enum":[
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
]
}
},
"additionalProperties":false
},
"inplace_decode":{
"type":"boolean",
"description":"If true, will attempt to do ocr decode in-place rather than queuing a message on RabbitMQ for worker processing. Useful for local testing, not recommended for production."
}
},
"required":[
"img_url",
"engine"
],
"additionalProperties":false
}
+ Response 200 (text/plain)
Decoded OCR Text
## OCR Decode via file upload [/ocr-file-upload]
### OCR Decode [POST]
Decode the image data given directly in the multipart/related data. The order is important, and the first part should be the JSON, which tells it which OCR engine to use. The schema for thi JSON is documented in the `/ocr` endpoint. The `img_url` parameter of the JSON will be ignored in this case.
The image attachment should be the _second_ part, and it should work with any image content type (eg, image/png, image/jpg, etc).
+ Request (multipart/related; boundary=---BOUNDARY)
-----BOUNDARY
Content-Type: application/json
{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}
-----BOUNDARY
-----BOUNDARY
Content-Disposition: attachment;
Content-Type: image/png
filename="attachment.txt".
PNGDATA.........
-----BOUNDARY
+ Response 200 (text/plain)
Decoded OCR Text
|
FORMAT: 1A
HOST: http://openocr.yourserver.com
# openocr
OpenOCR REST API - See http://www.openocr.net
# Group OpenOCR
If you are writing in Go, it's easier to just use the [open-ocr-client](https://github.com/tleyden/open-ocr-client) library, which uses this API.
## OCR Decode via URL [/ocr]
### OCR Decode [POST]
Decode the image given in the image url parameter and return the decoded OCR text
+ Request (application/json)
+ Body
{
"img_url":"http://bit.ly/ocrimage",
"engine":"tesseract",
"engine_args":{
"config_vars":{
"tessedit_char_whitelist":"0123456789"
},
"psm":"3"
}
}
+ Schema
{
"$schema":"http://json-schema.org/draft-04/schema#",
"title":"OpenOCR OCR Processing Request",
"description":"A request to convert an image into text",
"type":"object",
"properties":{
"img_url":{
"description":"The URL of the image to process.",
"type":"string"
},
"engine":{
"description":"The OCR engine to use",
"enum":[
"tesseract",
"go_tesseract",
"mock"
]
},
"engine_args":{
"type":"object",
"description":"The OCR engine arguments to pass (engine-specific)",
"properties":{
"config_vars":{
"type":"object",
"description":"Config vars - equivalent of -c args to tesseract"
},
"psm":{
"description":"Page Segment Mode, equivalent of -psm arg to tesseract",
"enum":[
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
]
}
},
"additionalProperties":false
},
"inplace_decode":{
"type":"boolean",
"description":"If true, will attempt to do ocr decode in-place rather than queuing a message on RabbitMQ for worker processing. Useful for local testing, not recommended for production."
}
},
"required":[
"img_url",
"engine"
],
"additionalProperties":false
}
+ Response 200 (text/plain)
Decoded OCR Text
## OCR Decode via file upload [/ocr-file-upload]
### OCR Decode [POST]
Decode the image data given directly in the multipart/related data. The order is important, and the first part should be the JSON, which tells it which OCR engine to use. The schema for thi JSON is documented in the `/ocr` endpoint. The `img_url` parameter of the JSON will be ignored in this case.
The image attachment should be the _second_ part, and it should work with any image content type (eg, image/png, image/jpg, etc).
+ Request (multipart/related; boundary=---BOUNDARY)
-----BOUNDARY
Content-Type: application/json
{"img_url":"http://bit.ly/ocrimage","engine":"tesseract"}
-----BOUNDARY
-----BOUNDARY
Content-Disposition: attachment;
Content-Type: image/png
filename="attachment.txt".
PNGDATA.........
-----BOUNDARY
+ Response 200 (text/plain)
Decoded OCR Text
|
Remove "related resource" comment.
|
Remove "related resource" comment.
|
API Blueprint
|
apache-2.0
|
puffygeek/open-ocr,tleyden/open-ocr,maiduchuy/open-ocr,kimmobrunfeldt/open-ocr,tleyden/open-ocr,maiduchuy/open-ocrworker,puffygeek/open-ocr,kimmobrunfeldt/open-ocr,maiduchuy/open-ocr
|
843c0ce0539fd33f1f5d9da851466c5856ad5911
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://orgmanager.miguelpiedrafita.com/api
# Orgmanager API
The Orgmanager API allows you to integrate Orgmanager with other applications and projects.
## Questions Collection [/questions]
### List All Questions [GET]
+ Response 200 (application/json)
[
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 2048
}, {
"choice": "Python",
"votes": 1024
}, {
"choice": "Objective-C",
"votes": 512
}, {
"choice": "Ruby",
"votes": 256
}
]
}
]
### Create a New Question [POST]
You may create your own question using this action. It takes a JSON
object containing a question and a collection of answers in the
form of choices.
+ Request (application/json)
{
"question": "Favourite programming language?",
"choices": [
"Swift",
"Python",
"Objective-C",
"Ruby"
]
}
+ Response 201 (application/json)
+ Headers
Location: /questions/2
+ Body
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 0
}, {
"choice": "Python",
"votes": 0
}, {
"choice": "Objective-C",
"votes": 0
}, {
"choice": "Ruby",
"votes": 0
}
]
}
|
FORMAT: 1A
HOST: https://orgmanager.miguelpiedrafita.com/api
# Orgmanager API
The Orgmanager API allows you to integrate Orgmanager with other applications and projects.
## User Data [/user]
### Get user info [GET]
+ Response 200 (application/json)
{
"id":1,
"name":"Miguel Piedrafita",
"email":"[email protected]",
"github_username":"m1guelpf",
"created_at":"2017-01-25 18:44:32",
"updated_at":"2017-02-16 19:40:50"
}
## User Organizations [/user/orgs]
### Get user organizations [GET]
+ Response 200 (application/json)
{
"id":1,
"name":"Test Organization",
"url":"https:\/\/api.github.com\/orgs\/test-org",
"description":null,
"avatar":"https:\/\/miguelpiedrafita.com\/logo.png",
"invitecount":100
}
|
Add /user and /user/orgs api endpoints to api docs
|
:memo: Add /user and /user/orgs api endpoints to api docs
|
API Blueprint
|
mpl-2.0
|
orgmanager/orgmanager,orgmanager/orgmanager,orgmanager/orgmanager
|
04772b49f1cbffe9dbe276c3db8c09d5f1acdc28
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# fcdb-api
fcdb-api is a REST interace to the [Fossil Calibrations database](https://github.com/NESCent/FossilCalibrations)
# Group Calibrations
Calibrations related resources of the **fcdb-api**
## Calibrations Collection [/calibrations{?filter,clade,format}]
+ Parameters
+ filter (optional, string) ... Type of filter - currently supports age, include max= and min= for Ma ages.
+ clade (optional, string) ... Name of taxon identifying clade to search for calibrations in
+ format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json`
### Filter Calibrations [GET]
+ Response 200 (application/json)
[
{"id":1,"nodeName":"node1","nodeMinAge":0,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]},
{"id":2,"nodeName":"node2","nodeMinAge":10,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]}
]
## Calibration [/calibrations/{id}{?format}]
A single Calibration object with its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Calibration to perform action with.
+ format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json`
### Retrieve a Calibration [GET]
+ Response 200 (application/json)
{"id":1,"nodeName":"node1","nodeMinAge":0,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]}
|
FORMAT: 1A
HOST: http://fossilcalibrations.org/api/v1/
# fcdb-api
fcdb-api is a REST interace to the [Fossil Calibrations database](https://github.com/NESCent/FossilCalibrations)
# Group Calibrations
Calibrations related resources of the **fcdb-api**
## Calibrations Collection [/calibrations{?filter,clade,format}]
+ Parameters
+ filter (optional, string) ... Type of filter - currently supports age, include max= and min= for Ma ages.
+ clade (optional, string) ... Name of taxon identifying clade to search for calibrations in
+ format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json`
### Filter Calibrations [GET]
+ Response 200 (application/json)
[
{"id":1,"nodeName":"node1","nodeMinAge":0,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]},
{"id":2,"nodeName":"node2","nodeMinAge":10,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]}
]
## Calibration [/calibrations/{id}{?format}]
A single Calibration object with its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Calibration to perform action with.
+ format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json`
### Retrieve a Calibration [GET]
+ Response 200 (application/json)
{"id":1,"nodeName":"node1","nodeMinAge":0,"nodeMaxAge":20,"calibrationReference":"Smith, J 2014. Title","fossils":[],"tipPairs":[]}
|
Add HOST entry to get /api/v1
|
Add HOST entry to get /api/v1
|
API Blueprint
|
mit
|
NESCent/fcdb-api,NESCent/fcdb-api
|
18f2e7c8093622ab25a5614890ad0092f9951719
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# fiware-paas
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Notes
Notes related resources of the **Notes API**
## Notes Collection [/notes]
### Get the Abstract Environment list from the catalogue [GET]
+ Request
+ Headers
X-Auth-Token: 756cfb31e062216544215f54447e2716
Tenant-Id: your-tenant-id
+ Response 200 (application/json)
[
{
"tierDtos": [
{
"name": "tiernameqac",
"flavour": "2",
"image": "6e2519b8-1b36-4669-b6fe-ed2e77815b9f",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"icono": "",
"securityGroup": "",
"keypair": "default",
"floatingip": "false",
"affinity": "None",
"region": "Trento"
},
{
"name": "tier1",
"flavour": "2",
"image": "775761ba-67e5-4481-81f0-72eb04d0d13c",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "apache2",
"version": "1.10.5",
"attributes": {
"key": "listen_port",
"value": "80",
"type": "Plain"
},
"metatadas": [
{
"key": "image",
"value": ""
},
{
"key": "tenant_id",
"value": "00000000000000000000000000000129"
},
{
"key": "open_ports",
"value": "22 80"
},
{
"key": "cookbook_url",
"value": ""
},
{
"key": "cloud",
"value": "yes"
},
{
"key": "installator",
"value": "chef"
}
]
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
}
],
"name": "envTest11",
"description": "envTest desc"
},
{
"tierDtos": [
{
"name": "tiernameqac",
"flavour": "2",
"image": "6e2519b8-1b36-4669-b6fe-ed2e77815b9f",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"icono": "",
"securityGroup": "",
"keypair": "default",
"floatingip": "false",
"affinity": "None",
"region": "Trento"
},
{
"name": "testjesuspg",
"flavour": "2",
"image": "422128fe-02a2-44ca-b9a7-67ec69809e5e",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "mysql",
"version": "1.2.4",
"attributes": {
"key": "ssl_port",
"value": "8443",
"description": "The ssl listen port",
"type": "Plain"
},
"metatadas": [
{
"key": "nid",
"value": "855",
"description": "mysql nid"
},
{
"key": "installator",
"value": "chef",
"description": "ChefServer Recipe required"
}
]
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
}
],
"name": "envjesuspg",
"description": "desc"
},
{
"tierDtos": {
"name": "tier1",
"flavour": "2",
"image": "775761ba-67e5-4481-81f0-72eb04d0d13c",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "nodejs",
"version": "0.6.15",
"metatadas": {
"key": "installator",
"value": "chef",
"description": "ChefServer Recipe required"
}
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
},
"name": "envTest",
"description": "envTest desc"
},
{
"tierDtos": {
"name": "tier1",
"flavour": "2",
"image": "775761ba-67e5-4481-81f0-72eb04d0d13c",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "apache2",
"version": "1.10.5",
"attributes": {
"key": "listen_port",
"value": "80",
"type": "Plain"
},
"metatadas": [
{
"key": "image",
"value": ""
},
{
"key": "tenant_id",
"value": "00000000000000000000000000000129"
},
{
"key": "open_ports",
"value": "22 80"
},
{
"key": "cookbook_url",
"value": ""
},
{
"key": "cloud",
"value": "yes"
},
{
"key": "installator",
"value": "chef"
}
]
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
},
"name": "envTest1",
"description": "envTest desc"
}
]
### Create a Note [POST]
+ Request (application/json)
{ "title": "Buy cheese and bread for breakfast." }
+ Response 201 (application/json)
{ "id": 3, "title": "Buy cheese and bread for breakfast." }
## Note [/notes/{id}]
A single Note object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.
### Retrieve a Note [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{ "id": 2, "title": "Pick-up posters from post-office" }
### Remove a Note [DELETE]
+ Response 204
|
FORMAT: 1A
# fiware-paas
The PaaS Manager GE provides a new layer over the IaaS layer (Openstack) in the aim of easing the task of deploying applications on a Cloud infrastructure.
Therefore, it orchestrates the provisioning of the required virtual resources at IaaS level, and then, the installation and configuration of the whole software stack of the application by the SDC GE, taking into account the underlying virtual infrastructure.
It provides a flexible mechanism to perform the deployment, enabling multiple deployment architectures: everything in a single VM or server, several VMs or servers, or elastic architectures based on load balancers and different software tiers.
# API authentication
All the operations in the PaaS Manager API needs to have a valid token to access it.
To obtain the token, you need to have an account in FIWARE Lab (account.lab.fi-ware.org).
With the credentials (username, password and tenantName) you can obtain a valid token.
## Abstract Environment [/rest/catalog/org/{org}/environment]
### Get the Abstract Environment list from the catalogue [GET]
+ Parameters
+ org (required, string, `FIWARE`) ... Organizaton.
+ Request
+ Headers
X-Auth-Token: 756cfb31e062216544215f54447e2716
Tenant-Id: your-tenant-id
+ Response 200 (application/json)
[
{
"tierDtos": [
{
"name": "tiernameqac",
"flavour": "2",
"image": "6e2519b8-1b36-4669-b6fe-ed2e77815b9f",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"icono": "",
"securityGroup": "",
"keypair": "default",
"floatingip": "false",
"affinity": "None",
"region": "Trento"
},
{
"name": "tier1",
"flavour": "2",
"image": "775761ba-67e5-4481-81f0-72eb04d0d13c",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "apache2",
"version": "1.10.5",
"attributes": {
"key": "listen_port",
"value": "80",
"type": "Plain"
},
"metatadas": [
{
"key": "image",
"value": ""
},
{
"key": "tenant_id",
"value": "00000000000000000000000000000129"
},
{
"key": "open_ports",
"value": "22 80"
},
{
"key": "cookbook_url",
"value": ""
},
{
"key": "cloud",
"value": "yes"
},
{
"key": "installator",
"value": "chef"
}
]
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
}
],
"name": "envTest11",
"description": "envTest desc"
},
{
"tierDtos": [
{
"name": "tiernameqac",
"flavour": "2",
"image": "6e2519b8-1b36-4669-b6fe-ed2e77815b9f",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"icono": "",
"securityGroup": "",
"keypair": "default",
"floatingip": "false",
"affinity": "None",
"region": "Trento"
},
{
"name": "testjesuspg",
"flavour": "2",
"image": "422128fe-02a2-44ca-b9a7-67ec69809e5e",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "mysql",
"version": "1.2.4",
"attributes": {
"key": "ssl_port",
"value": "8443",
"description": "The ssl listen port",
"type": "Plain"
},
"metatadas": [
{
"key": "nid",
"value": "855",
"description": "mysql nid"
},
{
"key": "installator",
"value": "chef",
"description": "ChefServer Recipe required"
}
]
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
}
],
"name": "envjesuspg",
"description": "desc"
},
{
"tierDtos": {
"name": "tier1",
"flavour": "2",
"image": "775761ba-67e5-4481-81f0-72eb04d0d13c",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "nodejs",
"version": "0.6.15",
"metatadas": {
"key": "installator",
"value": "chef",
"description": "ChefServer Recipe required"
}
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
},
"name": "envTest",
"description": "envTest desc"
},
{
"tierDtos": {
"name": "tier1",
"flavour": "2",
"image": "775761ba-67e5-4481-81f0-72eb04d0d13c",
"maximumNumberInstances": 1,
"minimumNumberInstances": 1,
"initialNumberInstances": 1,
"productReleaseDtos": {
"productName": "apache2",
"version": "1.10.5",
"attributes": {
"key": "listen_port",
"value": "80",
"type": "Plain"
},
"metatadas": [
{
"key": "image",
"value": ""
},
{
"key": "tenant_id",
"value": "00000000000000000000000000000129"
},
{
"key": "open_ports",
"value": "22 80"
},
{
"key": "cookbook_url",
"value": ""
},
{
"key": "cloud",
"value": "yes"
},
{
"key": "installator",
"value": "chef"
}
]
},
"icono": "",
"securityGroup": "",
"keypair": "",
"floatingip": "false",
"affinity": "None",
"region": "Spain"
},
"name": "envTest1",
"description": "envTest desc"
}
]
+ Response 401 (application/json)
{ "errors":
[
{
"message": "Unauthorized",
"code": 401
}
]
}
### Create a Note [POST]
+ Request (application/json)
{ "title": "Buy cheese and bread for breakfast." }
+ Response 201 (application/json)
{ "id": 3, "title": "Buy cheese and bread for breakfast." }
## Note [/notes/{id}]
A single Note object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.
### Retrieve a Note [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{ "id": 2, "title": "Pick-up posters from post-office" }
### Remove a Note [DELETE]
+ Response 204
|
add GET environment abstract
|
add GET environment abstract
|
API Blueprint
|
apache-2.0
|
telefonicaid/fiware-paas,telefonicaid/fiware-paas,Fiware/cloud.PaaS,Fiware/cloud.PaaS,Fiware/cloud.PaaS,telefonicaid/fiware-paas
|
089d7da91a8c8207207061908c8850c13baeea1a
|
apiary.apib
|
apiary.apib
|
# Lion API
Lion is a basic localization service using `git` as the backend for storing translations.
## Request headers
All requests to Lion must include the following headers:
- `Lion-Api-Key`
- `Lion-Api-Secret`
- `Lion-Api-Version`
# Projects
## Project management [/project/{name}]
+ Parameters
+ name (required, string) ... Project name
### Get project [GET]
Fetch project details, given the projects' name.
+ Request (application/json)
+ Header
Lion-Api-Key: <YOUR_API_KEY>
Lion-Api-Secret: <YOUR_API_SECRET>
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"name": "Project name",
"resources": [
"resource1",
"..."
]
}
+ Response 401 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 403 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 404 (application/json)
+ Header
Lion-Api-Version: v1
|
# Lion API
Lion is a basic localization service using `git` as the backend for storing translations.
## Request headers
All requests to Lion must include the following headers:
- `Lion-Api-Key`
- `Lion-Api-Secret`
- `Lion-Api-Version`
# Group Projects
## Project management [/project/{name}]
+ Parameters
+ name (required, string) ... Project name
### Get project [GET]
Fetch project details, given the projects' name.
+ Request (application/json)
+ Header
Lion-Api-Key: <YOUR_API_KEY>
Lion-Api-Secret: <YOUR_API_SECRET>
Lion-Api-Version: v1
+ Response 200 (application/json)
+ Header
Lion-Api-Version: v1
+ Body
{
"name": "Project name",
"resources": [
"resource1",
"..."
]
}
+ Response 401 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 403 (application/json)
+ Header
Lion-Api-Version: v1
+ Response 404 (application/json)
+ Header
Lion-Api-Version: v1
|
Fix Apiary syntax requirements
|
Fix Apiary syntax requirements
|
API Blueprint
|
mit
|
sebdah/lion
|
70dfc73941e9c06f62d90cf11305a5f9c8b22972
|
apiary.apib
|
apiary.apib
|
FORMAT:alpha-1
HOST: https://aceofblades-bschmoker.c9users.io
# Ace of Blades
Take a regular deck and remove all face cards, leave only the ace of spades and numbered cards (37 total)
Start each player with starts with 5 cards from a shuffled deck
## The Choice
Each round, players choose a card value to play
> Multiple cards of different suits and identical value are treated as one card with no advantage or disadvantage to playing them
## The Showdown
Card values are compared and judged:
- Discard all cards of the lowest value
- If all cards are the same value, they are all discarded
- If the Ace of Spades was played, all cards are discarded
If either player has the Ace of Spades, they may play it and choose any card value to discard
> After playing the Ace, it transfers to the opposing player
## The Aftermath
After the showdown, both players draw a card from the shuffled deck
> Win by discarding your entire hand, or having the fewest cards when the draw pile is empty
## Starting a New Game [/new]
Create a new game for two players
+ Parameters
+ creator_id (required, number) - unique ID for player creating the game
+ rival_id (required, number) - unique ID for opponent player to challenge
### Start a new game [GET]
+ Response 200 (application/json)
{
"game_id": '42',
"player_id" : '31337',
"hand" : [ {value: '2', suit:'diamonds']
## Playing the Game [/play]
Make a move or check the current game state
### Show your Hand [GET]
Get the current hand for a specified player and game
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - Your player ID
+ Response 200 (application/json)
{
"game_id": '42',
"creator_id": '31337',
"rival_id": '8888',
"status": "active",
"hand" : {
"player_id" : '31337'
"cards": [ {value: '2', suit:'diamonds'}]
}
}
+ Response 401
player_id was invalid for the provided game_
### Play a Card [POST]
Choose a card value to play.
Until your opponent chooses their card for this round, you may update your choice
Playing the Ace of Spades lets you discard any card while *also* discarding your opponent's card
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - your unique player ID
+ card (required, number) - the card value you wish to play (suits are ignored)
+ ace (optional, boolean) - whether you want to play the ace of spades
+ Request (application/json)
{
"game_id": '42',
"player_id": '31337',
"card": '7'
}
+ Response 200 (application/json)
Once both players have chosen a card value, the server will resolve the round and update each player's hand
+ Response 401
player_id was invalid for the provided game_
+ Response 403
player_id did not have the selected card
|
FORMAT:alpha-1
HOST: https://aceofblades-bschmoker.c9users.io
# Ace of Blades
Take a regular deck and remove all face cards, leave only the ace of spades and numbered cards (37 total)
Start each player with starts with 5 cards from a shuffled deck
## The Choice
Each round, players choose a card value to play
> Multiple cards of different suits and identical value are treated as one card with no advantage or disadvantage to playing them
## The Showdown
Card values are compared and judged:
- Discard all cards of the lowest value
- If all cards are the same value, they are all discarded
- If the Ace of Spades was played, all cards are discarded
If either player has the Ace of Spades, they may play it and choose any card value to discard
> After playing the Ace, it transfers to the opposing player
## The Aftermath
After the showdown, both players draw a card from the shuffled deck
> Win by discarding your entire hand, or having the fewest cards when the draw pile is empty
## Starting a New Game [/new]
Create a new game for two players
+ Parameters
+ creator_id (required, number) - unique ID for player creating the game
+ rival_id (required, number) - unique ID for opponent player to challenge
### Start a new game [GET]
+ Response 200 (application/json)
{
"game_id": '42',
"player_id" : '31337',
"hand" : {
"player_id" : '31337'
"cards": [ {value: '2', suit:'diamonds'}]
}
## Playing the Game [/play]
Make a move or check the current game state
### Show your Hand [GET]
Get the current hand for a specified player and game
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - Your player ID
+ Response 200 (application/json)
{
"game_id": '42',
"creator_id": '31337',
"rival_id": '8888',
"status": "active",
"hand" : {
"player_id" : '31337'
"cards": [ {value: '2', suit:'diamonds'}]
}
}
+ Response 401
player_id was invalid for the provided game_
### Play a Card [POST]
Choose a card value to play
This choice can be freely changed until both playeres have chosen their card for this round
Choosing to play the Ace of Spades will discard any card value while *also* discarding the opponent's card(s)
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - your unique player ID
+ card (required, number) - the card value you wish to play (suits are ignored)
+ ace (optional, boolean) - whether you want to play the ace of spades
+ Request (application/json)
{
"game_id": '42',
"player_id": '31337',
"card": '7'
}
+ Response 200 (application/json)
Once both players have chosen a card value, the server resolves the showdown and updates each player's hand
+ Response 401
player_id was invalid for the provided game_
+ Response 403
player_id does not have the selected card
|
update api spec
|
update api spec
|
API Blueprint
|
mit
|
bschmoker/aceofblades,bschmoker/highnoon
|
57758c1d6dd6765de3780015ba06fb65e4a73f62
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://travellerct.pudiga.org/api/v1
# TravellerCT (v1) API
Travellerct is a simple API for generating and managing Classic Traveller (CT) role playing game data.
> **Note** to render this API documentation as HTML from the source blueprint (.apib) file use `aglio --theme-variables slate -i apiary.apib -o apiary.html`.
# Group Characters
Resources related to player and non-player characters. Provides for the
* automatic generation or character data for non-player characters (NPC),
* storage of pre-generated character data for players,
* update and deletion of stored character data,
* and retrieval of all character data in bulk as well as indavidually for generation of character data sheets.
<table>
<tr>
<th>URL</th><th>GET<br>read</th><th>POST<br>create</th><th>PUT<br>update</th><th>DELETE</th>
</tr>
<tr>
<td>/characters</td><td>Returns a list of characters</td><td>Create a new character</td><td>(405)</td><td>(405)</td>
<tr>
<td>/characters/711</td><td>Returns a specific character</td><td>(405)</td><td>Updates a specific character</td><td>Deletes a specific character</td>
</tr>
</table>
## Character Collection [/characters]
### List All Characters [GET]
List full detail on all characters.
The universal personality profile (UPP) is represented by an integer from 1 to 15.
+ Response 200 (application/json)
+ Attributes (array[Character])
### Generate a New Character [POST]
You may generate new characters using this action.
This action takes a JSON payload, specifying the name of the character, as part of the request.
The response header contains the location of the newly generated character.
The response body contains full character data;
* new unique character_id,
* name given in the request,
* a noble title based on the character's social standing,
* randomly generated (2D roll) universal personality profile (UPP) with initial values from 2 to 12.
+ Request (application/json)
{
"name": "El Barto"
}
+ Response 201 (application/json)
+ Headers
Location: /characters/2
+ Body
{
"character_id": 2
"name": "El Barto",
"title": "Duke",
"strength": 8,
"dexterity": 8,
"endurance": 8,
"intelligence": 8,
"education": 8,
"social": 14
}
## Character [/characters/{character_id}]
+ Parameters
+ character_id (number) - ID of the Character in the form of an integer.
### View a Character's Detail [GET]
+ Response 200 (application/json)
{
"character_id": 2
"name": "El Barto",
"title": "Duke",
"strength": 8,
"dexterity": 8,
"endurance": 8,
"intelligence": 8,
"education": 8,
"social": 14
}
### Update a Character's Detail [PUT]
+ Parameters
+ character_id (number) - ID of the Character in the form of an integer
+ Response 200 (application/json)
{
"character_id": 2
"name": "El Barto",
"title": "Duke",
"strength": 8,
"dexterity": 8,
"endurance": 8,
"intelligence": 8,
"education": 8,
"social": 14
}
### Delete a Character [DELETE]
+ Parameters
+ character_id (number) - ID of the Character in the form of an integer
+ Response 204 (application/json)
# Data Structures
## Character (object)
+ character_id: 2 (number, required) - The unique identifier for a character.
+ name: El Barto (string, required) - Name of the character.
+ title: Duke (string) - Hereditary title.
+ strength: 8 (number) - Strength is both a general evaluation of the character's physical ability, and a specific measure of force which may be applied.
+ dexterity: 8 (number) - Dexterity measures physical coordination.
+ endurance: 8 (number) - Endurance measures physical determination and stamina.
+ intelligence: 8 (number) - Intelligence corresponds to IQ.
+ education: 8 (number) - Education indicates the highest level of schooling attained.
+ social: 14 (number) - Social Standing notes the social class and level of society from which the character comes.
|
FORMAT: 1A
HOST: http://travellerct.pudiga.org/api/v1
# TravellerCT (v1) API
Travellerct is a simple API for generating and managing Classic Traveller (CT) role playing game data.
> **Note** to render this API documentation as HTML from the source blueprint (.apib) file use `aglio --theme-variables slate -i apiary.apib -o apiary.html`.
# Group Characters
Resources related to player and non-player characters. Provides for the
* automatic generation or character data for non-player characters (NPC),
* storage of pre-generated character data for players,
* update and deletion of stored character data,
* and retrieval of all character data in bulk as well as indavidually for generation of character data sheets.
<table>
<tr>
<th>URL</th><th>GET<br>read</th><th>POST<br>create</th><th>PUT<br>update</th><th>DELETE</th>
</tr>
<tr>
<td>/characters</td><td>Returns a list of characters</td><td>Create a new character</td><td>(405)</td><td>(405)</td>
<tr>
<td>/characters/711</td><td>Returns a specific character</td><td>(405)</td><td>Updates a specific character</td><td>Deletes a specific character</td>
</tr>
</table>
## Character Collection [/characters]
### List All Characters [GET]
List full detail on all characters.
The universal personality profile (UPP) is represented by an integer from 1 to 15.
+ Response 200 (application/json)
+ Attributes (array[Character])
### Generate a New Character [POST]
You may generate new characters using this action.
This action takes a JSON payload, specifying the name of the character, as part of the request.
The response header contains the location of the newly generated character.
The response body contains full character data;
* new unique character_id,
* name given in the request,
* a noble title based on the character's social standing,
* randomly generated (2D roll) universal personality profile (UPP) with initial values from 2 to 12.
+ Request (application/json)
{
"name": "El Barto"
}
+ Response 201 (application/json)
+ Headers
Location: /characters/2
+ Body
{
"character_id": 2
"name": "El Barto",
"title": "Duke",
"strength": 8,
"dexterity": 8,
"endurance": 8,
"intelligence": 8,
"education": 8,
"social": 14
}
## Character [/characters/{character_id}]
+ Parameters
+ character_id (number) - ID of the Character in the form of an integer.
### View a Character's Detail [GET]
+ Response 200 (application/json)
{
"character_id": 2
"name": "El Barto",
"title": "Duke",
"strength": 8,
"dexterity": 8,
"endurance": 8,
"intelligence": 8,
"education": 8,
"social": 14
}
### Update a Character's Detail [PUT]
+ Parameters
+ character_id (number) - ID of the Character in the form of an integer
+ Response 200 (application/json)
{
"character_id": 2
"name": "El Barto",
"title": "Duke",
"strength": 8,
"dexterity": 8,
"endurance": 8,
"intelligence": 8,
"education": 8,
"social": 14
}
### Delete a Character [DELETE]
+ Parameters
+ character_id (number) - ID of the Character in the form of an integer
+ Response 204 (application/json)
# Data Structures
## Character (object)
+ character_id: 2 (number, required) - The unique identifier for a character.
+ name: El Barto (string, required) - Name of the character.
+ age: 8 (number, required) - Age of the character.
+ title: Duke (string) - Hereditary title.
+ strength: 8 (number, required) - Strength is both a general evaluation of the character's physical ability, and a specific measure of force which may be applied.
+ dexterity: 8 (number, required) - Dexterity measures physical coordination.
+ endurance: 8 (number, required) - Endurance measures physical determination and stamina.
+ intelligence: 8 (number, required) - Intelligence corresponds to IQ.
+ education: 8 (number, required) - Education indicates the highest level of schooling attained.
+ social: 14 (number, required) - Social Standing notes the social class and level of society from which the character comes.
|
Add required restriction
|
Add required restriction
|
API Blueprint
|
apache-2.0
|
eggplantpasta/travellerct,eggplantpasta/travellerct
|
7c2a24d037e28d4ffd5321786d568011f59b284b
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# TicketPrint
Ticketprint is a simple API allowing consumers to trigger print jobs of tickets.
## Tickets [/api/ticket/{id}]
+ Parameters
+ id (required, string, `ABC-123`) ... AlphaNumeric `id` of the Ticket to perform action with. Has example value.
### Get a Ticket [GET]
+ Response 200 (application/json)
{
"id": "ABC-123",
"title": "Hello Title"
}
## Print Jobs [/api/print]
### Create a new Print Job [POST]
Just send a JSON object with ... to trigger a print job
+ Request (application/json)
{
"id": "ABC-123",
"format": 2,
"target": "it",
}
+ Response 200 (application/json)
|
FORMAT: 1A
HOST: https://tox-ticketprint.herokuapp.com/
# TicketPrint
TicketPrint is a simple API allowing consumers to trigger print jobs of tickets.
## Tickets [/api/ticket/{id}]
+ Parameters
+ id (required, string, `ABC-123`) ... AlphaNumeric `id` of the Ticket to perform action with. Has example value.
### Get a Ticket [GET]
+ Response 200 (application/json)
{
"id": "ABC-123",
"title": "Hello Title"
}
## Print Jobs [/api/print]
### Create a new Print Job [POST]
Just send a JSON object with ... to trigger a print job
+ Request (application/json)
{
"id": "ABC-123",
"format": 2,
"target": "it",
}
+ Response 200 (application/json)
|
edit apiary
|
edit apiary
|
API Blueprint
|
mit
|
dasrick/tox-ticketprint-ui,dasrick/tox-ticketprint-ui
|
2b4ef585e1c937f779ab5e74f31f715078fffcd8
|
salesviewer-api.apib
|
salesviewer-api.apib
|
FORMAT: 1A
HOST: https://www.salesviewer.com/api
# SalesViewer API
SalesViewer API is a simple API allowing consumers to sessions and website interactions of their website.
## Authentication
This API uses Custom Query Parameter for its authentication.
The parameters that are needed to be sent for this type of authentication are as follows:
+ `apiKey` - Authentication for each request with api key in query.
# Group sessions
## SessionsJson [/sessions.json{?from,to,timezone,locale,page,pageSize,includeHidden,includeCompany,includeCompanySector,includeVisits,query}]
### getSessionsJSON [GET]
List visitor sessions based on filter
+ Parameters
+ from (string, optional) -
Starting DateTime (any valid DateTime [e.g. RFC3339], relative values [-30 days, -10 Minutes] or UNIX-Timestamps): `-1 year`, `-30 days`, `now`, `2017-02-01`, `2017-02-01 22:30:15`, `1985-04-12T23:20:50.52Z`, `1996-12-19T16:39:57-08:00`, `1937-01-01T12:00:27.87+00:20`
+ Default: -30 days
+ to (string, optional) -
Ending DateTime (see `from`-paramter)
+ Default: now
+ timezone (string, optional) -
Timezone of input and output DateTimes [see List of Timezones](https://www.w3schools.com/php/php_ref_timezones.asp)
+ Default: Europe/Berlin
+ locale (string, optional) -
A valid linux system locale [see List of Locales](https://docs.moodle.org/dev/Table_of_locales#Table)
+ Default: de-DE
+ page (number, optional) -
Selected result page
+ Default: 1
+ pageSize (number, optional) -
Number of entries per page
+ Default: 100
+ includeHidden (boolean, optional) -
Include frontend-hidden companies
+ Default: False
+ includeCompany (boolean, optional) -
Include company-details
+ Default: True
+ includeCompanySector (boolean, optional) -
Include company-sector (Note applies only if `includeCompany`-paramter is `true`)
+ Default: True
+ includeVisits (boolean, optional) -
Include visits details
+ Default: True
+ query (string, optional)
An RQL (__R__esource __Q__uery __L__anguage) formatted query. __Available fields__ are a _superset_ of Session-Object (see model definitions), with dot as field separator (e.g. `sesssion.visits.url`) _Syntax documentation_ see * [RQL Standard](https://doc.apsstandard.org/2.1/spec/rql/) * [Persvr/RQL Github](https://github.com/persvr/rql)
__Example__ ``` session.duration>='00:00:50' & count(session.visits)=4 ``` _Hint URL parameters should be URL-Encoded_
+ Response 200 (application/json)
sessions response
+ Attributes (GetSessionsResponse)
+ Response 400
Bad Request - see Error
+ Response 401
Not authenticated by apiKey as query-parameter or header-value.
+ Response 403
Authentication wrong or project selection error
+ Response 429
Rate limiting (see headers)
+ Response 0
see X-Error-Description header or errorDescription in answer
## SessionsJson [/sessions.json]
### postSessionsJSON [POST]
List visitor sessions based on filter
+ Attributes
+ from (string, optional) -
Starting DateTime (any valid DateTime [e.g. RFC3339], relative values [-30 days, -10 Minutes] or UNIX-Timestamps) e.g. * `-1 year` * `-30 days` * `now` * `2017-02-01` * `2017-02-01 22:30:15` * `1985-04-12T23:20:50.52Z` * `1996-12-19T16:39:57-08:00` * `1937-01-01T12:00:27.87+00:20`
+ Default: -30 days
+ to (string, optional) -
Ending DateTime (see `from`-paramter)
+ Default: now
+ timezone (string, optional) -
Timezone of input and output DateTimes [see List of Timezones](https://www.w3schools.com/php/php_ref_timezones.asp)
+ Default: Europe/Berlin
+ locale (string, optional) -
A valid linux system locale [see List of Locales](https://docs.moodle.org/dev/Table_of_locales#Table)
+ Default: de-DE
+ page (number, optional) -
Selected result page
+ Default: 1
+ pageSize (number, optional) -
Number of entries per page
+ Default: 100
+ includeHidden (boolean, optional) -
Include frontend-hidden companies
+ Default: False
+ includeCompany (boolean, optional) -
Include company-details
+ Default: True
+ includeCompanySector (boolean, optional) -
Include company-sector (Note applies only if `includeCompany`-paramter is `true`)
+ Default: True
+ includeVisits (boolean, optional) -
Include visits details
+ Default: True
+ query (string, optional)
An RQL (__R__esource __Q__uery __L__anguage) formatted query. __Available fields__ are a _nearly-equal subset_ of Session-Object (see model definitions), with dot as field separator (e.g. `sesssion.visits.url`) _Syntax documentation_ see * [RQL Standard](https://doc.apsstandard.org/2.1/spec/rql/) * [Persvr/RQL Github](https://github.com/persvr/rql)
__Example__ ``` session.duration>='00:00:50' & count(session.visits)=4 ``` _Hint URL parameters should be URL-Encoded_
+ Request (application/x-www-form-urlencoded)
+ Response 200 (application/json)
sessions response
+ Attributes (GetSessionsResponse)
+ Response 400
Bad Request - see Error
+ Response 401
Not authenticated by apiKey as query-parameter or header-value.
+ Response 403
Authentication wrong or project selection error
+ Response 429
Rate limiting (see headers)
+ Response 0
see X-Error-Description header or errorDescription in answer
# Data Structures
## PaginatedResult (object)
### Properties
+ `pagination` (ResultPagination, required)
## ResultPagination (object)
### Properties
+ `total` (number, required) - Number of total entries
+ `isFirst` (boolean, required) - Current page is first page
+ `current` (number, required) - Current page number (1-based)
+ `isLast` (boolean, required) - Current page is last page
+ `pageSize` (number, required) - Size (=number of entries) of each page
## ErrorResponse (object)
### Properties
+ `error` (boolean, optional) - Indicated that it' an error
+ `errorDescription` (string, optional) - Error description
+ `errorType` (string, optional) - Error type
## CompanySector (object)
### Properties
+ `id` (number, required) - ID of sector
+ `name` (string, required) - Name of sector
## GetSessionsResponse (PaginatedResult)
### Properties
+ `totals` (GetSessionsResultTotals, required)
+ `result` (array[Session], optional) - Array of `Session`
## GetSessionsResultTotals (object)
### Properties
+ `sessions` (number, required) - Total number of unique sessions
+ `companies` (number, required) - Total number of unique companies
+ `visits` (number, required) - Total number of page visits
+ `interest_visits` (number, required) - Total number of page visits which triggered interest
+ `interests` (number, required) - Total number of interests triggered
## Session (object)
### Properties
+ `guid` (string, required) - UUID of Session
+ `startedAt_ts_server` (string, required) - Session started at UNIX-Time
+ `startedAt` (string, required) - Session started at (in given timezone)
+ `lastActivityAt_ts_server` (string, required) - Session last activity at UNIX-Time
+ `lastActivityAt` (string, required) - Session last activity at (in given timezone)
+ `duration` (string, required) - Duration of session in TIME format (Rfc3339 time components)
+ `duration_secs` (number, required) - Duration of session in seconds
+ `language` (string, required) - Session language/locale
+ `isCustomer` (string, required)
+ `company` (Company, optional)
+ `visits` (array[SessionVisit], optional) - Session visits of this session. NOTE: if `includeVisits`-parameter set to `false`, result won't contain visits field.
## Company (object)
### Properties
+ `id` (string, required) - ID of company
+ `street` (string, optional) - Street of company
+ `zip` (string, optional) - Zip of company
+ `name` (string, optional) - Name of company
+ `phone` (string, optional) - Phone of company
+ `email` (string, optional) - E-Mail address of company
+ `city` (string, optional) - City of company
+ `latitude` (number, optional) - Geographical latitude of company's address
+ `longitude` (number, optional) - Geographical longitude of company's address
+ `url` (string, optional) - URL of company's website
+ `countyCode` (string, optional) - Country code in (ISO 3166 Alpha 2) format (e.g. `DE`)
+ `countyCode3` (string, optional) - Country code in (ISO 3166 Alpha 3) format (e.g. `DEU`)
+ `isCustomer` (boolean, optional) - Indicates if company is marked as customer
+ `isFavorite` (boolean, optional) - Indicates if company is marked as favorite
+ `isCompetitor` (boolean, optional) - Indicates if company is marked as competitor
+ `sector` (CompanySector, optional)
## SessionVisit (object)
### Properties
+ `id` (number, required) - UUID of Session visit
+ `startedAt_ts_server` (string, required) - Session visit started at UNIX-Time
+ `startedAt` (string, required) - Session visit started at (in given timezone)
+ `lastActivityAt_ts_server` (string, required) - Session visit last activity at UNIX-Time
+ `lastActivityAt` (string, required) - Session visit last activity at (in given timezone)
+ `duration` (string, required) - Duration of session visit in TIME format (Rfc3339 time components)
+ `duration_secs` (number, required) - Duration of session visit in seconds
+ `url` (string, required) - URL of the session visit
+ `refererMedium` (string, required) - Referer parsed `medium`-component
+ `numEvents` (number, required) - Number of events collected during website session
+ `referer` (string, optional) - Referer URL of the session visit
+ `refererSource` (string, optional) - Referer parsed `source`-component
+ `refererTerm` (string, optional) - Referer parsed `term`-component
|
FORMAT: 1A
HOST: https://www.salesviewer.com/api
# SalesViewer API
SalesViewer API is a simple API allowing consumers to sessions and website interactions of their website.
## Authentication
This API uses Custom Query Parameter for its authentication.
The parameters that are needed to be sent for this type of authentication are as follows:
+ `apiKey` - Authentication for each request with api key in query.
# Group sessions
## SessionsJson [/sessions.json{?from,to,timezone,locale,page,pageSize,includeHidden,includeCompany,includeCompanySector,includeVisits,query}]
### getSessionsJSON [GET]
List visitor sessions based on filter
+ Parameters
+ from (string, optional) -
Starting DateTime (any valid DateTime [e.g. RFC3339], relative values [-30 days, -10 Minutes] or UNIX-Timestamps): `-1 year`, `-30 days`, `now`, `2017-02-01`, `2017-02-01 22:30:15`, `1985-04-12T23:20:50.52Z`, `1996-12-19T16:39:57-08:00`, `1937-01-01T12:00:27.87+00:20`
+ Default: -30 days
+ to (string, optional) -
Ending DateTime (see `from`-paramter)
+ Default: now
+ timezone (string, optional) -
Timezone of input and output DateTimes [see List of Timezones](https://www.w3schools.com/php/php_ref_timezones.asp)
+ Default: Europe/Berlin
+ locale (string, optional) -
A valid linux system locale [see List of Locales](https://docs.moodle.org/dev/Table_of_locales#Table)
+ Default: de-DE
+ page (number, optional) -
Selected result page
+ Default: 1
+ pageSize (number, optional) -
Number of entries per page
+ Default: 100
+ includeHidden (boolean, optional) -
Include frontend-hidden companies
+ Default: false
+ includeCompany (boolean, optional) -
Include company-details
+ Default: true
+ includeCompanySector (boolean, optional) -
Include company-sector (Note applies only if `includeCompany`-paramter is `true`)
+ Default: true
+ includeVisits (boolean, optional) -
Include visits details
+ Default: true
+ query (string, optional)
An RQL (__R__esource __Q__uery __L__anguage) formatted query. __Available fields__ are a _superset_ of Session-Object (see model definitions), with dot as field separator (e.g. `sesssion.visits.url`) _Syntax documentation_ see * [RQL Standard](https://doc.apsstandard.org/2.1/spec/rql/) * [Persvr/RQL Github](https://github.com/persvr/rql)
__Example__ ``` session.duration>='00:00:50' & count(session.visits)=4 ``` _Hint URL parameters should be URL-Encoded_
+ Response 200 (application/json)
sessions response
+ Attributes (GetSessionsResponse)
+ Response 400
Bad Request - see Error
+ Response 401
Not authenticated by apiKey as query-parameter or header-value.
+ Response 403
Authentication wrong or project selection error
+ Response 429
Rate limiting (see headers)
+ Response 0
see X-Error-Description header or errorDescription in answer
## SessionsJson [/sessions.json]
### postSessionsJSON [POST]
List visitor sessions based on filter
+ Attributes
+ from (string, optional) -
Starting DateTime (any valid DateTime [e.g. RFC3339], relative values [-30 days, -10 Minutes] or UNIX-Timestamps) e.g. * `-1 year` * `-30 days` * `now` * `2017-02-01` * `2017-02-01 22:30:15` * `1985-04-12T23:20:50.52Z` * `1996-12-19T16:39:57-08:00` * `1937-01-01T12:00:27.87+00:20`
+ Default: -30 days
+ to (string, optional) -
Ending DateTime (see `from`-paramter)
+ Default: now
+ timezone (string, optional) -
Timezone of input and output DateTimes [see List of Timezones](https://www.w3schools.com/php/php_ref_timezones.asp)
+ Default: Europe/Berlin
+ locale (string, optional) -
A valid linux system locale [see List of Locales](https://docs.moodle.org/dev/Table_of_locales#Table)
+ Default: de-DE
+ page (number, optional) -
Selected result page
+ Default: 1
+ pageSize (number, optional) -
Number of entries per page
+ Default: 100
+ includeHidden (boolean, optional) -
Include frontend-hidden companies
+ Default: false
+ includeCompany (boolean, optional) -
Include company-details
+ Default: true
+ includeCompanySector (boolean, optional) -
Include company-sector (Note applies only if `includeCompany`-paramter is `true`)
+ Default: true
+ includeVisits (boolean, optional) -
Include visits details
+ Default: true
+ query (string, optional)
An RQL (__R__esource __Q__uery __L__anguage) formatted query. __Available fields__ are a _nearly-equal subset_ of Session-Object (see model definitions), with dot as field separator (e.g. `sesssion.visits.url`) _Syntax documentation_ see * [RQL Standard](https://doc.apsstandard.org/2.1/spec/rql/) * [Persvr/RQL Github](https://github.com/persvr/rql)
__Example__ ``` session.duration>='00:00:50' & count(session.visits)=4 ``` _Hint URL parameters should be URL-Encoded_
+ Request (application/x-www-form-urlencoded)
+ Response 200 (application/json)
sessions response
+ Attributes (GetSessionsResponse)
+ Response 400
Bad Request - see Error
+ Response 401
Not authenticated by apiKey as query-parameter or header-value.
+ Response 403
Authentication wrong or project selection error
+ Response 429
Rate limiting (see headers)
+ Response 0
see X-Error-Description header or errorDescription in answer
# Data Structures
## PaginatedResult (object)
### Properties
+ `pagination` (ResultPagination, required)
## ResultPagination (object)
### Properties
+ `total` (number, required) - Number of total entries
+ `isFirst` (boolean, required) - Current page is first page
+ `current` (number, required) - Current page number (1-based)
+ `isLast` (boolean, required) - Current page is last page
+ `pageSize` (number, required) - Size (=number of entries) of each page
## ErrorResponse (object)
### Properties
+ `error` (boolean, optional) - Indicated that it' an error
+ `errorDescription` (string, optional) - Error description
+ `errorType` (string, optional) - Error type
## CompanySector (object)
### Properties
+ `id` (number, required) - ID of sector
+ `name` (string, required) - Name of sector
## GetSessionsResponse (PaginatedResult)
### Properties
+ `totals` (GetSessionsResultTotals, required)
+ `result` (array[Session], optional) - Array of `Session`
## GetSessionsResultTotals (object)
### Properties
+ `sessions` (number, required) - Total number of unique sessions
+ `companies` (number, required) - Total number of unique companies
+ `visits` (number, required) - Total number of page visits
+ `interest_visits` (number, required) - Total number of page visits which triggered interest
+ `interests` (number, required) - Total number of interests triggered
## Session (object)
### Properties
+ `guid` (string, required) - UUID of Session
+ `startedAt_ts_server` (string, required) - Session started at UNIX-Time
+ `startedAt` (string, required) - Session started at (in given timezone)
+ `lastActivityAt_ts_server` (string, required) - Session last activity at UNIX-Time
+ `lastActivityAt` (string, required) - Session last activity at (in given timezone)
+ `duration` (string, required) - Duration of session in TIME format (Rfc3339 time components)
+ `duration_secs` (number, required) - Duration of session in seconds
+ `language` (string, required) - Session language/locale
+ `isCustomer` (string, required)
+ `company` (Company, optional)
+ `visits` (array[SessionVisit], optional) - Session visits of this session. NOTE: if `includeVisits`-parameter set to `false`, result won't contain visits field.
## Company (object)
### Properties
+ `id` (string, required) - ID of company
+ `street` (string, optional) - Street of company
+ `zip` (string, optional) - Zip of company
+ `name` (string, optional) - Name of company
+ `phone` (string, optional) - Phone of company
+ `email` (string, optional) - E-Mail address of company
+ `city` (string, optional) - City of company
+ `latitude` (number, optional) - Geographical latitude of company's address
+ `longitude` (number, optional) - Geographical longitude of company's address
+ `url` (string, optional) - URL of company's website
+ `countyCode` (string, optional) - Country code in (ISO 3166 Alpha 2) format (e.g. `DE`)
+ `countyCode3` (string, optional) - Country code in (ISO 3166 Alpha 3) format (e.g. `DEU`)
+ `isCustomer` (boolean, optional) - Indicates if company is marked as customer
+ `isFavorite` (boolean, optional) - Indicates if company is marked as favorite
+ `isCompetitor` (boolean, optional) - Indicates if company is marked as competitor
+ `sector` (CompanySector, optional)
## SessionVisit (object)
### Properties
+ `id` (number, required) - UUID of Session visit
+ `startedAt_ts_server` (string, required) - Session visit started at UNIX-Time
+ `startedAt` (string, required) - Session visit started at (in given timezone)
+ `lastActivityAt_ts_server` (string, required) - Session visit last activity at UNIX-Time
+ `lastActivityAt` (string, required) - Session visit last activity at (in given timezone)
+ `duration` (string, required) - Duration of session visit in TIME format (Rfc3339 time components)
+ `duration_secs` (number, required) - Duration of session visit in seconds
+ `url` (string, required) - URL of the session visit
+ `refererMedium` (string, required) - Referer parsed `medium`-component
+ `numEvents` (number, required) - Number of events collected during website session
+ `referer` (string, optional) - Referer URL of the session visit
+ `refererSource` (string, optional) - Referer parsed `source`-component
+ `refererTerm` (string, optional) - Referer parsed `term`-component
|
Update from current apiary
|
Update from current apiary
|
API Blueprint
|
mit
|
SalesViewer/salesviewer-api,SalesViewer/salesviewer-api,SalesViewer/salesviewer-api,SalesViewer/salesviewer-api
|
a88cc8253fca58b83a81d218611c64732fd7759d
|
ELEVATION-SERVICE-API-BLUEPRINT.apib
|
ELEVATION-SERVICE-API-BLUEPRINT.apib
|
FORMAT: 1A
HOST: https://elevation.weather.mg
# Elevation Service
### Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `elevation`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/master/authorization/Authentication.md)
### Get elevation for single point [GET /elevation?locatedAt={singlePoint}]
+ Request
+ Headers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE
+ Parameters
+ locatedAt: `10.041,22.409` (string, required) - longitude,latitude;
+ Response 200 (application/json)
Returns elevation for single Lon/Lat point
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "670"
},
"geometry": {
"type": "Point",
"coordinates": [
10.041000366,
22.409000397
]
}
}
]
}
### Get elevation for compressed points [GET /elevation?locatedAt={compressedPoints}]
+ Request
+ Headers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE
+ Parameters
+ locatedAt: `j-h6z-6rvBj19wwt1pwHysgn9xou4FlxjuglztmDoszr_ylwqD` (string, required) - compressed points;
+ Response 200 (application/json)
Returns elevations for compressed points in the same order as they were requested
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "438"
},
"geometry": {
"type": "Point",
"coordinates": [
35.432941437,
15.598409653
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "0"
},
"geometry": {
"type": "Point",
"coordinates": [
129.721343994,
36.248039246
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "96"
},
"geometry": {
"type": "Point",
"coordinates": [
40.656719208,
47.881080627
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "gtopo",
"elevationInMeter": "668"
},
"geometry": {
"type": "Point",
"coordinates": [
96.525482178,
67.051452637
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "41"
},
"geometry": {
"type": "Point",
"coordinates": [
78.036361694,
9.021289825
]
}
}
]
}
|
FORMAT: 1A
HOST: https://elevation.weather.mg
# Elevation Service
### Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `elevation`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/master/authorization/Authentication.md)
### Get elevation for single point [GET /elevation?locatedAt={singlePoint}&elevationDataSource={dataSource}]
+ Request
+ Headers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE
+ Parameters
+ locatedAt: `10.041,22.409` (string, required) - longitude,latitude;
+ elevationDataSource: `srtm` (string, optional) - data source, where to get elevation; there can be used 'srtm' or 'gtopo'
+ Response 200 (application/json)
Returns elevation for single Lon/Lat point
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "670"
},
"geometry": {
"type": "Point",
"coordinates": [
10.041000366,
22.409000397
]
}
}
]
}
### Get elevation for compressed points [GET /elevation?locatedAt={compressedPoints}&elevationDataSource={dataSource}]
+ Request
+ Headers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE
+ Parameters
+ locatedAt: `j-h6z-6rvBj19wwt1pwHysgn9xou4FlxjuglztmDoszr_ylwqD` (string, required) - compressed points;
+ elevationDataSource: `srtm` (string, optional) - data source, where to get elevation; there can be used 'srtm' or 'gtopo'
+ Response 200 (application/json)
Returns elevations for compressed points in the same order as they were requested
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "438"
},
"geometry": {
"type": "Point",
"coordinates": [
35.432941437,
15.598409653
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "0"
},
"geometry": {
"type": "Point",
"coordinates": [
129.721343994,
36.248039246
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "96"
},
"geometry": {
"type": "Point",
"coordinates": [
40.656719208,
47.881080627
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "gtopo",
"elevationInMeter": "668"
},
"geometry": {
"type": "Point",
"coordinates": [
96.525482178,
67.051452637
]
}
},
{
"type": "Feature",
"properties": {
"elevationDataSource": "srtm",
"elevationInMeter": "41"
},
"geometry": {
"type": "Point",
"coordinates": [
78.036361694,
9.021289825
]
}
}
]
}
|
Add info about 'elevationDataSource' parameter into ELEVATION-API-BLUEPRINT.
|
Add info about 'elevationDataSource' parameter into ELEVATION-API-BLUEPRINT.
|
API Blueprint
|
apache-2.0
|
MeteoGroup/weather-api,MeteoGroup/weather-api
|
37b044f60c7159d5d25e587a46256116d009979a
|
BLUEPRINT.apib
|
BLUEPRINT.apib
|
HOST: http://api.bushfir.es/
# Fire incidents API
An API to current and previous [RFS](http://www.rfs.nsw.gov.au) major incidents.
# GET /incidents
Retrieve a collection of incidents which may or may not be filtered by parameters included in the request.
+ Parameters
+ current = `true` (optional, boolean) ... Boolean value indicating whether to only include current incidents or not.
+ Response 200 (application/json)
JSON conforming to the GeoJSON spec. Response is a feature collection containing 0 or more features. Each feature represents an incident. Properties included in the feature object are taken from the incident's most recent report.
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "0ee1fd01-11bc-4526-8910-5423e63e898c",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
151.6034,
-33.1567
]
}
]
},
"properties": {
"reportUuid": "16d9c09c-aba0-47ce-964f-01aa75b1af10",
"guid": "tag:www.rfs.nsw.gov.au,2013-12-31:84431",
"title": "Crangan Bay -West",
"link": "http://www.rfs.nsw.gov.au/dsp_content.cfm?cat_id=683",
"category": "Advice",
"pubdate": "2013-12-31T05:00:00Z",
"firstSeen": "2013-11-30T06:48:00Z",
"lastSeen": "2013-12-31T05:00:00Z",
"alertLevel": "Advice",
"location": "500 metres west of Pacific Hwy at Crangan Bay. Same location as previous Incident - No 13113083624.",
"councilArea": "Lake Macquarie",
"status": "under control",
"fireType": "Scrub fire",
"fire": true,
"size": "0 ha",
"responsibleAgency": "Rural Fire Service",
"extra": ""
}
},
{
"type": "Feature",
"id": "176a2772-2589-4fa5-bb21-16af5bcd69fc",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
145.9021,
-30.0348
]
},
{
"type": "MultiPolygon",
"coordinates": [
[
[
[
145.9009,
-30.0399
],
[
145.8996,
-30.041
],
[
145.8989,
-30.0391
],
[
145.8989,
-30.039
],
[
145.9003,
-30.0366
],
[
145.8992,
-30.0351
],
[
145.8993,
-30.0342
],
[
145.9,
-30.0329
],
[
145.9013,
-30.0312
],
[
145.9024,
-30.0305
],
[
145.9023,
-30.0296
],
[
145.9024,
-30.0291
],
[
145.9031,
-30.0284
],
[
145.9036,
-30.0287
],
[
145.9043,
-30.0292
],
[
145.905,
-30.0297
],
[
145.9052,
-30.0303
],
[
145.9053,
-30.0306
],
[
145.9052,
-30.0316
],
[
145.905,
-30.0325
],
[
145.9048,
-30.0333
],
[
145.9046,
-30.0345
],
[
145.9048,
-30.0353
],
[
145.9032,
-30.0369
],
[
145.9027,
-30.0375
],
[
145.9021,
-30.0382
],
[
145.9018,
-30.0388
],
[
145.9014,
-30.0391
],
[
145.9009,
-30.0399
]
]
]
]
}
]
},
"properties": {
"reportUuid": "7872b6a4-2730-4ef8-9e3a-4fa4582cc3df",
"guid": "tag:www.rfs.nsw.gov.au,2013-12-31:151096",
"title": "Darling Farms",
"link": "http://www.rfs.nsw.gov.au/dsp_content.cfm?cat_id=683",
"category": "Advice",
"pubdate": "2013-12-31T04:00:00Z",
"firstSeen": "2013-12-30T03:05:00Z",
"lastSeen": "2013-12-31T04:00:00Z",
"alertLevel": "Advice",
"location": "North Bourke",
"councilArea": "Bourke",
"status": "under control",
"fireType": "Scrub fire",
"fire": true,
"size": "45 ha",
"responsibleAgency": "Rural Fire Service",
"extra": ""
}
}
]
}
# GET /incidents/{id}
Retrieve an incident by its *id*.
+ Parameters
+ id (required, string, `df34a81e-4fe5-4c09-8403-466526ea503c`) ... Id of an incident.
+ Response 200 (application/json)
JSON conforming to the GeoJSON spec. Response is a feature representing the requested incident. Properties included in the feature object are taken from the incident's most recent report.
+ Body
{
"type": "Feature",
"id": "176a2772-2589-4fa5-bb21-16af5bcd69fc",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
145.9021,
-30.0348
]
},
{
"type": "MultiPolygon",
"coordinates": [
[
[
[
145.9009,
-30.0399
],
[
145.8996,
-30.041
],
[
145.8989,
-30.0391
],
[
145.8989,
-30.039
],
[
145.9003,
-30.0366
],
[
145.8992,
-30.0351
],
[
145.8993,
-30.0342
],
[
145.9,
-30.0329
],
[
145.9013,
-30.0312
],
[
145.9024,
-30.0305
],
[
145.9023,
-30.0296
],
[
145.9024,
-30.0291
],
[
145.9031,
-30.0284
],
[
145.9036,
-30.0287
],
[
145.9043,
-30.0292
],
[
145.905,
-30.0297
],
[
145.9052,
-30.0303
],
[
145.9053,
-30.0306
],
[
145.9052,
-30.0316
],
[
145.905,
-30.0325
],
[
145.9048,
-30.0333
],
[
145.9046,
-30.0345
],
[
145.9048,
-30.0353
],
[
145.9032,
-30.0369
],
[
145.9027,
-30.0375
],
[
145.9021,
-30.0382
],
[
145.9018,
-30.0388
],
[
145.9014,
-30.0391
],
[
145.9009,
-30.0399
]
]
]
]
}
]
},
"properties": {
"reportUuid": "7872b6a4-2730-4ef8-9e3a-4fa4582cc3df",
"guid": "tag:www.rfs.nsw.gov.au,2013-12-31:151096",
"title": "Darling Farms",
"link": "http://www.rfs.nsw.gov.au/dsp_content.cfm?cat_id=683",
"category": "Advice",
"pubdate": "2013-12-31T04:00:00Z",
"firstSeen": "2013-12-30T03:05:00Z",
"lastSeen": "2013-12-31T04:00:00Z",
"alertLevel": "Advice",
"location": "North Bourke",
"councilArea": "Bourke",
"status": "under control",
"fireType": "Scrub fire",
"fire": true,
"size": "45 ha",
"responsibleAgency": "Rural Fire Service",
"extra": ""
}
}
|
HOST: http://api.bushfir.es/
# Fire incidents API
An API to current and previous [RFS](http://www.rfs.nsw.gov.au) major incidents.
# GET /incidents
Retrieve a collection of incidents which may or may not be filtered by parameters included in the request.
+ Parameters
+ current = `true` (optional, boolean) ... Boolean value indicating whether to only include current incidents or not.
+ Response 200 (application/json)
JSON conforming to the GeoJSON spec. Response is a feature collection containing 0 or more features. Each feature represents an incident. Properties included in the feature object are taken from the incident's most recent report.
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "0ee1fd01-11bc-4526-8910-5423e63e898c",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
151.6034,
-33.1567
]
}
]
},
"properties": {
"reportUuid": "16d9c09c-aba0-47ce-964f-01aa75b1af10",
"guid": "tag:www.rfs.nsw.gov.au,2013-12-31:84431",
"title": "Crangan Bay -West",
"link": "http://www.rfs.nsw.gov.au/dsp_content.cfm?cat_id=683",
"category": "Advice",
"pubdate": "2013-12-31T05:00:00Z",
"firstSeen": "2013-11-30T06:48:00Z",
"lastSeen": "2013-12-31T05:00:00Z",
"alertLevel": "Advice",
"location": "500 metres west of Pacific Hwy at Crangan Bay. Same location as previous Incident - No 13113083624.",
"councilArea": "Lake Macquarie",
"status": "under control",
"fireType": "Scrub fire",
"fire": true,
"size": "0 ha",
"responsibleAgency": "Rural Fire Service",
"extra": ""
}
},
{
"type": "Feature",
"id": "176a2772-2589-4fa5-bb21-16af5bcd69fc",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
145.9021,
-30.0348
]
},
{
"type": "MultiPolygon",
"coordinates": [
[
[
[
145.9009,
-30.0399
],
[
145.8996,
-30.041
],
[
145.8989,
-30.0391
],
[
145.8989,
-30.039
],
[
145.9003,
-30.0366
],
[
145.8992,
-30.0351
],
[
145.8993,
-30.0342
],
[
145.9,
-30.0329
],
[
145.9013,
-30.0312
],
[
145.9024,
-30.0305
],
[
145.9023,
-30.0296
],
[
145.9024,
-30.0291
],
[
145.9031,
-30.0284
],
[
145.9036,
-30.0287
],
[
145.9043,
-30.0292
],
[
145.905,
-30.0297
],
[
145.9052,
-30.0303
],
[
145.9053,
-30.0306
],
[
145.9052,
-30.0316
],
[
145.905,
-30.0325
],
[
145.9048,
-30.0333
],
[
145.9046,
-30.0345
],
[
145.9048,
-30.0353
],
[
145.9032,
-30.0369
],
[
145.9027,
-30.0375
],
[
145.9021,
-30.0382
],
[
145.9018,
-30.0388
],
[
145.9014,
-30.0391
],
[
145.9009,
-30.0399
]
]
]
]
}
]
},
"properties": {
"reportUuid": "7872b6a4-2730-4ef8-9e3a-4fa4582cc3df",
"guid": "tag:www.rfs.nsw.gov.au,2013-12-31:151096",
"title": "Darling Farms",
"link": "http://www.rfs.nsw.gov.au/dsp_content.cfm?cat_id=683",
"category": "Advice",
"pubdate": "2013-12-31T04:00:00Z",
"firstSeen": "2013-12-30T03:05:00Z",
"lastSeen": "2013-12-31T04:00:00Z",
"alertLevel": "Advice",
"location": "North Bourke",
"councilArea": "Bourke",
"status": "under control",
"fireType": "Scrub fire",
"fire": true,
"size": "45 ha",
"responsibleAgency": "Rural Fire Service",
"extra": ""
}
}
]
}
# GET /incidents/{id}
Retrieve an incident by its *id*.
+ Parameters
+ id (required, string, `df34a81e-4fe5-4c09-8403-466526ea503c`) ... Id of an incident.
+ Response 200 (application/json)
JSON conforming to the GeoJSON spec. Response is a feature representing the requested incident. Properties included in the feature object are taken from the incident's most recent report.
+ Body
{
"type": "Feature",
"id": "176a2772-2589-4fa5-bb21-16af5bcd69fc",
"geometry": {
"type": "GeometryCollection",
"geometries": [
{
"type": "Point",
"coordinates": [
145.9021,
-30.0348
]
},
{
"type": "MultiPolygon",
"coordinates": [
[
[
[
145.9009,
-30.0399
],
[
145.8996,
-30.041
],
[
145.8989,
-30.0391
],
[
145.8989,
-30.039
],
[
145.9003,
-30.0366
],
[
145.8992,
-30.0351
],
[
145.8993,
-30.0342
],
[
145.9,
-30.0329
],
[
145.9013,
-30.0312
],
[
145.9024,
-30.0305
],
[
145.9023,
-30.0296
],
[
145.9024,
-30.0291
],
[
145.9031,
-30.0284
],
[
145.9036,
-30.0287
],
[
145.9043,
-30.0292
],
[
145.905,
-30.0297
],
[
145.9052,
-30.0303
],
[
145.9053,
-30.0306
],
[
145.9052,
-30.0316
],
[
145.905,
-30.0325
],
[
145.9048,
-30.0333
],
[
145.9046,
-30.0345
],
[
145.9048,
-30.0353
],
[
145.9032,
-30.0369
],
[
145.9027,
-30.0375
],
[
145.9021,
-30.0382
],
[
145.9018,
-30.0388
],
[
145.9014,
-30.0391
],
[
145.9009,
-30.0399
]
]
]
]
}
]
},
"properties": {
"reportUuid": "7872b6a4-2730-4ef8-9e3a-4fa4582cc3df",
"guid": "tag:www.rfs.nsw.gov.au,2013-12-31:151096",
"title": "Darling Farms",
"link": "http://www.rfs.nsw.gov.au/dsp_content.cfm?cat_id=683",
"category": "Advice",
"pubdate": "2013-12-31T04:00:00Z",
"firstSeen": "2013-12-30T03:05:00Z",
"lastSeen": "2013-12-31T04:00:00Z",
"alertLevel": "Advice",
"location": "North Bourke",
"councilArea": "Bourke",
"status": "under control",
"fireType": "Scrub fire",
"fire": true,
"size": "45 ha",
"responsibleAgency": "Rural Fire Service",
"extra": ""
}
}
# GET /incidents/{id}/reports
Retrieve all reports for a specified incident.
+ Parameters
+ id (required, string, `df34a81e-4fe5-4c09-8403-466526ea503c`) ... Id of an incident.
+ Response 200 (application/json)
Reports are returned as a GeoJSON `FeatureCollection` whose `features` are ordered by `pubdate` in ascending order. Each item within the `FeatureCollection` is a `Feature` representing the report. A report is basically a snapshot of the incident at a given time. A report should never be identical to the one preceeding or following it.
+ Body
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature"
}
]
}
|
Add rough doc for upcoming reports endpoint.
|
Add rough doc for upcoming reports endpoint.
|
API Blueprint
|
mit
|
DylanFM/bushfires
|
0957199511c2222faa8c9a08b629b1d2d27e055d
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# inpassing
A web API for managing the lending and borrowing of passes.
## Org [/orgs]
+ Attribute
+ id: 2 (number)
+ name: Locust Valley High School (string)
### Create a new org [POST]
+ Request (application/json)
{
"name": "Locust Valley High School"
}
+ Response 201
+ Headers
Location: /orgs/2
### Search orgs by name [GET /orgs/search{?q}]
+ Parameters
- q: `Locust Valley` (string) - Query string
+ Response 200 (application/json)
[
{
"id": 2,
"name": "Locust Valley High School"
}
]
### Query an org [GET /orgs/{id}]
+ Parameters
- id (number) - Org ID
+ Request Anonymous
Without authentication, only basic information about an org will be returned.
+ Body
+ Response 200 (application/json)
+ Attributes (Org)
+ Request Authenticated
Use authentication to get more information about an org relevant to the user's role in that org.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Org)
+ greeting_fmt: `Today is a {} day` (string) - The greeting format
## Day State [/orgs/{org_id}/daystates]
+ Attributes
+ id: 1 (number) - The ID of the day state.
+ Include Day State Create
### Query states [GET]
Return information about an org day state.
+ Parameters
+ org_id: 2 (number) - The org whose states are to be queried.
+ Request
The authenticated user must be a participant or moderator of the org to query states.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Day State])
### Create a state [POST]
Creates a new day state associated with a given organization.
+ Parameters
+ org_id: 2 (number) - The org that will receive the new state.
+ Request
The authenticated user must moderate the org
+ Header
Authorization: Bearer JWT
+ Attributes (Day State Create)
+ Response 201 (application/json)
+ Attributes (Day State)
### Update a state [PUT /orgs/{org_id}/daystates/{daystate_id}]
Changes the identifier and/or greeting of a day state.
+ Request (application/json)
+ Header
Authorization: Bearer JWT
+ Attributes
+ identifier: `A` (string, optional)
+ greeting: `Updated greeting - A day` (string, optional)
+ Response 200 (application/json)
+ Attributes (Day State)
### Get the current day state [GET /orgs/{org_id}/daystates/current]
Returns the current day state, this will change on a day by day basis.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
+ Response 404 (application/json)
This occurs when an org has no rules defined for day states (or no day states to begin with).
+ Body
## User [/users]
+ Attributes
+ id (number)
+ first_name (string)
+ last_name (string)
+ email (string)
+ moderates (array[Org])
+ participates (array[Org])
+ passes (array[Pass])
### Create a user [POST]
+ Request (application/json)
+ Attributes
+ first_name: Luke (string) - User first name
+ last_name: San Antonio Bialecki (string) - User last name
+ email: `[email protected]` (string) - User email (used to log in)
+ password: `iUs3tHe$aMepAs$wOrdF0rEvEritHiNg` (string) - User password
+ Response 201
+ Headers
Location: /users/2
### Authenticate as user [POST /users/auth]
+ Request (application/json)
{
"email": "[email protected]",
"password": "iUs3tHe$aMepAs$wOrdF0rEvEritHiNg"
}
+ Response 200 (application/json)
{
"access_token": "<JWT_TOKEN>"
}
+ Response 403 (application/json)
{
"msg": "invalid username or password"
}
## Self [/me]
### Query self [GET]
+ Request
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Body
{
"id": 2,
"first_name": "Luke"
"last_name": "San Antonio Bialecki",
"email": "[email protected]",
"participates": [
{
"id": 2,
"name": "Locust Valley High School"
}
],
"moderates": [
{
"id": 1,
"name": "Test org"
}
],
"passes": [
{
"id": 3,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-03:23:00:12",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": "2017-02-04:07:42:12",
"assigned_state_id": 2,
"assigned_spot_num": 15
},
{
"id": 4,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-06:13:55:32",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": null,
"assigned_state_id": null,
"assigned_spot_num": null
}
]
}
## Pass [/passes{?org_id,user_id,verified}]
+ Attributes
+ id: 2 (number) - The pass ID
+ org_id: 1 (number) - The org that this pass belongs to
+ owner_id: 3 (number, nullable) - The user owner of the pass
+ request_time: `2017-02-03;23:00:12` (string) - Date and time of the pass request
+ requested_state_id: 2 (number) - Pass state requested by the user
+ requested_spot_num: 20 (number) - Pass spot requested by the user
+ assigned_time: `2017-02-03;23:15:12` (string, nullable) - Date and time when the pass was assigned / verified
+ assigned_state_id: 2 (number, nullable) - Pass state assigned to this pass
+ assigned_spot_num: 25 (number, nullable) - Pass spot number assigned to this pass
### Query pass collection [GET]
Filters all the passes that the user has access to.
If the user is the mod of an org, all org passes are available to filter.
+ Parameters
+ org_id (number, optional) - Return passes associated with this Org
+ user_id (number, optional) - Return passes associated with this user
+ verified (boolean, optional) - Filter verified passes. If this is null or omitted, all passes will be returned.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Pass])
### Request a new pass [POST]
Requests a new pass from an Org on behalf of the authenticated user.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Attributes
+ org_id: 2 (number) - The Org that the pass is to be requested from
+ state_id: 1 (number) - The requested day state of the pass
+ spot_num: 25 (number) - The requested spot number
+ Response 201 (application/json)
Note that although the pass object exists, the org will still need to verify it for it to be useful.
+ Header
Location: /passes/2
+ Attributes (Pass)
+ assigned_time - null
+ assigned_state_id - null
+ assigned_spot_num - null
### Query pass [GET /passes/{id}]
Get specific pass object
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Pass)
+ Response 403 (application/json)
You can only query passes that you would have access to either as an org moderator or a user!
+ Body
{
"msg": "not authenticated to view this pass",
"error_code": "foreign_pass"
}
### Assign pass [PUT /passes/{id}/assign]
Used to verify passes or re-assign them to different states or spot numbers.
Any changes to the pass resulting from this call will result in `assigned_time` being updated.
+ Request
+ Header
Authorization: Bearer JWT
+ Attributes
+ state_id (number, optional) - The new state of the pass
+ spot_num (number, optional) - The new spot number of the pass
+ Response 200 (application/json)
+ Attributes (Pass)
### Lend a pass [POST /passes/{pass_id}/lend]
Creates a request to lend a pass on behalf of the user for every day in the date range.
The pass will not be lent out on days that the user does not have access to the pass,
but it is not an error to include these days in the date range.
+ Parameters
+ pass_id (number) - The pass to lend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Borrow a pass [POST /passes/borrow]
Creates a request to borrow a pass on behalf of the user for every day in the date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
# Data Structures
## Date
+ date: `2017-03-05` (string) - Date
## Date Range (object)
+ start_date: `2017-11-15` (string) - Start date
+ end_date: `2018-01-04` (string) - End date
## Date Selection (enum)
+ (Date)
+ (Date Range)
## Day State Create (object)
+ identifier: M (string) - A recognizable short name / character for the state
+ greeting: `Today is a Monday` (string) - The greeting used to inform clients of the state of the current day.
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# inpassing
A web API for managing the lending and borrowing of passes.
## Org [/orgs]
+ Attribute
+ id: 2 (number)
+ name: Locust Valley High School (string)
### Create a new org [POST]
+ Request (application/json)
{
"name": "Locust Valley High School"
}
+ Response 201
+ Headers
Location: /orgs/2
### Search orgs by name [GET /orgs/search{?q}]
+ Parameters
- q: `Locust Valley` (string) - Query string
+ Response 200 (application/json)
[
{
"id": 2,
"name": "Locust Valley High School"
}
]
### Query an org [GET /orgs/{id}]
+ Parameters
- id (number) - Org ID
+ Request Anonymous
Without authentication, only basic information about an org will be returned.
+ Body
+ Response 200 (application/json)
+ Attributes (Org)
+ Request Authenticated
Use authentication to get more information about an org relevant to the user's role in that org.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Org)
+ greeting_fmt: `Today is a {} day` (string) - The greeting format
## Day State [/orgs/{org_id}/daystates]
+ Attributes
+ id: 1 (number) - The ID of the day state.
+ Include Day State Create
### Query states [GET]
Return information about an org day state.
+ Parameters
+ org_id: 2 (number) - The org whose states are to be queried.
+ Request
The authenticated user must be a participant or moderator of the org to query states.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Day State])
### Create a state [POST]
Creates a new day state associated with a given organization.
+ Parameters
+ org_id: 2 (number) - The org that will receive the new state.
+ Request
The authenticated user must moderate the org
+ Header
Authorization: Bearer JWT
+ Attributes (Day State Create)
+ Response 201 (application/json)
+ Attributes (Day State)
### Update a state [PUT /orgs/{org_id}/daystates/{daystate_id}]
Changes the identifier and/or greeting of a day state.
+ Request (application/json)
+ Header
Authorization: Bearer JWT
+ Attributes
+ identifier: `A` (string, optional)
+ greeting: `Updated greeting - A day` (string, optional)
+ Response 200 (application/json)
+ Attributes (Day State)
### Get the current day state [GET /orgs/{org_id}/daystates/current]
Returns the current day state, this will change on a day by day basis.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
+ Response 404 (application/json)
This occurs when an org has no rules defined for day states (or no day states to begin with).
+ Body
## User [/users]
+ Attributes
+ id (number)
+ first_name (string)
+ last_name (string)
+ email (string)
+ moderates (array[Org])
+ participates (array[Org])
+ passes (array[Pass])
### Create a user [POST]
+ Request (application/json)
+ Attributes
+ first_name: Luke (string) - User first name
+ last_name: San Antonio Bialecki (string) - User last name
+ email: `[email protected]` (string) - User email (used to log in)
+ password: `iUs3tHe$aMepAs$wOrdF0rEvEritHiNg` (string) - User password
+ Response 201
+ Headers
Location: /users/2
### Authenticate as user [POST /users/auth]
+ Request (application/json)
{
"email": "[email protected]",
"password": "iUs3tHe$aMepAs$wOrdF0rEvEritHiNg"
}
+ Response 200 (application/json)
{
"access_token": "<JWT_TOKEN>"
}
+ Response 403 (application/json)
{
"msg": "invalid username or password"
}
## Self [/me]
### Query self [GET]
+ Request
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Body
{
"id": 2,
"first_name": "Luke"
"last_name": "San Antonio Bialecki",
"email": "[email protected]",
"participates": [
{
"id": 2,
"name": "Locust Valley High School"
}
],
"moderates": [
{
"id": 1,
"name": "Test org"
}
],
"passes": [
{
"id": 3,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-03:23:00:12",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": "2017-02-04:07:42:12",
"assigned_state_id": 2,
"assigned_spot_num": 15
},
{
"id": 4,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-06:13:55:32",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": null,
"assigned_state_id": null,
"assigned_spot_num": null
}
]
}
## Pass [/passes{?org_id,user_id,verified}]
+ Attributes
+ id: 2 (number) - The pass ID
+ org_id: 1 (number) - The org that this pass belongs to
+ owner_id: 3 (number, nullable) - The user owner of the pass
+ request_time: `2017-02-03;23:00:12` (string) - Date and time of the pass request
+ requested_state_id: 2 (number) - Pass state requested by the user
+ requested_spot_num: 20 (number) - Pass spot requested by the user
+ assigned_time: `2017-02-03;23:15:12` (string, nullable) - Date and time when the pass was assigned / verified
+ assigned_state_id: 2 (number, nullable) - Pass state assigned to this pass
+ assigned_spot_num: 25 (number, nullable) - Pass spot number assigned to this pass
### Query pass collection [GET]
Filters all the passes that the user has access to.
If the user is the mod of an org, all org passes are available to filter.
+ Parameters
+ org_id (number, optional) - Return passes associated with this Org
+ user_id (number, optional) - Return passes associated with this user
+ verified (boolean, optional) - Filter verified passes. If this is null or omitted, all passes will be returned.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Pass])
### Request a new pass [POST]
Requests a new pass from an Org on behalf of the authenticated user.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Attributes
+ org_id: 2 (number) - The Org that the pass is to be requested from
+ state_id: 1 (number) - The requested day state of the pass
+ spot_num: 25 (number) - The requested spot number
+ Response 201 (application/json)
Note that although the pass object exists, the org will still need to verify it for it to be useful.
+ Header
Location: /passes/2
+ Attributes (Pass)
+ assigned_time - null
+ assigned_state_id - null
+ assigned_spot_num - null
### Query pass [GET /passes/{id}]
Get specific pass object
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Pass)
+ Response 403 (application/json)
You can only query passes that you would have access to either as an org moderator or a user!
+ Body
{
"msg": "not authenticated to view this pass",
"error_code": "foreign_pass"
}
### Assign pass [PUT /passes/{id}/assign]
Used to verify passes or re-assign them to different states or spot numbers.
Any changes to the pass resulting from this call will result in `assigned_time` being updated.
+ Request
+ Header
Authorization: Bearer JWT
+ Attributes
+ state_id (number, optional) - The new state of the pass
+ spot_num (number, optional) - The new spot number of the pass
+ Response 200 (application/json)
+ Attributes (Pass)
### Lend a pass [POST /passes/{pass_id}/lend]
Creates a request to lend a pass on behalf of the user for every day in the date range.
The pass will not be lent out on days that the user does not have access to the pass,
but it is not an error to include these days in the date range.
+ Parameters
+ pass_id (number) - The pass to lend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Borrow a pass [POST /passes/borrow]
Creates a request to borrow a pass on behalf of the user for every day in the date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Stop lending a pass [POST /passes/{pass_id}/unlend]
Removes a request to lend a pass on behalf of the user in the given date range.
+ Parameters
+ pass_id (number) - The pass to unlend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Stop borrowing a pass [POST /passes/unborrow]
Removes a request to borrow a pass on behalf of the user in a given date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
# Data Structures
## Date
+ date: `2017-03-05` (string) - Date
## Date Range (object)
+ start_date: `2017-11-15` (string) - Start date
+ end_date: `2018-01-04` (string) - End date
## Date Selection (enum)
+ (Date)
+ (Date Range)
## Day State Create (object)
+ identifier: M (string) - A recognizable short name / character for the state
+ greeting: `Today is a Monday` (string) - The greeting used to inform clients of the state of the current day.
|
Update API doc with endpoints to stop lending or borrowing a pass
|
Update API doc with endpoints to stop lending or borrowing a pass
This is a step towards fixing #2.
|
API Blueprint
|
mit
|
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
|
69c8251de286d0ebbfe655fa8bdaeadf771877dc
|
blueprint/index.apib
|
blueprint/index.apib
|
FORMAT: 1A
HOST: https://thegrid.io/
# The Grid API
Want to straight to the details?
* [Authentication](authentication.html)
* [Content Management](api.html)
* [User Management](passport.html)
# Purpose
[The Grid](https://thegrid.io/) is a next-generation web publishing platform.
The service provides a complete user experience for making, editing content
across multiple devices, but also has a complete API available.
This document describes that API and how it can be used by developers, including third-party.
Functionality provided includes
* Web page auto-design, layout and publishing
* Content import and analysis
* Image processing
* Handling payments (TDB)
What The Grid is not.
Not a web-hosting plastform to run arbitrary PHP/Python/Ruby or databases on.
# Access
API access is available to all users on The Grid.
If you wish to develop with The Grid, [become a founding member now](https://thegrid.io/).
*Note: we are currently in pre-order and are not auto-activating users yet.*
When your plan has been activated, you may log in and register new apps
on your [accounts page](https://passport.thegrid.io/
# Example uses of the API
* Mobile apps
Either single-purpose apps, or full-featured The Grid apps
for platforms which are not officially supported
like Windows Phone, Firefox OS, Jolla etc.
* Social media integration
Like a Twitter or Facebook app which syncs content to your The Grid site.
* Content migration
For importing all of the content from your current website,
like Wordpress, Squarespace, Medium or Tumbler
* Embedded/autonomous devices
Devices that automatically publish their state or results,
for instance a timelapse camera or 3d-printer.
* Desktop & web app integration
For instance "Share to The Grid" functionality
* Custom content editing user interfaces
Using specialized user interactions, making use of new technology
or increased accessibility
# Known consumers
Existing examples of apps and libraries using this API.
* [Flowhub](https://flowhub.io) and [noflo-ui](https://github.com/noflo/noflo-ui)
* The Grid Android app
* The Grid iOS app
* The Grid Chrome extension
* [thegrid.io](https://thegrid.io) website, including purchasing process
Libraries
* [passport-thegrid](https://www.npmjs.com/package/passport-thegrid):
Authentication strategy for [Passport.js](http://passportjs.org/)
# Issues or Questions?
This API documentation is [on GitHub](https://github.com/the-grid/apidocs).
Got any questions or found issues in the documentation?
[File issues](https://github.com/the-grid/apidocs/issues)
or create a [pull request](https://github.com/the-grid/apidocs/pulls).
|
FORMAT: 1A
HOST: https://thegrid.io/
# The Grid API
Want to straight to the details?
* [Authentication](authentication.html)
* [Content Management](api.html)
* [User Management](passport.html)
# Purpose
[The Grid](https://thegrid.io/) is a next-generation web publishing platform.
The service provides a complete user experience for making, editing content
across multiple devices, but also has a complete API available.
This document describes that API and how it can be used by developers, including third-party.
Functionality provided includes
* Web page auto-design, layout and publishing
* Content import and analysis
* Image processing
* Handling payments (TDB)
What The Grid is not.
Not a web-hosting plastform to run arbitrary PHP/Python/Ruby or databases on.
# Access
API access is available to all users on The Grid.
If you wish to develop with The Grid, [become a founding member now](https://thegrid.io/).
*Note: we are currently in pre-order and are not auto-activating users yet.*
When your plan has been activated, you may log in and register new apps
on your [accounts page](https://passport.thegrid.io/)
# Example uses of the API
* Mobile apps
Either single-purpose apps, or full-featured The Grid apps
for platforms which are not officially supported
like Windows Phone, Firefox OS, Jolla etc.
* Social media integration
Like a Twitter or Facebook app which syncs content to your The Grid site.
* Content migration
For importing all of the content from your current website,
like Wordpress, Squarespace, Medium or Tumbler
* Embedded/autonomous devices
Devices that automatically publish their state or results,
for instance a timelapse camera or 3d-printer.
* Desktop & web app integration
For instance "Share to The Grid" functionality
* Custom content editing user interfaces
Using specialized user interactions, making use of new technology
or increased accessibility
# Known consumers
Existing examples of apps and libraries using this API.
* [Flowhub](https://flowhub.io) and [noflo-ui](https://github.com/noflo/noflo-ui)
* The Grid Android app
* The Grid iOS app
* The Grid Chrome extension
* [thegrid.io](https://thegrid.io) website, including purchasing process
Libraries
* [passport-thegrid](https://www.npmjs.com/package/passport-thegrid):
Authentication strategy for [Passport.js](http://passportjs.org/)
# Issues or Questions?
This API documentation is [on GitHub](https://github.com/the-grid/apidocs).
Got any questions or found issues in the documentation?
[File issues](https://github.com/the-grid/apidocs/issues)
or create a [pull request](https://github.com/the-grid/apidocs/pulls).
|
Fix account page link
|
index: Fix account page link
|
API Blueprint
|
mit
|
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
|
72854ecbdb62f26894947d064a57d1f60663078b
|
spec/example.apib
|
spec/example.apib
|
FORMAT: 1A
HOST: http://example.com/
# Example API
API FTW
# Group Scenarios
## Scenarios [/scenarios{?page,sort}]
This resource represents the collection of all scenarios.
### Retrieve all Scenarios [GET]
Retrieve all scenarios.
+ Parameters
+ page (string, `1`) ... Page result number.
+ sort (string, `name`) ... Attribute to sort by.
+ Response 200 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["scenarios", "collection"],
"entities" : [
{
"class": [ "scenario" ],
"properties": {
"names": [{ "text": "Scenario number one" }],
"address": 'Here and there',
"slug": 'number_one'
},
"links": [
{
"rel": ["self"],
"href": "http://example.com/scenarios/number_one"
}
],
"rel": ["item"]
},
{
"class": [ "scenario" ],
"properties": {
"names": [{ "text": "Scenario number two" }],
"address": 'Here but not there',
"slug": 'number_two'
},
"links": [
{
"rel": ["self"],
"href": "http://example.com/scenarios/number_two"
}
],
"rel": ["item"]
}
],
"actions":[
{
"method":"POST",
"type":"application/json",
"href":"http://example.com/scenarios",
"name":"add-scenario",
"fields":[
{"type":"text", "name":"names"},
{"type":"text", "name":"address"}
]
}
],
"links":[
{
"rel": ["self"],
"href": "http://example.com/scenarios"
}
]
}
### Create a Scenario [POST]
Create a Scenario.
+ Request (application/json)
{
"name": "Scenario number three",
"address": "Only there"
}
+ Response 201 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["scenario"],
"properties" : {
"names" : [{ "text" : "Scenario number three" }],
"address" : "Only there",
"slug" : "scenario_three"
},
"links" : [
{
"rel" : ["self"],
"href" : "http://examples.com/scenarios/number_three"
}
]
}
## Scenario [/scenarios/{slug}]
This resource represents a single Scenario.
### Retrieve a Scenario [GET]
Retrieve a Scenario.
+ Parameters
+ slug (string, `number_three`) ... The unique identifier of the scenario.
+ Response 200 (application/vnd.siren+json; charset=utf-8)
+ Body
{
"class" : ["scenario"],
"properties" : {
"names" : [{ "text" : "Scenario number three" }],
"address" : "Only there",
"slug" : "scenario_three"
},
"links" : [
{
"rel" : ["self"],
"href" : "http://example.com/scenarios/number_three"
}
]
}
# Group Steps
## Steps [/scenarios/{scenario_slug}/steps{?number}]
This resource represents a collection of Scenario's Steps.
### Retrieve all Steps of a scenario [GET]
Retrieve all POIs
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ number (string, `10`) ... Amount of steps to show.
+ Response 200 (application/vnd.siren+json; charset=utf-8)
{
"class": [ "steps", "collection" ],
"entities": [
{
"class": [ "step", ],
"properties": {
"id" : 1,
"name": "Initial Step",
"scenario_slug" : "scenario_one"
},
"links": [
{
"rel": [ "self" ],
"href": "http://example.com/scenarios/scenario_one/steps/1
}
],
"rel": [ "item" ]
}
],
"actions": [],
"links": [
{
"rel": [ "self" ],
"href": "http://example.com/scenarios/scenario_one/steps"
}
]
}
### Create a Step [POST]
Create a Step
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ Request (application/json)
{
"name": "Step two",
"scenario_slug": "scenario_one"
}
+ Response 201 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["step"],
"properties" : {
"name" : "Step two",
"id" : 2,
"scenario_slug" : "scenario_one"
},
"links": [
{
"rel" : ["self"],
"href" : "http://example.com/scenarios/scenario_one/2"
}
]
}
## Step [/scenarios/{scenario_slug}/steps/{id}]
This resource represents a single POI
### Update a Step [PUT]
Update a Step
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ id (integer, 2) ... An unique identifier of the Step.
+ Request (application/json)
{
"name": "Step two and half",
"id" : 2
"scenario_slug": "scenario_one"
}
+ Response 201 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["step"],
"properties" : {
"name" : "Step two and half",
"id" : 2,
"scenario_slug" : "scenario_one"
},
"links": [
{
"rel" : ["self"],
"href" : "http://example.com/scenarios/scenario_one/2"
}
]
}
### Delete a Step [DELETE]
Delete a Step
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ id (integer, 2) ... An unique identifier of the Step.
+ Response 204
|
FORMAT: 1A
HOST: http://example.com/
# Example API
API FTW
# Group Scenarios
## Scenarios [/scenarios{?page,sort}]
This resource represents the collection of all scenarios.
### Retrieve all Scenarios [GET]
Retrieve all scenarios.
+ Parameters
+ page (string, `1`) ... Page result number.
+ sort (string, `name`) ... Attribute to sort by.
+ Response 200 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["scenarios", "collection"],
"entities" : [
{
"class": [ "scenario" ],
"properties": {
"names": [{ "text": "Scenario number one" }],
"address": "Here and there",
"slug": "number_one"
},
"links": [
{
"rel": ["self"],
"href": "http://example.com/scenarios/number_one"
}
],
"rel": ["item"]
},
{
"class": [ "scenario" ],
"properties": {
"names": [{ "text": "Scenario number two" }],
"address": "Here but not there",
"slug": "number_two"
},
"links": [
{
"rel": ["self"],
"href": "http://example.com/scenarios/number_two"
}
],
"rel": ["item"]
}
],
"actions":[
{
"method":"POST",
"type":"application/json",
"href":"http://example.com/scenarios",
"name":"add-scenario",
"fields":[
{"type":"text", "name":"names"},
{"type":"text", "name":"address"}
]
}
],
"links":[
{
"rel": ["self"],
"href": "http://example.com/scenarios"
}
]
}
### Create a Scenario [POST]
Create a Scenario.
+ Request (application/json)
{
"name": "Scenario number three",
"address": "Only there"
}
+ Response 201 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["scenario"],
"properties" : {
"names" : [{ "text" : "Scenario number three" }],
"address" : "Only there",
"slug" : "scenario_three"
},
"links" : [
{
"rel" : ["self"],
"href" : "http://examples.com/scenarios/number_three"
}
]
}
## Scenario [/scenarios/{slug}]
This resource represents a single Scenario.
### Retrieve a Scenario [GET]
Retrieve a Scenario.
+ Parameters
+ slug (string, `number_three`) ... The unique identifier of the scenario.
+ Response 200 (application/vnd.siren+json; charset=utf-8)
+ Body
{
"class" : ["scenario"],
"properties" : {
"names" : [{ "text" : "Scenario number three" }],
"address" : "Only there",
"slug" : "scenario_three"
},
"links" : [
{
"rel" : ["self"],
"href" : "http://example.com/scenarios/number_three"
}
]
}
# Group Steps
## Steps [/scenarios/{scenario_slug}/steps{?number}]
This resource represents a collection of Scenario's Steps.
### Retrieve all Steps of a scenario [GET]
Retrieve all POIs
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ number (string, `10`) ... Amount of steps to show.
+ Response 200 (application/vnd.siren+json; charset=utf-8)
{
"class": [ "steps", "collection" ],
"entities": [
{
"class": [ "step" ],
"properties": {
"id" : 1,
"name": "Initial Step",
"scenario_slug" : "scenario_one"
},
"links": [
{
"rel": [ "self" ],
"href": "http://example.com/scenarios/scenario_one/steps/1"
}
],
"rel": [ "item" ]
}
],
"actions": [],
"links": [
{
"rel": [ "self" ],
"href": "http://example.com/scenarios/scenario_one/steps"
}
]
}
### Create a Step [POST]
Create a Step
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ Request (application/json)
{
"name": "Step two",
"scenario_slug": "scenario_one"
}
+ Response 201 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["step"],
"properties" : {
"name" : "Step two",
"id" : 2,
"scenario_slug" : "scenario_one"
},
"links": [
{
"rel" : ["self"],
"href" : "http://example.com/scenarios/scenario_one/2"
}
]
}
## Step [/scenarios/{scenario_slug}/steps/{id}]
This resource represents a single POI
### Update a Step [PUT]
Update a Step
+ Parameters
+ scenario_slug (string, `scenario_one`) ... Scenario slug
+ id (required,number,`2`) ... An unique identifier of the Step.
+ Request (application/json)
{
"name": "Step two and half",
"id" : 2
"scenario_slug": "scenario_one"
}
+ Response 201 (application/vnd.siren+json; charset=utf-8)
{
"class" : ["step"],
"properties" : {
"name" : "Step two and half",
"id" : 2,
"scenario_slug" : "scenario_one"
},
"links": [
{
"rel" : ["self"],
"href" : "http://example.com/scenarios/scenario_one/2"
}
]
}
### Delete a Step [DELETE]
Delete a Step
+ Parameters
+ scenario_slug (required, string, `scenario_one`) ... Scenario slug
+ id (required,number,`2`) ... An unique identifier of the Step.
+ Response 204
|
fix typos
|
fix typos
|
API Blueprint
|
mit
|
nogates/vigia,lonelyplanet/vigia
|
5885708c3d580c13137abd0d9f201faf16510dfd
|
src/api.apib
|
src/api.apib
|
FORMAT: 1A
# YOUR AWESOME API NAME
*This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.*
## Authentication
+ This API uses [JWT](http://jwt.io/) for authentication,
+ Every token MUST be refreshed before its expiration time,
+ Token MUST be provided in `Authorization` header,
+ Toke MUST be provided for each request that requires authentication,
+ This API issues a **long-lived acces tokens** for consumers. A long-lived JWT generally SHOULD lasts about **30 days**. If no requests are made, the token MUST expire and the user MUST go through the login flow again to get a new one.
### Example Header
```
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhNnZoQW8zRkc3dDEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE0NzA1OTg5NzIsImV4cCI6MTQ3MDY4NTM3Mn0.ltA9zZmJKszBJuuV7pTWtY7LzLXrRUfebJDhy_jGMeM
```
### Claims
+ `exp` - The exp ( *expiration time* ) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing.
+ `iat` - The iat ( *issued at* ) claim identifies the time at which the JWT was issued.
+ `sub` - The aud ( *audience* ) claim identifies the subject of this token (for e.g. a user id).
+ `iss` - The iss ( *issuer* ) claim identifies the principal that issued the JWT.
## Consumer Identification
This API uses `User-Agent` and `Application-Id` headers to identify API consumer. `Application-Id` MUST contain an UUID that uniquely identifies a particular consumer installation.
### Example Headers
```
User-Agent: Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Application-Id: 6454d937-0a18-44a8-b482-bb48684f1ed4
```
## Filtering, Ordering, Pagination & Searching
### Filtering
This API can filter returned collections based on provided query parameters. Virtually any model field can be used as a filter.
For example, when requesting a list of movies from the /movies endpoint, you may want to limit these to only those of drama genre. This could be accomplished with a request like `GET /movies?genre=drama`. Here, genre is a query parameter that implements a filter.
### Ordering
This API can sort returned collections. A generic query parameter `sort` is used to describe sorting rules. This parameter can take a list of comma separated field, each with a possible unary negative to imply descending sort order.
E.g. `GET /movies?sort=-rating` - Retrieves a list of movies in descending order of user rating.
By default all resources are ordered by their creation time, from newest to oldest.
### Pagintation
This API uses the [Link header - RFC 5988](http://tools.ietf.org/html/rfc5988#page-6) to include pagination details.
An example of a Link header is described in [GitHub documentation](https://developer.github.com/guides/traversing-with-pagination/).
This API returns total count of paged resources in `Total-Count` HTTP header.
### Searching
This API uses a generic parameter `search` to expose a full text search mechanism.
## HTTP Methods
This API uses HTTP verbs (methods) as following:
+ `GET` - *Read* - used to **read** (or retrieve) a representation of a resource,
+ `POST` - *Create* - used to **create** new resources. In particular, it's used to create subordinate resources.
+ `PUT` - *Update/Replace* - used for **update** capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. ⚠️ On successful request, replaces identified resource with the request body.
+ `PATCH` - *Update/Modify* - used for **modify** capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
+ `DELETE` - *Delete* - used to **delete** a resource identified by a URI.
|
FORMAT: 1A
# YOUR AWESOME API NAME
*This API blueprint is subject to change due to technology restrictions, performance optimizations or changing requirements.*
## Authentication
+ This API uses [JWT](http://jwt.io/) for authentication,
+ Every token MUST be refreshed before its expiration time,
+ Token MUST be provided in `Authorization` header,
+ Toke MUST be provided for each request that requires authentication,
+ This API issues a **long-lived acces tokens** for consumers. A long-lived JWT generally SHOULD lasts about **30 days**. If no requests are made, the token MUST expire and the user MUST go through the login flow again to get a new one.
### Example Header
```
Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhNnZoQW8zRkc3dDEiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE0NzA1OTg5NzIsImV4cCI6MTQ3MDY4NTM3Mn0.ltA9zZmJKszBJuuV7pTWtY7LzLXrRUfebJDhy_jGMeM
```
### Claims
+ `exp` - The exp ( *expiration time* ) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing.
+ `iat` - The iat ( *issued at* ) claim identifies the time at which the JWT was issued.
+ `sub` - The aud ( *audience* ) claim identifies the subject of this token (for e.g. a user id).
+ `iss` - The iss ( *issuer* ) claim identifies the principal that issued the JWT.
## Consumer Identification
This API uses `User-Agent` and `Application-Id` headers to identify API consumer. `Application-Id` MUST contain an UUID that uniquely identifies a particular consumer installation.
### Example Headers
```
User-Agent: Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Application-Id: 6454d937-0a18-44a8-b482-bb48684f1ed4
```
## Filtering, Ordering, Pagination & Searching
### Filtering
This API can filter returned collections based on provided query parameters. Virtually any model field can be used as a filter.
For example, when requesting a list of movies from the /movies endpoint, you may want to limit these to only those of drama genre. This could be accomplished with a request like `GET /movies?genre=drama`. Here, genre is a query parameter that implements a filter.
### Ordering
This API can sort returned collections. A generic query parameter `sort` is used to describe sorting rules. This parameter can take a list of comma separated field, each with a possible unary negative to imply descending sort order.
E.g. `GET /movies?sort=-rating` - Retrieves a list of movies in descending order of user rating.
By default all resources are ordered by their creation time, from newest to oldest.
### Pagintation
This API uses the [Link header - RFC 5988](http://tools.ietf.org/html/rfc5988#page-6) to include pagination details.
An example of a Link header is described in [GitHub documentation](https://developer.github.com/guides/traversing-with-pagination/).
This API returns total count of paged resources in `Total-Count` HTTP header.
### Searching
This API uses a generic parameter `search` to expose a full text search mechanism.
## HTTP Methods
This API uses HTTP verbs (methods) as following:
+ `GET` - *Read* - used to **read** (or retrieve) a representation of a resource,
+ `POST` - *Create* - used to **create** new resources. In particular, it's used to create subordinate resources.
+ `PUT` - *Update/Replace* - used for **update** capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. ⚠️ On successful request, replaces identified resource with the request body.
+ `PATCH` - *Update/Modify* - used for **modify** capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
+ `DELETE` - *Delete* - used to **delete** a resource identified by a URI.
## Localization
This API uses `Accept-Language` header to identify the locale.
`Accept-Language: en`
This header SHOULD be present in every request. If not, API MUST use the **english** language/locale.
|
Add Localization
|
Add Localization
|
API Blueprint
|
mit
|
jsynowiec/api-blueprint-boilerplate,jsynowiec/api-blueprint-boilerplate
|
bdf4672ceb6cadfba207a74f564d8f7b503a112d
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# inpassing
A web API for managing the lending and borrowing of passes.
## Group Orgs
## Org [/orgs]
+ Attribute
+ id: 2 (number)
+ name: Locust Valley High School (string)
### Create a new org [POST]
Create a new Org. The authenticated user will become a moderator.
+ Request (application/json)
+ Headers
Authorization: Bearer JWT
+ Body
{
"name": "Locust Valley High School"
}
+ Response 201
+ Headers
Location: /orgs/2
### Search orgs by name [GET /orgs/search{?q}]
+ Parameters
- q: `Locust Valley` (string) - Query string
+ Response 200 (application/json)
[
{
"id": 2,
"name": "Locust Valley High School"
}
]
### Query an org [GET /orgs/{id}]
+ Parameters
- id (number) - Org ID
+ Request Anonymous
Without authentication, only basic information about an org will be returned.
+ Body
+ Response 200 (application/json)
+ Attributes (Org)
+ Request Authenticated
Use authentication to get more information about an org relevant to the user's role in that org.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Org)
+ greeting_fmt: `Today is a {} day` (string) - The greeting format
## Org Participant collection [/orgs/{id}/participants]
### Query participants [GET]
Returns a list of participants of a given org.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[User])
+ Response 403
The authenticated user must be a mod of this organization.
+ Body
### Add user [POST]
Makes a user a participant of an org. This must either be a user adding itself or a mod adding people.
+ Request (application/json)
+ Headers
Authorization: Bearer JWT
+ Attributes
+ user_id: 2 (number) - The user to make a participant of this organization.
+ Response 202 (application/json)
The org will receive the users request to participate in an org.
+ Body
+ Response 204 (application/json)
The user submitted is now a participant of this org.
+ Header
Location: /orgs/2/participants/2
### Query user [GET /orgs/{org_id}/participants/{user_id}]
Returns the user object of an org participant.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (User)
+ Response 404 (application/json)
The user may not exist, or the authenticated user may not have permission to view it.
+ Body
## Org Moderator collection [/orgs/{id}/moderators]
### Query moderators [GET]
Returns a list of moderators of a given org.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[User])
+ Response 403
The authenticated user must be a mod of this organization.
+ Body
### Add user [POST]
Makes a user a mod of an org. The authenticated user must be a moderator itself.
+ Request (application/json)
+ Headers
Authorization: Bearer JWT
+ Attributes
+ user_id: 2 (number) - The user to make a moderator of this organization.
+ Response 204 (application/json)
The user submitted is now a moderator of this org.
+ Header
Location: /orgs/2/moderators/2
### Query user [GET /orgs/{org_id}/moderators/{user_id}]
Returns the user object of an org moderator.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (User)
+ Response 404 (application/json)
The user may not exist, or the authenticated user may not have permission to view it.
+ Body
## Day State [/orgs/{org_id}/daystates]
+ Attributes
+ id: 1 (number) - The ID of the day state.
+ Include Day State Create
### Query state collection [GET]
Return information about an org day state.
+ Parameters
+ org_id: 2 (number) - The org whose states are to be queried.
+ Request
The authenticated user must be a participant or moderator of the org to query states.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Day State])
### Create a state [POST]
Creates a new day state associated with a given organization.
+ Parameters
+ org_id: 2 (number) - The org that will receive the new state.
+ Request
The authenticated user must moderate the org
+ Header
Authorization: Bearer JWT
+ Attributes (Day State Create)
+ Response 201 (application/json)
+ Header
Location: /orgs/2/daystates/2
### Query a state [GET /orgs/{org_id}/daystates/{daystate_id}]
Returns a particular day state object.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
### Update a state [PUT /orgs/{org_id}/daystates/{daystate_id}]
Changes the identifier and/or greeting of a day state.
+ Request (application/json)
+ Header
Authorization: Bearer JWT
+ Attributes
+ identifier: `A` (string, optional)
+ greeting: `Updated greeting - A day` (string, optional)
+ Response 200 (application/json)
+ Attributes (Day State)
### Get the current day state [GET /orgs/{org_id}/daystates/current]
Returns the current day state, this will change on a day by day basis.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
+ Response 404 (application/json)
This occurs when an org has no rules defined for day states (or no day states to begin with).
+ Body
## Group Users
## User [/users]
+ Attributes
+ id (number)
+ first_name (string)
+ last_name (string)
+ email (string)
+ moderates (array[Org])
+ participates (array[Org])
+ passes (array[Pass])
### Create a user [POST]
+ Request (application/json)
+ Attributes
+ first_name: Luke (string) - User first name
+ last_name: San Antonio Bialecki (string) - User last name
+ email: `[email protected]` (string) - User email (used to log in)
+ password: `iUs3tHe$aMepAs$wOrdF0rEvEritHiNg` (string) - User password
+ Response 201
+ Headers
Location: /users/2
### Authenticate as user [POST /users/auth]
+ Request (application/json)
{
"email": "[email protected]",
"password": "iUs3tHe$aMepAs$wOrdF0rEvEritHiNg"
}
+ Response 200 (application/json)
{
"access_token": "<JWT_TOKEN>"
}
+ Response 403 (application/json)
{
"msg": "invalid username or password"
}
## Self [/me]
### Query self [GET]
Returns an object describing the authenticated user.
+ Request
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Body
{
"id": 2,
"first_name": "Luke"
"last_name": "San Antonio Bialecki",
"email": "[email protected]",
"participates": [
{
"id": 2,
"name": "Locust Valley High School"
}
],
"moderates": [
{
"id": 1,
"name": "Test org"
}
],
"passes": [
{
"id": 3,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-03:23:00:12",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": "2017-02-04:07:42:12",
"assigned_state_id": 2,
"assigned_spot_num": 15
},
{
"id": 4,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-06:13:55:32",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": null,
"assigned_state_id": null,
"assigned_spot_num": null
}
]
}
### Borrow a pass [POST /me/borrow]
Creates a request to borrow a pass on behalf of the authenticated user for every day in the date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Stop borrowing a pass [POST /me/unborrow]
Removes a request to borrow a pass on behalf of the authenticated user in a given date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
## Group Passes
## Pass [/passes{?org_id,user_id,verified}]
+ Attributes
+ id: 2 (number) - The pass ID
+ org_id: 1 (number) - The org that this pass belongs to
+ owner_id: 3 (number, nullable) - The user owner of the pass
+ request_time: `2017-02-03;23:00:12` (string) - Date and time of the pass request
+ requested_state_id: 2 (number) - Pass state requested by the user
+ requested_spot_num: 20 (number) - Pass spot requested by the user
+ assigned_time: `2017-02-03;23:15:12` (string, nullable) - Date and time when the pass was assigned / verified
+ assigned_state_id: 2 (number, nullable) - Pass state assigned to this pass
+ assigned_spot_num: 25 (number, nullable) - Pass spot number assigned to this pass
### Query pass collection [GET]
Filters all the passes that the user has access to.
If the user is the mod of an org, all org passes are available to filter.
+ Parameters
+ org_id (number, optional) - Return passes associated with this Org
+ user_id (number, optional) - Return passes associated with this user
+ verified (boolean, optional) - Filter verified passes. If this is null or omitted, all passes will be returned.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Pass])
### Request a new pass [POST]
Requests a new pass from an Org on behalf of the authenticated user.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Attributes
+ org_id: 2 (number) - The Org that the pass is to be requested from
+ state_id: 1 (number) - The requested day state of the pass
+ spot_num: 25 (number) - The requested spot number
+ Response 201 (application/json)
Note that although the pass object exists, the org will still need to verify it for it to be useful.
+ Header
Location: /passes/2
+ Attributes (Pass)
+ assigned_time - null
+ assigned_state_id - null
+ assigned_spot_num - null
### Query pass [GET /passes/{id}]
Get specific pass object
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Pass)
+ Response 403 (application/json)
You can only query passes that you would have access to either as an org moderator or a user!
+ Body
{
"msg": "not authenticated to view this pass",
"error_code": "foreign_pass"
}
### Delete a pass [DELETE /passes/{id}]
Deletes a pass.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 202
### Assign pass [PUT /passes/{id}]
Used to verify passes or re-assign them to different states or spot numbers.
Any changes to the pass resulting from this call will result in `assigned_time` being updated.
+ Request
+ Header
Authorization: Bearer JWT
+ Attributes
+ state_id (number, optional) - The new state of the pass
+ spot_num (number, optional) - The new spot number of the pass
+ Response 200 (application/json)
+ Attributes (Pass)
### Lend a pass [POST /passes/{pass_id}/lend]
Creates a request to lend a pass on behalf of the user for every day in the date range.
The pass will not be lent out on days that the user does not have access to the pass,
but it is not an error to include these days in the date range.
+ Parameters
+ pass_id (number) - The pass to lend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Stop lending a pass [POST /passes/{pass_id}/unlend]
Removes a request to lend a pass on behalf of the user in the given date range.
+ Parameters
+ pass_id (number) - The pass to unlend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
# Data Structures
## Date
+ date: `2017-03-05` (string) - Date
## Date Range (object)
+ start_date: `2017-11-15` (string) - Start date
+ end_date: `2018-01-04` (string) - End date
## Date Selection (enum)
+ (Date)
+ (Date Range)
## Day State Create (object)
+ identifier: M (string) - A recognizable short name / character for the state
+ greeting: `Today is a Monday` (string) - The greeting used to inform clients
of the state of the current day.
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# inpassing
A web API for managing the lending and borrowing of passes.
## Group Orgs
## Org [/orgs]
+ Attribute
+ id: 2 (number)
+ name: Locust Valley High School (string)
### Create a new org [POST]
Create a new Org. The authenticated user will become a moderator.
+ Request (application/json)
+ Headers
Authorization: Bearer JWT
+ Body
{
"name": "Locust Valley High School"
}
+ Response 201
+ Headers
Location: /orgs/2
### Search orgs by name [GET /orgs/search{?q}]
+ Parameters
- q: `Locust Valley` (string) - Query string
+ Response 200 (application/json)
[
{
"id": 2,
"name": "Locust Valley High School"
}
]
### Query an org [GET /orgs/{id}]
+ Parameters
- id (number) - Org ID
+ Request Anonymous
Without authentication, only basic information about an org will be returned.
+ Body
+ Response 200 (application/json)
+ Attributes (Org)
+ Request Authenticated
Use authentication to get more information about an org relevant to the user's role in that org.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Org)
+ greeting_fmt: `Today is a {} day` (string) - The greeting format
## Org Participant collection [/orgs/{id}/participants]
### Query participants [GET]
Returns a list of participants of a given org.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[User])
+ Response 403
The authenticated user must be a mod of this organization.
+ Body
### Add user [POST]
Makes a user a participant of an org. This must either be a user adding itself or a mod adding people.
+ Request (application/json)
+ Headers
Authorization: Bearer JWT
+ Attributes
+ user_id: 2 (number) - The user to make a participant of this organization.
+ Response 202 (application/json)
The org will receive the users request to participate in an org.
+ Body
+ Response 204 (application/json)
The user submitted is now a participant of this org.
+ Header
Location: /orgs/2/participants/2
### Query user [GET /orgs/{org_id}/participants/{user_id}]
Returns the user object of an org participant.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (User)
+ Response 404 (application/json)
The user may not exist, or the authenticated user may not have permission to view it.
+ Body
## Org Moderator collection [/orgs/{id}/moderators]
### Query moderators [GET]
Returns a list of moderators of a given org.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[User])
+ Response 403
The authenticated user must be a mod of this organization.
+ Body
### Add user [POST]
Makes a user a mod of an org. The authenticated user must be a moderator itself.
+ Request (application/json)
+ Headers
Authorization: Bearer JWT
+ Attributes
+ user_id: 2 (number) - The user to make a moderator of this organization.
+ Response 204 (application/json)
The user submitted is now a moderator of this org.
+ Header
Location: /orgs/2/moderators/2
### Query user [GET /orgs/{org_id}/moderators/{user_id}]
Returns the user object of an org moderator.
+ Request
+ Headers
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (User)
+ Response 404 (application/json)
The user may not exist, or the authenticated user may not have permission to view it.
+ Body
## Day State [/orgs/{org_id}/daystates]
+ Attributes
+ id: 1 (number) - The ID of the day state.
+ Include Day State Create
### Query state collection [GET]
Return information about an org day state.
+ Parameters
+ org_id: 2 (number) - The org whose states are to be queried.
+ Request
The authenticated user must be a participant or moderator of the org to query states.
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Day State])
### Create a state [POST]
Creates a new day state associated with a given organization.
+ Parameters
+ org_id: 2 (number) - The org that will receive the new state.
+ Request
The authenticated user must moderate the org
+ Header
Authorization: Bearer JWT
+ Attributes (Day State Create)
+ Response 201 (application/json)
+ Header
Location: /orgs/2/daystates/2
### Query a state [GET /orgs/{org_id}/daystates/{daystate_id}]
Returns a particular day state object.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
### Update a state [PUT /orgs/{org_id}/daystates/{daystate_id}]
Changes the identifier and/or greeting of a day state.
+ Request (application/json)
+ Header
Authorization: Bearer JWT
+ Attributes
+ identifier: `A` (string, optional)
+ greeting: `Updated greeting - A day` (string, optional)
+ Response 200 (application/json)
+ Attributes (Day State)
### Get the current day state [GET /orgs/{org_id}/daystates/current]
Returns the current day state, this will change on a day by day basis.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Day State)
+ Response 404 (application/json)
This occurs when an org has no rules defined for day states (or no day states to begin with).
+ Body
## Group Users
## User [/users]
+ Attributes
+ id (number)
+ first_name (string)
+ last_name (string)
+ email (string)
+ moderates (array[Org])
+ participates (array[Org])
+ passes (array[Pass])
### Create a user [POST]
+ Request (application/json)
+ Attributes
+ first_name: Luke (string) - User first name
+ last_name: San Antonio Bialecki (string) - User last name
+ email: `[email protected]` (string) - User email (used to log in)
+ password: `iUs3tHe$aMepAs$wOrdF0rEvEritHiNg` (string) - User password
+ Response 201
+ Headers
Location: /users/2
### Authenticate as user [POST /users/auth]
+ Request (application/json)
{
"email": "[email protected]",
"password": "iUs3tHe$aMepAs$wOrdF0rEvEritHiNg"
}
+ Response 200 (application/json)
{
"access_token": "<JWT_TOKEN>"
}
+ Response 401 (application/json)
{
"msg": "invalid username or password"
}
## Self [/me]
### Query self [GET]
Returns an object describing the authenticated user.
+ Request
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Body
{
"id": 2,
"first_name": "Luke"
"last_name": "San Antonio Bialecki",
"email": "[email protected]",
"participates": [
{
"id": 2,
"name": "Locust Valley High School"
}
],
"moderates": [
{
"id": 1,
"name": "Test org"
}
],
"passes": [
{
"id": 3,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-03:23:00:12",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": "2017-02-04:07:42:12",
"assigned_state_id": 2,
"assigned_spot_num": 15
},
{
"id": 4,
"org_id": 2,
"owner_id": 2,
"request_time": "2017-02-06:13:55:32",
"requested_state_id": 2,
"requested_spot_num": 20,
"assigned_time": null,
"assigned_state_id": null,
"assigned_spot_num": null
}
]
}
### Borrow a pass [POST /me/borrow]
Creates a request to borrow a pass on behalf of the authenticated user for every day in the date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Stop borrowing a pass [POST /me/unborrow]
Removes a request to borrow a pass on behalf of the authenticated user in a given date range.
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
## Group Passes
## Pass [/passes{?org_id,user_id,verified}]
+ Attributes
+ id: 2 (number) - The pass ID
+ org_id: 1 (number) - The org that this pass belongs to
+ owner_id: 3 (number, nullable) - The user owner of the pass
+ request_time: `2017-02-03;23:00:12` (string) - Date and time of the pass request
+ requested_state_id: 2 (number) - Pass state requested by the user
+ requested_spot_num: 20 (number) - Pass spot requested by the user
+ assigned_time: `2017-02-03;23:15:12` (string, nullable) - Date and time when the pass was assigned / verified
+ assigned_state_id: 2 (number, nullable) - Pass state assigned to this pass
+ assigned_spot_num: 25 (number, nullable) - Pass spot number assigned to this pass
### Query pass collection [GET]
Filters all the passes that the user has access to.
If the user is the mod of an org, all org passes are available to filter.
+ Parameters
+ org_id (number, optional) - Return passes associated with this Org
+ user_id (number, optional) - Return passes associated with this user
+ verified (boolean, optional) - Filter verified passes. If this is null or omitted, all passes will be returned.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Response 200 (application/json)
+ Attributes (array[Pass])
### Request a new pass [POST]
Requests a new pass from an Org on behalf of the authenticated user.
+ Request (application/json)
+ Header
Authentication: Bearer JWT
+ Attributes
+ org_id: 2 (number) - The Org that the pass is to be requested from
+ state_id: 1 (number) - The requested day state of the pass
+ spot_num: 25 (number) - The requested spot number
+ Response 201 (application/json)
Note that although the pass object exists, the org will still need to verify it for it to be useful.
+ Header
Location: /passes/2
+ Attributes (Pass)
+ assigned_time - null
+ assigned_state_id - null
+ assigned_spot_num - null
### Query pass [GET /passes/{id}]
Get specific pass object
+ Request
+ Header
Authorization: Bearer JWT
+ Response 200 (application/json)
+ Attributes (Pass)
+ Response 403 (application/json)
You can only query passes that you would have access to either as an org moderator or a user!
+ Body
{
"msg": "not authenticated to view this pass",
"error_code": "foreign_pass"
}
### Delete a pass [DELETE /passes/{id}]
Deletes a pass.
+ Request
+ Header
Authorization: Bearer JWT
+ Response 202
### Assign pass [PUT /passes/{id}]
Used to verify passes or re-assign them to different states or spot numbers.
Any changes to the pass resulting from this call will result in `assigned_time` being updated.
+ Request
+ Header
Authorization: Bearer JWT
+ Attributes
+ state_id (number, optional) - The new state of the pass
+ spot_num (number, optional) - The new spot number of the pass
+ Response 200 (application/json)
+ Attributes (Pass)
### Lend a pass [POST /passes/{pass_id}/lend]
Creates a request to lend a pass on behalf of the user for every day in the date range.
The pass will not be lent out on days that the user does not have access to the pass,
but it is not an error to include these days in the date range.
+ Parameters
+ pass_id (number) - The pass to lend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
### Stop lending a pass [POST /passes/{pass_id}/unlend]
Removes a request to lend a pass on behalf of the user in the given date range.
+ Parameters
+ pass_id (number) - The pass to unlend
+ Request
+ Header
Authentication: Bearer JWT
+ Attributes (Date Selection)
+ Response 204
# Data Structures
## Date
+ date: `2017-03-05` (string) - Date
## Date Range (object)
+ start_date: `2017-11-15` (string) - Start date
+ end_date: `2018-01-04` (string) - End date
## Date Selection (enum)
+ (Date)
+ (Date Range)
## Day State Create (object)
+ identifier: M (string) - A recognizable short name / character for the state
+ greeting: `Today is a Monday` (string) - The greeting used to inform clients
of the state of the current day.
|
Update doc: auth (/user/auth) failure status code should be 401
|
Update doc: auth (/user/auth) failure status code should be 401
|
API Blueprint
|
mit
|
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
|
999af515a13cfb77ab17eff12a21006756e03736
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: *
# Orchestrator
Component to expose an API to automatise provisioning in all the IoT Platform modules.
# Group Orchestrator
## Services query [/v1.0/service]
### Listado de Services [GET]
+ Response 200 (application/json)
+ Body
{
"domains": [
{
"enabled": true,
"id": "f7a5b8e303ec43e8a912fe26fa79dc02",
"name": "SmartValencia",
"description": "SmartValencia"
},
{
"enabled": true,
"id": "f7a5b8e303ec43e8a912fe26fa79dc03",
"name": "SmartLogrono",
"description": "SmartLogroo"
}
]
}
### Create Service [POST]
+ Request (application/json)
{
"DOMAIN_NAME":"admin_domain",
"DOMAIN_ADMIN_USER":"cloud_admin",
"DOMAIN_ADMIN_PASSWORD": "password",
"NEW_SERVICE_NAME":"SmartValencia",
"NEW_SERVICE_DESCRIPTION":"SmartValencia desc",
"NEW_SERVICE_ADMIN_USER":"adm1",
"NEW_SERVICE_ADMIN_PASSWORD":"password",
"NEW_SERVICE_ADMIN_EMAIL":"[email protected]",
}
+ Response 201 (application/json)
+ Body
{
"id" : 0000
}
## Service manager [/v1.0/service/{serviceId}]
### Get data [GET]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Response 200 (application/json)
+ Body
{
"enabled": true,
"id": "f7a5b8e303ec43e8a912fe26fa79dc02",
"name": "SmartValencia",
"description": "SmartValencia"
}
## Sub-services in service [/v1.0/service/{serviceId}/subservice]
### listado de subservicio [GET]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Response 200 (application/json)
+ Body
{
"projects": [
{
"description": "SmartValencia Subservicio Electricidad",
"id": "c6851f8ef57c4b91b567ab62ca3d0aea",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02",
"name": "Electricidad"
},
{
"description": "SmartValencia Subservicio Basuras",
"id": "c6851f8ef57c4b91b567ab62ca3d0aeb",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc03",
"name": "Basuras"
},
{
"description": "SmartValencia Subservicio Jardines",
"id": "c6851f8ef57c4b91b567ab62ca3d0aec",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc04",
"name": "Jardines"
}
]
}
### edicion de subservicio [PUT]
+ Request (application/json)
{
"SERVICE_NAME":"SmartValencia",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD":"password",
"SUBSERVICE_NAME":"Electricidad",
"NEW_SUBSERVICE_DESCRIPTION":"electricidad new desc",
}
+ Response 201 (application/json)
+ Body
{
"id" : 0000
}
### Create SubService [POST]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Request (application/json)
{
"SERVICE_NAME":"SmartValencia",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD":"password",
"NEW_SUBSERVICE_NAME":"Electricidad",
"NEW_SUBSERVICE_DESCRIPTION":"electricidad desc",
}
+ Response 201 (application/json)
{
"id" : 0000
}
## Sub-service of service [/v1.0/service/{serviceId}/subservice/{subserviceId}]
### listado de subservicio [GET]
+ Response 200 (application/json)
+ Body
{
'description': 'electricidad',
'domain_id': '06b9a460f5c343b3bc8b43f8533f7ab4',
'id': '1119023a10064570a2a3de0b5b286500',
'name': '/Electricidad'}
}
## Roles in service [/v1.0/service/{serviceId}/role]
### List Roles[GET]
+ Parameters
+ serviceId (required, `string`) ... Service
+ Request (application/json)
{
"START_INDEX":"10",
"COUNT":"10",
}
+ Response 200 (application/json)
{
"roles": [
{
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "c80481d244454cc7b796d4acf8625a69",
"name": "aRoleName"
},
{
"domain_id": "91d79dc2211d43a7985ebc27cdd146dg",
"id": "c80481d244454cc7b796d4acf8625a70",
"name": "aRoleName 2"
},
{
"domain_id": "91d79dc2211d43a7985ebc27cdd146dh",
"id": "c80481d244454cc7b796d4acf8625a71",
"name": "aRoleName 3"
}
]
}
### Create a Role[POST]
+ Request (application/json)
{
"SERVICE_NAME":"SmartValencia",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD": "password",
"NEW_ROLE_NAME":"role_NameBlabla"
}
+ Response 201 (application/json)
{
"id" : 0000
}
## Role in Service [/v1.0/service/{serviceId}/role/{roleId}]
### Delete a Role[DELETE]
+ Response 204
## Role assigment [/v1.0/service/{serviceId}/role_assignments{?user_id,subservice_id,role_id,effective}]
### listado de roles asignados [GET]
+ Parameters
+ service_id (required, `string`) ... Domain
+ user_id (optional, `string`) ... User
+ subservice_id (optional, `string`) ... Subservice (aka Project)
+ role_id (optional, `string`) ... Role
+ effective (optional, `boolean`) ... effective
+ Response 200 (application/json)
{
"role_assignments": [
{
"scope": {
"domain": {
"id": "16966e6fdac74225afb4edf801dd9b2a"
}
},
"role": {
"id": "0993967f1ea24a82a72ca4198c16ca20",
"name": "ServiceCustomer",
"domain_id": "16966e6fdac74225afb4edf801dd9b2a"
},
"user": {
"description": "user of domain SmartValencia",
"name": "Carl",
"enabled": true,
"id": "7ee5a828843945a79026d99ae0057bb9",
"domain_id": "16966e6fdac74225afb4edf801dd9b2a"
},
"links": {
"assignment": "http://localhost:5001/v3/domains/16966e6fdac74225afb4edf801dd9b2a/users/7ee5a828843945a79026d99ae0057bb9/roles/0993967f1ea24a82a72ca4198c16ca20"
}
},
{
"scope": {
"domain": {
"id": "16966e6fdac74225afb4edf801dd9b2a"
}
},
"role": {
"id": "0b597039040b4c31b8a13dfe1180c9ff",
"name": "admin"
},
"user": {
"description": "Administrator of domain SmartValencia",
"name": "adm1",
"enabled": true,
"id": "a5c624a8402b48c3931d4600a7fe2be9",
"domain_id": "16966e6fdac74225afb4edf801dd9b2a"
},
"links": {
"assignment": "http://localhost:5001/v3/domains/16966e6fdac74225afb4edf801dd9b2a/users/a5c624a8402b48c3931d4600a7fe2be9/roles/0b597039040b4c31b8a13dfe1180c9ff"
}
}
]
}
### asignacion de rol a usuario [POST]
+ Parameters
+ service_id (required, `string`) ... Domain
+ Request (application/json)
{
"SUBSERVICE_NAME":"Electricidad",
"SUBSERVICE_ID":"234234234234",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD": "password",
"SERVICE_ADMIN_TOKEN": "token",
"ROLE_NAME":"ServiceCustomer",
"ROLE_ID":"sadfasdfasdfas",
"SERVICE_USER_NAME":"user_nameX",
"SERVICE_USER_ID":"asdfasdf",
"INHERIT":true
}
+ Response 201
### rovocar rol a usuario [DELETE]
+ Parameters
+ service_id (required, `string`) ... Domain
+ Request (application/json)
{
"SUBSERVICE_NAME":"Electricidad",
"SUBSERVICE_ID":"234234234234",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD": "password",
"SERVICE_ADMIN_TOKEN": "token",
"ROLE_NAME":"ServiceCustomer",
"ROLE_ID":"sadfasdfasdfas",
"SERVICE_USER_NAME":"user_nameX",
"SERVICE_USER_ID":"asdfasdf",
"INHERIT":true
}
+ Response 204
## Users in Service [/v1.0/service/{serviceId}/user]
### Users list [GET]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Request (application/json)
{
"START_INDEX":"10",
"COUNT":"10",
}
+ Response 200 (application/json)
{
"users" : [
{
"description": "Administrator of domain dom1",
"name": "adm1",
"enabled": true,
"id": "8ac8aa6470c64b5083a6778fc2cd7828",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
},
{
"description": "Alice",
"name": "alice",
"enabled": true,
"id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
},
{
"description": "Bob",
"name": "bob",
"enabled": true,
"id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
},
{
"description": "Alice2",
"name": "alice",
"enabled": true,
"id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
}
]
}
### Create Users [POST]
+ Request (application/json)
{
"NEW_SERVICE_USER_NAME":"user_name_new",
"NEW_SERVICE_USER_PASSWORD":"password",
"NEW_SERVICE_USER_EMAIL":"[email protected]"
}
+ Response 201 (application/json)
{
"id": 00000
}
## User in Service [/v1.0/service/{serviceId}/user/{userId}]
### detail of user[GET]
+ Parameters
+ userId (required, `string`) ... User
+ serviceId (required, `string`) ... Service
+ Response 200 (application/json)
{
"userName": "alice",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
},
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"id": "a5e8c847f7264c5a9f01a22904e3ae93",
"schemas": [
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"
]
}
### update an user[PUT]
+ Request (application/json)
{
"USER_DATA_VALUE": { "emails": [ {"value": "[email protected]"}] }
}
+ Response 200
### delete an user[DELETE]
+ Response 204
|
FORMAT: 1A
HOST: *
# Orchestrator
Component to expose an API to automatise provisioning in all the IoT Platform modules.
# Group Orchestrator
## Services query [/v1.0/service]
### Listado de Services [GET]
+ Response 200 (application/json)
+ Body
{
"domains": [
{
"enabled": true,
"id": "f7a5b8e303ec43e8a912fe26fa79dc02",
"name": "SmartValencia",
"description": "SmartValencia"
},
{
"enabled": true,
"id": "f7a5b8e303ec43e8a912fe26fa79dc03",
"name": "SmartLogrono",
"description": "SmartLogroo"
}
]
}
### Create Service [POST]
+ Request (application/json)
{
"DOMAIN_NAME":"admin_domain",
"DOMAIN_ADMIN_USER":"cloud_admin",
"DOMAIN_ADMIN_PASSWORD": "password",
"NEW_SERVICE_NAME":"SmartValencia",
"NEW_SERVICE_DESCRIPTION":"SmartValencia desc",
"NEW_SERVICE_ADMIN_USER":"adm1",
"NEW_SERVICE_ADMIN_PASSWORD":"password",
"NEW_SERVICE_ADMIN_EMAIL":"[email protected]",
}
+ Response 201 (application/json)
+ Body
{
"id" : 0000
}
## Service manager [/v1.0/service/{serviceId}]
### Get data [GET]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Response 200 (application/json)
+ Body
{
"enabled": true,
"id": "f7a5b8e303ec43e8a912fe26fa79dc02",
"name": "SmartValencia",
"description": "SmartValencia"
}
## Sub-services in service [/v1.0/service/{serviceId}/subservice]
### listado de subservicio [GET]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Response 200 (application/json)
+ Body
{
"projects": [
{
"description": "SmartValencia Subservicio Electricidad",
"id": "c6851f8ef57c4b91b567ab62ca3d0aea",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02",
"name": "Electricidad"
},
{
"description": "SmartValencia Subservicio Basuras",
"id": "c6851f8ef57c4b91b567ab62ca3d0aeb",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc03",
"name": "Basuras"
},
{
"description": "SmartValencia Subservicio Jardines",
"id": "c6851f8ef57c4b91b567ab62ca3d0aec",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc04",
"name": "Jardines"
}
]
}
### edicion de subservicio [PUT]
+ Request (application/json)
{
"SERVICE_NAME":"SmartValencia",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD":"password",
"SUBSERVICE_NAME":"Electricidad",
"NEW_SUBSERVICE_DESCRIPTION":"electricidad new desc",
}
+ Response 201 (application/json)
+ Body
{
"id" : 0000
}
### Create SubService [POST]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Request (application/json)
{
"SERVICE_NAME":"SmartValencia",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD":"password",
"NEW_SUBSERVICE_NAME":"Electricidad",
"NEW_SUBSERVICE_DESCRIPTION":"electricidad desc",
}
+ Response 201 (application/json)
{
"id" : 0000
}
## Sub-service of service [/v1.0/service/{serviceId}/subservice/{subserviceId}]
### listado de subservicio [GET]
+ Response 200 (application/json)
+ Body
{
'description': 'electricidad',
'domain_id': '06b9a460f5c343b3bc8b43f8533f7ab4',
'id': '1119023a10064570a2a3de0b5b286500',
'name': '/Electricidad'}
}
## Roles in service [/v1.0/service/{serviceId}/role]
### List Roles[GET]
+ Parameters
+ serviceId (required, `string`) ... Service
+ Request (application/json)
{
"START_INDEX":"10",
"COUNT":"10",
}
+ Response 200 (application/json)
{
"roles": [
{
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "c80481d244454cc7b796d4acf8625a69",
"name": "aRoleName"
},
{
"domain_id": "91d79dc2211d43a7985ebc27cdd146dg",
"id": "c80481d244454cc7b796d4acf8625a70",
"name": "aRoleName 2"
},
{
"domain_id": "91d79dc2211d43a7985ebc27cdd146dh",
"id": "c80481d244454cc7b796d4acf8625a71",
"name": "aRoleName 3"
}
]
}
### Create a Role[POST]
+ Request (application/json)
{
"SERVICE_NAME":"SmartValencia",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD": "password",
"NEW_ROLE_NAME":"role_NameBlabla"
}
+ Response 201 (application/json)
{
"id" : 0000
}
## Role in Service [/v1.0/service/{serviceId}/role/{roleId}]
### Delete a Role[DELETE]
+ Response 204
## Role assigment [/v1.0/service/{serviceId}/role_assignments{?user_id,subservice_id,role_id,effective}]
### listado de roles asignados [GET]
+ Parameters
+ service_id (required, `string`) ... Domain
+ user_id (optional, `string`) ... User
+ subservice_id (optional, `string`) ... Subservice (aka Project)
+ role_id (optional, `string`) ... Role
+ effective (optional, `boolean`) ... effective
+ Response 200 (application/json)
{
"role_assignments": [
{
"scope": {
"domain": {
"id": "16966e6fdac74225afb4edf801dd9b2a"
}
},
"role": {
"id": "0993967f1ea24a82a72ca4198c16ca20",
"name": "ServiceCustomer",
"domain_id": "16966e6fdac74225afb4edf801dd9b2a"
},
"user": {
"description": "user of domain SmartValencia",
"name": "Carl",
"enabled": true,
"id": "7ee5a828843945a79026d99ae0057bb9",
"domain_id": "16966e6fdac74225afb4edf801dd9b2a"
},
"links": {
"assignment": "http://localhost:5001/v3/domains/16966e6fdac74225afb4edf801dd9b2a/users/7ee5a828843945a79026d99ae0057bb9/roles/0993967f1ea24a82a72ca4198c16ca20"
}
},
{
"scope": {
"domain": {
"id": "16966e6fdac74225afb4edf801dd9b2a"
}
},
"role": {
"id": "0b597039040b4c31b8a13dfe1180c9ff",
"name": "admin"
},
"user": {
"description": "Administrator of domain SmartValencia",
"name": "adm1",
"enabled": true,
"id": "a5c624a8402b48c3931d4600a7fe2be9",
"domain_id": "16966e6fdac74225afb4edf801dd9b2a"
},
"links": {
"assignment": "http://localhost:5001/v3/domains/16966e6fdac74225afb4edf801dd9b2a/users/a5c624a8402b48c3931d4600a7fe2be9/roles/0b597039040b4c31b8a13dfe1180c9ff"
}
}
]
}
### asignacion de rol a usuario [POST]
+ Parameters
+ service_id (required, `string`) ... Domain
+ Request (application/json)
{
"SUBSERVICE_NAME":"Electricidad",
"SUBSERVICE_ID":"234234234234",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD": "password",
"SERVICE_ADMIN_TOKEN": "token",
"ROLE_NAME":"ServiceCustomer",
"ROLE_ID":"sadfasdfasdfas",
"SERVICE_USER_NAME":"user_nameX",
"SERVICE_USER_ID":"asdfasdf",
"INHERIT":true
}
+ Response 201
### rovocar rol a usuario [DELETE]
+ Parameters
+ service_id (required, `string`) ... Domain
+ Request (application/json)
{
"SUBSERVICE_NAME":"Electricidad",
"SUBSERVICE_ID":"234234234234",
"SERVICE_ADMIN_USER":"adm1",
"SERVICE_ADMIN_PASSWORD": "password",
"SERVICE_ADMIN_TOKEN": "token",
"ROLE_NAME":"ServiceCustomer",
"ROLE_ID":"sadfasdfasdfas",
"SERVICE_USER_NAME":"user_nameX",
"SERVICE_USER_ID":"asdfasdf",
"INHERIT":true
}
+ Response 204
## Users in Service [/v1.0/service/{serviceId}/user]
### Users list [GET]
+ Parameters
+ serviceId (required, `string`) ... Service Id
+ Request (application/json)
{
"START_INDEX":"10",
"COUNT":"10",
}
+ Response 200 (application/json)
{
"users" : [
{
"description": "Administrator of domain dom1",
"name": "adm1",
"enabled": true,
"id": "8ac8aa6470c64b5083a6778fc2cd7828",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
},
{
"description": "Alice",
"name": "alice",
"enabled": true,
"id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
},
{
"description": "Bob",
"name": "bob",
"enabled": true,
"id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
},
{
"description": "Alice2",
"name": "alice",
"enabled": true,
"id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
"domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02"
}
]
}
### Create Users [POST]
+ Request (application/json)
{
"NEW_SERVICE_USER_NAME":"user_name_new",
"NEW_SERVICE_USER_PASSWORD":"password",
"NEW_SERVICE_USER_EMAIL":"[email protected]",
"NEW_SERVICE_USER_DESCRIPTION":"user description"
}
+ Response 201 (application/json)
{
"id": 00000
}
## User in Service [/v1.0/service/{serviceId}/user/{userId}]
### detail of user[GET]
+ Parameters
+ userId (required, `string`) ... User
+ serviceId (required, `string`) ... Service
+ Response 200 (application/json)
{
"userName": "alice",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
},
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"id": "a5e8c847f7264c5a9f01a22904e3ae93",
"schemas": [
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"
]
}
### update an user[PUT]
+ Request (application/json)
{
"USER_DATA_VALUE": { "emails": [ {"value": "[email protected]"}] }
}
+ Response 200
### delete an user[DELETE]
+ Response 204
|
update apirary doc for create a new user
|
update apirary doc for create a new user
|
API Blueprint
|
agpl-3.0
|
telefonicaid/orchestrator,telefonicaid/orchestrator
|
ee013b2a4ccd066ce1357ed01e541f0d620283c0
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/articles/{id}]
A single Article object with all its details
+ Parameters
+ id (required, string, `foo-bar`) ... String `id` of the Article to perform action with. Has example value.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `cy`) ... Locale of the Article.
+ id (required, string, `foo-bar`) ... ID of the Article.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
|
Add locale to API Blueprint
|
Add locale to API Blueprint
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
fe9fcd832c3dd51d413b79451e45fae9ed828086
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# MuhApi
Muh api provides a in memory paste service, which immediately
stores your pastes. It is optimized on low latency access.
## Gist
A gist is just the logical layer on top of snippets.
It could also be called as a SnippetCollection.
## Gist/Snippet handling [/gists]
Creating gists, adding snippets and requesting gists.
### Fetching a Gist [GET /gists/{uuid}]
+ Parameters
+ uuid (string) - Gists unique identifier
+ Response 200 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Attributes(Gist full)
+ Body
### Create a gist with snippets [POST /gists]
+ Request (application/x-www-form-urlencoded)
+ Attributes(Snippet)
+ Body
snippets[0]paste=somerubycode&
snippets[0]lang=ruby&
snippets[1]paste=moarrubycode&
snippets[1]lang=ruby
+ Response 201 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Attributes(Gist short)
+ Body
# Data Structures
## Gist short (object)
+ gist:
+ uuid: `2059d36c-cd5a-4271-8abd-cf184f04db7c` (string, required) - Unique gist identifier.
## Gist full (object)
+ gist:
+ uuid: `2059d36c-cd5a-4271-8abd-cf184f04db7c` (string, required) - Unique gist identifier.
+ snippets: (array[Snippet]) - A list of snippets
## Snippet (object)
+ paste: `some ruby code` (string, required) - Raw content of paste.
+ lang: `ruby` (string, required) - Which kind of programming language the paste is.
|
FORMAT: 1A
HOST: https://muh.io/
# MuhApi
Muh api provides a in memory paste service, which immediately
stores your pastes. It is optimized on low latency access.
## Gist
A gist is just the logical layer on top of snippets.
It could also be called as a SnippetCollection.
## Gist/Snippet handling [/gists]
Creating gists, adding snippets and requesting gists.
### Fetching a Gist [GET /gists/{uuid}]
+ Parameters
+ uuid (string) - Gists unique identifier
+ Response 200 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Attributes(Gist full)
+ Body
### Create a gist with snippets [POST /gists]
+ Request (application/x-www-form-urlencoded)
+ Attributes(Snippet)
+ Body
snippets[0]paste=somerubycode&
snippets[0]lang=ruby&
snippets[1]paste=moarrubycode&
snippets[1]lang=ruby
+ Response 201 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Attributes(Gist short)
+ Body
# Data Structures
## Gist short (object)
+ gist:
+ uuid: `2059d36c-cd5a-4271-8abd-cf184f04db7c` (string, required) - Unique gist identifier.
## Gist full (object)
+ gist:
+ uuid: `2059d36c-cd5a-4271-8abd-cf184f04db7c` (string, required) - Unique gist identifier.
+ snippets: (array[Snippet]) - A list of snippets
## Snippet (object)
+ paste: `some ruby code` (string, required) - Raw content of paste.
+ lang: `ruby` (string, required) - Which kind of programming language the paste is.
|
Update apiary blueprint - set host constant
|
Update apiary blueprint - set host constant
|
API Blueprint
|
apache-2.0
|
muhproductions/muh
|
457aa59f59612e1baf464d1a6947ea361e72bcc5
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://nexpose.local:3780
# ControlsInsight
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Assessments
## Assessment Collection [/assessments]
### Assessments [GET]
+ Response 200 (application/json)
{
"id": 1,
"assessing": false,
"highRiskAssetCount": 0,
"mediumRiskAssetCount": 24,
"lowRiskAssetCount": 0,
"totalAssetCount": 24,
"overallRiskScore": 4.004146038088617,
"timestamp": 1393184605912
}
## Assessment [/assessments/{assessment_id}]
### Assessment by ID [GET]
+ Parameters
+ assessment_id (optional, integer, `1`) ... The ID of the assessment to retreive.
+ Response 200 (application/json)
{
"id": 1,
"assessing": false,
"highRiskAssetCount": 0,
"mediumRiskAssetCount": 24,
"lowRiskAssetCount": 0,
"totalAssetCount": 24,
"overallRiskScore": 4.004146038088617,
"timestamp": 1393184605912
}
# Group Search
## Assets [/assets/search?query={query}]
### Asset Search [GET]
+ Parameters
+ query (required, string, `10.4.19`) ... The free text query. This can be a full/partial hostname or IP address.
+ Response 200 (application/json)
[
{
"uuid": "db899a57-347c-4df9-9ce2-6932dc4adf38>",
"riskScore": 5.554266115196547,
"riskLevel": "MEDIUM",
"hostName": "CMMNCTR2K7R2-U",
"ipaddress": "10.4.19.25"
}
]
|
FORMAT: 1A
HOST: https://nexpose.local:3780/insight/controls/api/
# ControlsInsight
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Assessments
## Assessment Collection [/assessments]
### Assessments [GET]
+ Response 200 (application/json)
{
"id": 1,
"assessing": false,
"highRiskAssetCount": 0,
"mediumRiskAssetCount": 24,
"lowRiskAssetCount": 0,
"totalAssetCount": 24,
"overallRiskScore": 4.004146038088617,
"timestamp": 1393184605912
}
## Assessment [/assessments/{assessment_id}]
### Assessment by ID [GET]
+ Parameters
+ assessment_id (optional, integer, `1`) ... The ID of the assessment to retreive.
+ Response 200 (application/json)
{
"id": 1,
"assessing": false,
"highRiskAssetCount": 0,
"mediumRiskAssetCount": 24,
"lowRiskAssetCount": 0,
"totalAssetCount": 24,
"overallRiskScore": 4.004146038088617,
"timestamp": 1393184605912
}
# Group Search
## Assets [/assets/search?query={query}]
### Asset Search [GET]
+ Parameters
+ query (required, string, `10.4.19`) ... The free text query. This can be a full/partial hostname or IP address.
+ Response 200 (application/json)
[
{
"uuid": "db899a57-347c-4df9-9ce2-6932dc4adf38>",
"riskScore": 5.554266115196547,
"riskLevel": "MEDIUM",
"hostName": "CMMNCTR2K7R2-U",
"ipaddress": "10.4.19.25"
}
]
|
Update HOST to match API_ENDPOINT format
|
Update HOST to match API_ENDPOINT format
|
API Blueprint
|
bsd-3-clause
|
rapid7/controls.rb,erran/controls.rb
|
5bca02f6996f3dfe262dae0c79d5ecf21485cd74
|
SUNRISE-SUNSET-API-BLUEPRINT.apib
|
SUNRISE-SUNSET-API-BLUEPRINT.apib
|
FORMAT: 1A
Sunrise and Sunset API
=============================
# General information
This is technical documentation for the Sunrise and Sunset API
This document uses [API blueprint format](https://apiblueprint.org/documentation/).
This is a service to compute the local sunrise and sunset at a given longitue/latitude and date(s) combination.
Uses the algorithm found at:
Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392
http://web.archive.org/web/20161202180207/http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
NOTE: For locations inside polar circles service may not return all sunrise/sunset values.
### Authentication
All endpoints are **secured** with HTTP basic authorization and data are transmitted over HTTPS protocol.
If you want to get access please use [request form](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951).
#Sunrise and Sunset
+ Parameters
+ meteoGroupStationIds: `3007237,3007238` (string, optional) - MeteoGroup station ids; can be several stations separated by comma. Either the meteoGroupStationIds or locatedAt parameter must be specified at once;
+ locatedAt: `-2.2323,47.4593` (string, optional) - longitude, latitude; or `g9p734o7sC-36xi5iyD` - compressed list of locations, using Microsoft Point Compression Algorithm, is efficient for up to 400 locations;
+ validAt(deprecated): `2016-12-27` (string, optional) - ISO8601 date notation. Represents the day for which the sunrise and sunset data should be returned;
+ validFrom: `2016-12-27` (string, optional) - ISO8601 date notation. Represents the first of period, for which the sunrise and sunset data should be returned, inclusive;
+ validUntil: `2016-12-27` (string, optional) - ISO8601 date notation. Represents the last of period, for which the sunrise and sunset data should be returned, inclusive.
NOTE.
- if no any among validAt, validFrom and validUntil is specified the service returns data for the current day
- if an only one among validFrom and validUntil is specified the service returns data for this single day
- if validAt and any of validFrom or validUntil is specified the service returns response with 400 status code
- if difference between validFrom and validUntil is bigger than one year the service returns response with 400 status code
### Get a sunrise and sunset time for a single station id [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?meteoGroupStationIds=3007237&validAt=2016-12-27'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"civilSunsetTime": "2016-12-27T18:00+01:00",
"nauticalSunriseTime": "2016-12-27T07:42+01:00",
"astronomicalSunriseTime": "2016-12-27T07:05+01:00",
"astronomicalSunsetTime": "2016-12-27T19:17+01:00",
"nauticalSunsetTime": "2016-12-27T18:40+01:00",
"officialSunriseTime": "2016-12-27T08:58+01:00",
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T08:22+01:00",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:24+01:00"
}
]
}
### Get a sunrise and sunset time for a single station id and multiple dates [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?meteoGroupStationIds=3007237&validFrom=2016-12-27&validUntil=2016-12-28'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"civilSunsetTime": "2016-12-27T18:00+01:00",
"nauticalSunriseTime": "2016-12-27T07:42+01:00",
"astronomicalSunriseTime": "2016-12-27T07:05+01:00",
"astronomicalSunsetTime": "2016-12-27T19:17+01:00",
"nauticalSunsetTime": "2016-12-27T18:40+01:00",
"officialSunriseTime": "2016-12-27T08:58+01:00",
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T08:22+01:00",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:24+01:00"
},
{
"civilSunsetTime": "2016-12-28T18:01+01:00",
"nauticalSunriseTime": "2016-12-28T07:43+01:00",
"astronomicalSunriseTime": "2016-12-28T07:05+01:00",
"astronomicalSunsetTime": "2016-12-28T19:18+01:00",
"nauticalSunsetTime": "2016-12-28T18:40+01:00",
"officialSunriseTime": "2016-12-28T08:58+01:00",
"validAt": "2016-12-28",
"civilSunriseTime": "2016-12-28T08:22+01:00",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-28T17:25+01:00"
}
]
}
### Get a sunrise and sunset time for multiple station ids [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?meteoGroupStationIds=3007237,3007238&validAt=2016-12-27'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"civilSunsetTime": "2016-12-27T18:00+01:00",
"nauticalSunriseTime": "2016-12-27T07:42+01:00",
"astronomicalSunriseTime": "2016-12-27T07:05+01:00",
"astronomicalSunsetTime": "2016-12-27T19:17+01:00",
"nauticalSunsetTime": "2016-12-27T18:40+01:00",
"officialSunriseTime": "2016-12-27T08:58+01:00",
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T08:22+01:00",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:24+01:00"
},
{
"civilSunsetTime": "2016-12-27T18:00+01:00",
"nauticalSunriseTime": "2016-12-27T07:43+01:00",
"astronomicalSunriseTime": "2016-12-27T07:05+01:00",
"astronomicalSunsetTime": "2016-12-27T19:17+01:00",
"nauticalSunsetTime": "2016-12-27T18:39+01:00",
"officialSunriseTime": "2016-12-27T08:59+01:00",
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T08:23+01:00",
"meteoGroupStationId": "3007238",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:23+01:00"
}
]
}
### Get a sunrise and sunset time for a single location [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?locatedAt=13,52&validAt=2016-12-27'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"civilSunsetTime": "2016-12-27T16:44+01:00",
"nauticalSunriseTime": "2016-12-27T06:52+01:00",
"astronomicalSunriseTime": "2016-12-27T06:10+01:00",
"astronomicalSunsetTime": "2016-12-27T18:09+01:00",
"nauticalSunsetTime": "2016-12-27T17:27+01:00",
"officialSunriseTime": "2016-12-27T08:16+01:00",
"locatedAt": [
13,
52
],
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T07:35+01:00",
"locationTimeZoneName": "Europe/Berlin",
"officialSunsetTime": "2016-12-27T16:03+01:00"
}
]
}
### Get a sunrise and sunset time for multiple encoded locations [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?locatedAt=g9p734o7sC-36xi5iyD&validAt=2016-12-27'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"civilSunsetTime": "2016-12-27T16:44+01:00",
"nauticalSunriseTime": "2016-12-27T06:52+01:00",
"astronomicalSunriseTime": "2016-12-27T06:10+01:00",
"astronomicalSunsetTime": "2016-12-27T18:09+01:00",
"nauticalSunsetTime": "2016-12-27T17:27+01:00",
"officialSunriseTime": "2016-12-27T08:16+01:00",
"locatedAt": [
13,
52
],
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T07:35+01:00",
"locationTimeZoneName": "Europe/Berlin",
"officialSunsetTime": "2016-12-27T16:03+01:00"
},
{
"civilSunsetTime": "2016-12-27T17:11+02:00",
"nauticalSunriseTime": "2016-12-27T07:00+02:00",
"astronomicalSunriseTime": "2016-12-27T06:21+02:00",
"astronomicalSunsetTime": "2016-12-27T18:30+02:00",
"nauticalSunsetTime": "2016-12-27T17:51+02:00",
"officialSunriseTime": "2016-12-27T08:18+02:00",
"locatedAt": [
24,
49
],
"validAt": "2016-12-27",
"civilSunriseTime": "2016-12-27T07:40+02:00",
"locationTimeZoneName": "Europe/Kiev",
"officialSunsetTime": "2016-12-27T16:33+02:00"
}
]
}
#
|
FORMAT: 1A
Sunrise and Sunset API
=============================
# General information
This is technical documentation for the Sunrise and Sunset API
This document uses [API blueprint format](https://apiblueprint.org/documentation/).
This is a service to compute the local sunrise and sunset at a given longitue/latitude and date(s) combination.
Uses the algorithm found at:
Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392
http://web.archive.org/web/20161202180207/http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
NOTE: For locations inside polar circles service may not return all sunrise/sunset values.
### Authentication
All endpoints are **secured** with HTTP basic authorization and data are transmitted over HTTPS protocol.
If you want to get access please use [request form](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951).
#Sunrise and Sunset
+ Parameters
+ meteoGroupStationIds: `3007237,3007238` (string, optional) - MeteoGroup station ids; can be several stations separated by comma. Either the meteoGroupStationIds or locatedAt parameter must be specified at once;
+ locatedAt: `-2.2323,47.4593` (string, optional) - longitude, latitude; or `g9p734o7sC-36xi5iyD` - compressed list of locations, using Microsoft Point Compression Algorithm, is efficient for up to 400 locations;
+ validAt(deprecated): `2016-12-27` (string, optional) - ISO8601 date notation. Represents the day for which the sunrise and sunset data should be returned;
+ validFrom: `2016-12-27` (string, optional) - ISO8601 date notation. Represents the first of period, for which the sunrise and sunset data should be returned, inclusive;
+ validUntil: `2016-12-27` (string, optional) - ISO8601 date notation. Represents the last of period, for which the sunrise and sunset data should be returned, inclusive.
+ fields: `beginOfMorningAstronomicalTwilight,endOfMorningAstronomicalTwilight`(string, required) - comma separated list of parameters to be contained inside a response. All possible names are present in section 'Fields names'
## Fields names
locatedAt, meteoGroupStationId, validAt, locationTimeZoneName, officialSunriseTime, officialSunsetTime,
beginOfMorningAstronomicalTwilight, endOfMorningAstronomicalTwilight, beginOfEveningAstronomicalTwilight, endOfEveningAstronomicalTwilight,
beginOfMorningCivilTwilight, endOfMorningCivilTwilight, beginOfEveningCivilTwilight, endOfEveningCivilTwilight,
beginOfMorningNauticalTwilight, endOfMorningNauticalTwilight, beginOfEveningNauticalTwilight, endOfEveningNauticalTwilight.
NOTE.
- if no any among validAt, validFrom and validUntil is specified the service returns data for the current day
- if an only one among validFrom and validUntil is specified the service returns data for this single day
- if validAt and any of validFrom or validUntil is specified the service returns response with 400 status code
- if difference between validFrom and validUntil is bigger than one year the service returns response with 400 status code
### Get a sunrise and sunset time for a single station id [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?meteoGroupStationIds=3007237&validAt=2016-12-27&fields=beginOfMorningAstronomicalTwilight,endOfMorningCivilTwilight,endOfMorningNauticalTwilight,officialSunriseTime,locatedAt,validAt,endOfEveningAstronomicalTwilight,beginOfMorningNauticalTwilight,beginOfEveningCivilTwilight,officialSunsetTime,endOfEveningNauticalTwilight,endOfEveningCivilTwilight,beginOfEveningAstronomicalTwilight,beginOfEveningNauticalTwilight,meteoGroupStationId,locationTimeZoneName,beginOfMorningCivilTwilight,endOfMorningAstronomicalTwilight'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"beginOfMorningAstronomicalTwilight": "2016-12-27T07:05+01:00",
"endOfMorningCivilTwilight": "2016-12-27T08:58+01:00",
"endOfMorningNauticalTwilight": "2016-12-27T08:58+01:00",
"officialSunriseTime": "2016-12-27T08:58+01:00",
"validAt": "2016-12-27",
"endOfEveningAstronomicalTwilight": "2016-12-27T19:17+01:00",
"beginOfMorningNauticalTwilight": "2016-12-27T07:42+01:00",
"beginOfEveningCivilTwilight": "2016-12-27T17:24+01:00",
"officialSunsetTime": "2016-12-27T17:24+01:00",
"endOfEveningNauticalTwilight": "2016-12-27T18:40+01:00",
"endOfEveningCivilTwilight": "2016-12-27T18:00+01:00",
"beginOfEveningAstronomicalTwilight": "2016-12-27T17:24+01:00",
"beginOfEveningNauticalTwilight": "2016-12-27T17:24+01:00",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"beginOfMorningCivilTwilight": "2016-12-27T08:22+01:00",
"endOfMorningAstronomicalTwilight": "2016-12-27T08:58+01:00"
}
]
}
### Get a sunrise and sunset time for a single station id and multiple dates [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?meteoGroupStationIds=3007237&validFrom=2016-12-27&validUntil=2016-12-28&fields=officialSunriseTime,officialSunsetTime'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"officialSunriseTime": "2016-12-27T08:58+01:00",
"validAt": "2016-12-27",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:24+01:00"
},
{
"officialSunriseTime": "2016-12-28T08:58+01:00",
"validAt": "2016-12-28",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-28T17:25+01:00"
}
]
}
### Get a sunrise and sunset time for multiple station ids [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?meteoGroupStationIds=3007237,3007238&validAt=2016-12-27&fields=officialSunriseTime,officialSunsetTime'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"officialSunriseTime": "2016-12-27T08:58+01:00",
"validAt": "2016-12-27",
"meteoGroupStationId": "3007237",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:24+01:00"
},
{
"officialSunriseTime": "2016-12-27T08:59+01:00",
"validAt": "2016-12-27",
"meteoGroupStationId": "3007238",
"locationTimeZoneName": "Europe/Paris",
"officialSunsetTime": "2016-12-27T17:23+01:00"
}
]
}
### Get a sunrise and sunset time for a single location [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?locatedAt=13,52&validAt=2016-12-27&fields=officialSunriseTime,officialSunsetTime'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"officialSunriseTime": "2016-12-27T08:16+01:00",
"locatedAt": [
13,
52
],
"validAt": "2016-12-27",
"locationTimeZoneName": "Europe/Berlin",
"officialSunsetTime": "2016-12-27T16:03+01:00"
}
]
}
### Get a sunrise and sunset time for multiple encoded locations [GET]
####An example
'https://point-forecast.weather.mg/sunrise-sunset?locatedAt=g9p734o7sC-36xi5iyD&validAt=2016-12-27&fields=officialSunriseTime,officialSunsetTime'
+ Response 200 (application/json)
+ Headers
Content-Type: application/json
Cache-Control: max-age=90
+ Body
{
"sunriseSunsetTime": [
{
"officialSunriseTime": "2016-12-27T08:16+01:00",
"locatedAt": [
13,
52
],
"validAt": "2016-12-27",
"locationTimeZoneName": "Europe/Berlin",
"officialSunsetTime": "2016-12-27T16:03+01:00"
},
{
"officialSunriseTime": "2016-12-27T08:18+02:00",
"locatedAt": [
24,
49
],
"validAt": "2016-12-27",
"locationTimeZoneName": "Europe/Kiev",
"officialSunsetTime": "2016-12-27T16:33+02:00"
}
]
}
|
Add information about 'fields' request parameter
|
[SunriseSunset] Add information about 'fields' request parameter
|
API Blueprint
|
apache-2.0
|
MeteoGroup/weather-api,MeteoGroup/weather-api
|
fc039ecd935676e359114575617bc7240351b60e
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://outfit-pingeon-staging.herokuapp.com/
# Pingeon
Notification Microservice.
## Send a pub/sub message to a channel [/provider/pubsub/channel]
### /provider/pubsub/channel [POST]
+ Request (application/json)
{
"channel": "stream",
"message": {"text": "Hello!"}
}
+ Response 201
{
"channel": "stream",
"message": {"text": "Hello!"},
"statusCode": 200
}
## Send a pub/sub message to a recipient [/provider/pubsub/recipient]
### /provider/pubsub/recipient [POST]
+ Request (application/json)
{
"recipientId": "1",
"message": {"text": "Hello!"}
}
+ Response 201
[{
"channel": "stream",
"message": {"text": "Hello!"},
"statusCode": 200
}]
## Send a message to an email address [/provider/email/address]
### /provider/email/address [POST]
+ Request (application/json)
{
"address": "[email protected]",
"template": "thanks-for-register",
"vars": {
"name": "Kostyan"
},
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"subject": "some subject"
}
+ Response 201
[{
"email":"[email protected]",
"status":"sent",
"_id":"13lf45gw5","reject_reason":null
}]
## Send a message to an email address [/provider/email/recipient]
### /provider/email/recipient [POST]
+ Request (application/json)
{
"recipientId": "1",
"vars": {
"name": "Kostyan"
},
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"message": "some message",
"subject": "some subject"
}
+ Response 201
[{
"email":"[email protected]",
"status":"sent",
"_id":"13lf45gw5","reject_reason":null
}]
## Send a push notification to a recipient [/provider/push/recipient]
### /provider/push/recipient [POST]
+ Request (application/json)
{
"recipientId": "1",
"message": "Hello",
"payload": {}
}
+ Response 201
[{
"message": "Hello",
"providerMessageId": "2",
"payload": {},
"sendDate": "2016-05-20T17:19:15.602Z",
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
}]
## Send a push notification to specific device [/provider/push/token]
### /provider/push/token [POST]
+ Request (application/json)
{
"token": "1",
"message": "Hello",
"payload": {}
}
+ Response 201
{
"message": "Hello",
"providerMessageId": "2",
"payload": {},
"sendDate": "2016-05-20T17:19:15.602Z",
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
}
## Send a batch of notifications [/notification/batch]
### /notification/batch [POST]
+ Request (application/json)
{
"recipients": ["1", "2"],
"providers": {
"email": {
"template": "new-comment-on-inspection",
"vars": { "inspectionId": 1234567 },
"addresses": ["[email protected]", "[email protected]"]
},
"push": {
"message": "New comment on inspection #1234567",
"payload": {
"link": "inspection://inspection/123567/#comment-1234567"
},
"tokens": ["1", "2"]
},
"pubsub": {
"message": "New comment on inspection #1234567",
"channels": ["some"]
}
}
}
+ Response 201
{
"status": "queued"
}
## Recipients [/recipients]
### Create new recipient instance [POST]
+ Request (application/json)
{
"id": "57472118fc2805aa3556770c",
"firstName": "John",
"lastName": "Testerson"
}
+ Response 201
{
"id": "57472118fc2805aa3556770c",
"firstName": "John",
"lastName": "Testerson"
}
### Find all recipients [GET]
+ Response 200
[{
"id": "57472118fc2805aa3556770c``",
"firstName": "John",
"lastName": "Testerson"
}]
## Recipients [/recipients/{id}]
### Get recipient instance [GET]
+ Parameters
+ id: 57472118fc2805aa3556770c (string) - id of the recipient
+ Response 200
{
"id": "57472118fc2805aa3556770c"
}
## Recipient profiles [/recipients/{recipientId}/profiles/{providerType}]
### Create new recipient profile instance [POST]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ providerType: email (string) - email/push/pubsub/etc
+ Request (application/json)
{
"id": "57472118fc2805aa3556770d",
"address": "[email protected]"
}
+ Response 201
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "email",
"address": "[email protected]"
}
### Find all recipient profiles [GET]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ providerType: email (string) - email/push/pubsub/etc
+ Response 200
[{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770d",
"providerType": "email",
"address": "[email protected]"
}]
## Recipient profiles [/recipients/{recipientId}/profiles/{providerType}/{id}]
### Get recipient instance [GET]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ providerType: email (string) - email/push/pubsub/etc
+ id: 57472118fc2805aa3556770d (string) - id of the recipient profile
+ Response 200
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "email",
"address": "[email protected]"
}
## Push recipient profile [/recipients/{recipientId}/profiles/push/register]
### Register [POST]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ Request (application/json)
{
"platform": "ios",
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660"
}
+ Response 201
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "push",
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660",
"registeredDate": "Mon May 30 2016 16:18:35 GMT+0300 (EEST)"
}
## Push recipient profile [/recipients/{recipientId}/profiles/push/register]
### Unregister [POST]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ Request (application/json)
{
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c"
}
+ Response 201
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "push",
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660",
"registeredDate": "Mon May 30 2016 16:18:35 GMT+0300 (EEST)"
}
|
FORMAT: 1A
HOST: http://outfit-pingeon-staging.herokuapp.com/
# Pingeon
Notification Microservice.
## Send a pub/sub message to a channel [/provider/pubsub/channel]
### /provider/pubsub/channel [POST]
+ Request (application/json)
{
"channel": "stream",
"message": {"text": "Hello!"}
}
+ Response 201
{
"channel": "stream",
"message": {"text": "Hello!"},
"statusCode": 200
}
## Send a pub/sub message to a recipient [/provider/pubsub/recipient]
### /provider/pubsub/recipient [POST]
+ Request (application/json)
{
"recipientId": "1",
"message": {"text": "Hello!"}
}
+ Response 201
[{
"channel": "stream",
"message": {"text": "Hello!"},
"statusCode": 200
}]
## Send a message to an email address [/provider/email/address]
### /provider/email/address [POST]
+ Request (application/json)
{
"address": "[email protected]",
"template": "thanks-for-register",
"vars": {
"name": "Kostyan"
},
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"subject": "some subject"
}
+ Response 201
[{
"email":"[email protected]",
"status":"sent",
"_id":"13lf45gw5","reject_reason":null
}]
## Send a message to an email address [/provider/email/recipient]
### /provider/email/recipient [POST]
+ Request (application/json)
{
"recipientId": "1",
"vars": {
"name": "Kostyan"
},
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"message": "some message",
"subject": "some subject"
}
+ Response 201
[{
"email":"[email protected]",
"status":"sent",
"_id":"13lf45gw5","reject_reason":null
}]
## Send a push notification to a recipient [/provider/push/recipient]
### /provider/push/recipient [POST]
+ Request (application/json)
{
"recipientId": "1",
"message": "Hello",
"payload": {}
}
+ Response 201
[{
"message": "Hello",
"providerMessageId": "2",
"payload": {},
"sendDate": "2016-05-20T17:19:15.602Z",
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
}]
## Send a push notification to specific device [/provider/push/token]
### /provider/push/token [POST]
+ Request (application/json)
{
"token": "1",
"message": "Hello",
"payload": {}
}
+ Response 201
{
"message": "Hello",
"providerMessageId": "2",
"payload": {},
"sendDate": "2016-05-20T17:19:15.602Z",
"platformApplicationArn":"arn:aws:sns:us-east-1:1:app/APNS_SANDBOX/1"
}
## Send a batch of notifications [/notification/batch]
### /notification/batch [POST]
+ Request (application/json)
{
"recipients": ["1", "2"],
"providers": {
"email": {
"template": "new-comment-on-inspection",
"vars": { "inspectionId": 1234567 },
"addresses": ["[email protected]", "[email protected]"]
},
"push": {
"message": "New comment on inspection #1234567",
"payload": {
"link": "inspection://inspection/123567/#comment-1234567"
},
"tokens": ["1", "2"]
},
"pubsub": {
"message": "New comment on inspection #1234567",
"channels": ["some"]
}
}
}
+ Response 201
{
"status": "queued"
}
## Recipients [/recipients]
### Create new recipient instance [POST]
+ Request (application/json)
{
"id": "57472118fc2805aa3556770c",
"firstName": "John",
"lastName": "Testerson"
}
+ Response 201
{
"id": "57472118fc2805aa3556770c",
"firstName": "John",
"lastName": "Testerson"
}
### Find all recipients [GET]
+ Response 200
[{
"id": "57472118fc2805aa3556770c``",
"firstName": "John",
"lastName": "Testerson"
}]
## Recipient instance [/recipients/{id}]
### Get recipient instance [GET]
+ Parameters
+ id: 57472118fc2805aa3556770c (string) - id of the recipient
+ Response 200
{
"id": "57472118fc2805aa3556770c"
}
## Recipient profiles [/recipients/{recipientId}/profiles/{providerType}]
### Create new recipient profile instance [POST]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ providerType: email (string) - email/push/pubsub/etc
+ Request (application/json)
{
"id": "57472118fc2805aa3556770d",
"address": "[email protected]"
}
+ Response 201
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "email",
"address": "[email protected]"
}
### Find all recipient profiles [GET]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ providerType: email (string) - email/push/pubsub/etc
+ Response 200
[{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770d",
"providerType": "email",
"address": "[email protected]"
}]
## Recipient profile instance [/recipients/{recipientId}/profiles/{providerType}/{id}]
### Get recipient instance [GET]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ providerType: email (string) - email/push/pubsub/etc
+ id: 57472118fc2805aa3556770d (string) - id of the recipient profile
+ Response 200
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "email",
"address": "[email protected]"
}
## Push recipient profile [/recipients/{recipientId}/profiles/push/register]
### Register [POST]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ Request (application/json)
{
"platform": "ios",
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660"
}
+ Response 201
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "push",
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660",
"registeredDate": "Mon May 30 2016 16:18:35 GMT+0300 (EEST)"
}
## Push recipient profile [/recipients/{recipientId}/profiles/push/unregister]
### Unregister [POST]
+ Parameters
+ recipientId: 57472118fc2805aa3556770c (string) - id of the recipient
+ Request (application/json)
{
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c"
}
+ Response 201
{
"id": "57472118fc2805aa3556770d",
"recipientId": "57472118fc2805aa3556770c",
"providerType": "push",
"deviceId": "8fc2805aa3556770c8fc2805aa3556770c",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660",
"registeredDate": "Mon May 30 2016 16:18:35 GMT+0300 (EEST)"
}
|
Fix apiary docs (#68)
|
Fix apiary docs (#68)
|
API Blueprint
|
mit
|
tepio/pingeon,tepio/pingeon
|
1dfdd8e812e4a5020f2fa4df860e198bc47e73de
|
doc/apiblueprints/elektrad.apib
|
doc/apiblueprints/elektrad.apib
|
FORMAT: 1A
# elektrad API
to access single instances, each elektra daemon (`elektrad`) provides a REST
HTTP API
## get versions [GET /version]
returns the current version of the API and elektra
The API version is increased whenever breaking changes
(i.e. changes that prevent backward compatibility) are made.
The Elektra version is directly taken from the Elektra library,
for further information and explanation see [doc/VERSION.md](https://github.com/ElektraInitiative/libelektra/blob/master/doc/VERSION.md).
+ Response 200 (application/json)
+ Attributes (object)
+ elektra (object) - Detailed version information about the used Elektra library
+ version (string) - The currently used version in its complete format
+ major (number) - The currently used major version
+ minor (number) - The currently used minor version
+ micro (number) - The currently used micro version
+ api (number) - The version of the API itself
## elektra key database [/kdb/{+path}{?apikey}]
access the elektra key database by specifying a `path`
+ Parameters
+ path: `user/hello` (string) - path to the elektra config
+ apikey: `7b7947e6-adc5-4d23-b53c-783623f894f8` (string, required) - API key used to authenticate with `elektrad`
### get configuration [GET]
+ Response 200 (application/json)
+ Attributes (object)
+ ls: user/hello, user/hello/world (array[string], required) - subkeys of the requested path, similar to `kdb ls`
+ value: hello world (string, required)
+ meta (object, required) - metadata of the requested path
+ Response 400 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `APIKEY_MISSING` api key not specified
+ Response 401 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `NEED_AUTHENTICATION` if no valid apikey has been supplied
+ Response 404 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `PATH_NOT_FOUND` if the requested path does not exist in the key database
### set configuration [PUT]
+ Request (text/plain)
hello world
+ Response 204
+ Request (application/json)
"hello world"
+ Response 204
+ Response 400 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `APIKEY_MISSING` api key not specified
+ Response 401 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `NEED_AUTHENTICATION` if no valid apikey has been supplied
+ Response 404 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `PATH_NOT_FOUND` if the requested path does not exist in the key database
+ Response 406 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `REQUEST_UNSUPPORTED_CONTENT_TYPE` if the submitted Content-Type is not `application/json` or `text/plain`
### delete configuration [DELETE]
+ Response 204
+ Response 400 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `APIKEY_MISSING` api key not specified
+ Response 401 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `NEED_AUTHENTICATION` if no valid apikey has been supplied
+ Response 404 (application/json)
+ Attributes (Error)
+ i18n
A comprehensive list of possible errors:
- `PATH_NOT_FOUND` if the requested path does not exist in the key database
# Data Structures
## KDBResponse (object)
+ ls: user/hello, user/hello/world (array[string], required) - subkeys of the requested path, similar to `kdb ls`
+ value: hello world (string, required)
+ meta (object, required) - metadata of the requested path
## Error (object)
+ status (string) - textual description of the HTTP status
+ message (string) - detailed error information, e.g. hint about malformed request
+ i18n (string) - a unique token representing above error description message; can be used for internationalization in frontends
|
FORMAT: 1A
# elektrad API
to access single instances, each elektra daemon (`elektrad`) provides a REST
HTTP API
## get versions [GET /version]
returns the current version of the API and elektra
The API version is increased whenever breaking changes
(i.e. changes that prevent backward compatibility) are made.
The Elektra version is directly taken from the Elektra library,
for further information and explanation see [doc/VERSION.md](https://github.com/ElektraInitiative/libelektra/blob/master/doc/VERSION.md).
+ Response 200 (application/json)
+ Attributes (object)
+ elektra (object) - Detailed version information about the used Elektra library
+ version (string) - The currently used version in its complete format
+ major (number) - The currently used major version
+ minor (number) - The currently used minor version
+ micro (number) - The currently used micro version
+ api (number) - The version of the API itself
## elektra key database [/kdb/{+path}{?apikey}]
access the elektra key database by specifying a `path`
+ Parameters
+ path: `user/hello` (string) - path to the elektra config
+ apikey: `7b7947e6-adc5-4d23-b53c-783623f894f8` (string, required) - API key used to authenticate with `elektrad`
### get configuration [GET]
+ Response 200 (application/json)
+ Attributes (object)
+ ls: user/hello, user/hello/world (array[string], required) - subkeys of the requested path, similar to `kdb ls`
+ value: hello world (string, required)
+ meta (object, required) - metadata of the requested path
+ Response 400 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `APIKEY_MISSING` api key not specified
+ Response 401 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `NEED_AUTHENTICATION` if no valid apikey has been supplied
+ Response 404 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `PATH_NOT_FOUND` if the requested path does not exist in the key database
### set configuration [PUT]
+ Request (text/plain)
hello world
+ Response 204
+ Request (application/json)
"hello world"
+ Response 204
+ Response 400 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `APIKEY_MISSING` api key not specified
+ Response 401 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `NEED_AUTHENTICATION` if no valid apikey has been supplied
+ Response 404 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `PATH_NOT_FOUND` if the requested path does not exist in the key database
+ Response 406 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `REQUEST_UNSUPPORTED_CONTENT_TYPE` if the submitted Content-Type is not `application/json` or `text/plain`
### delete configuration [DELETE]
+ Response 204
+ Response 400 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `APIKEY_MISSING` api key not specified
+ Response 401 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `NEED_AUTHENTICATION` if no valid apikey has been supplied
+ Response 404 (application/json)
+ Attributes (Error)
+ i18n (string)
A comprehensive list of possible errors:
- `PATH_NOT_FOUND` if the requested path does not exist in the key database
# Data Structures
## KDBResponse (object)
+ ls: user/hello, user/hello/world (array[string], required) - subkeys of the requested path, similar to `kdb ls`
+ value: hello world (string, required)
+ meta (object, required) - metadata of the requested path
## Error (object)
+ status (string) - textual description of the HTTP status
+ message (string) - detailed error information, e.g. hint about malformed request
+ i18n (string) - a unique token representing above error description message; can be used for internationalization in frontends
|
add string type to i18n fields
|
add string type to i18n fields
|
API Blueprint
|
bsd-3-clause
|
ElektraInitiative/libelektra,petermax2/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,e1528532/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,e1528532/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,e1528532/libelektra,BernhardDenner/libelektra,petermax2/libelektra,e1528532/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,e1528532/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,ElektraInitiative/libelektra
|
f969847107ee14e68a7d354cfc1c26b47fc6aefd
|
STATION-METADATA-API-BLUEPRINT.apib
|
STATION-METADATA-API-BLUEPRINT.apib
|
FORMAT: 1A
Station Metadata API
=============================
# General information
This Service exists to provide the canonical API for querying and returning MeteoGroup stations and their capabilities.
The output response with requested stations is always in GEOJson format.
## Requesting the Data
The GEOJson information about stations might be requested either by bounding box or by polygon.
## Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `station-metadata`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/refactor-2-guideline/authorization/Authentication.md)
### Cache control headers:
if data unchanged since this date using the If-Modified-Since request header
the server will return with an empty body with the 304 response code. Ex:
+ Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ If-Modified-Since: Thu, 13 Jul 2017 10:55:53 GMT
### Querying MeteoGroup stations data
Here is the information about all supported HTTP request parameters and HTTP Headers:
+ Headers
+ Authorization: Bearer {ENCRYPTED TOKEN HERE}
+ If-Modified-Since: {DATE}
+ Parameters
+ locatedWithin:
- {"type":"bbox","coordinates":[[lon,lat],[lon,lat]]} (string, optional) - top left and bottom right coordinates that construct bounding box;
- {"type":"polygon","coordinates":[[[-10,10],[10,5],[-5,-5],[-10,10]],[[-5,5],[0,5],[0,0],[-5,5]]]} - polygon coordinates.
- {"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]} - An array of separate polygons.
- First polygons array describes polygon and another describe holes in it.
- **lon** in degree numeric format and in range <-180,180> eg. -123.454, 179.864
- **lat** in degree numeric format and in range <-90,90> eg. -85.541, 5.32,
+ accessVisibility: `public` (string, optional) - station access visibility, valid values is `public` and `private`
+ provider: `WMO,MG` (string, optional) - currently filter by provider or providers. All possible providers are described in section: **Get all providers**
+ type: `SKI_RESORT` (string, optional) - currently filter by type. All possible types are described in section: **Get all station types**
+ hasForecastData: `false` (boolean, optional) - station has forecast data.
+ hasObservationData: `true` (boolean, optional) - station has observation data.
+ countryIsoCode: `GB` (string, optional) - station located in this country. ISO Code refers to the [ISO 3166 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166)
The API supports various combinations for querying stations data by bounding box, polygon, multi-polygon, by provider and type, by stations that produce forecast and observation data.
Here are a couple of examples how to query by provider and type, bounding box and polygon.
#### Querying by provider and type
Query example:
```
GET /stations?accessVisibility=public&provider=WMO&hasForecastData=true&hasObservationData=false&countryIsoCode=Ukraine
```
+ Response 200 (application/json)
+ Headers
Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ Body
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"icaoCode": "ENAS",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1004,
"name": "Ny-Alesund II",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
11.9222,
78.9233,
16
]
}
},
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1005,
"name": "Isfjord Radio",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
13.6333,
78.0667,
5
]
}
}
]
}
```
#### Querying by bounding box
Query example for getting stations by bounding box: ```locatedWithin={"type":"bbox","coordinates":[[-10,80],[10,5]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22bbox%22%2C%22coordinates%22%3A%5B%5B-10%2C80%5D%2C%5B10%2C5%5D%5D%7D
```
If the station data are queried by bounding box, its important to set up the correct **locatedWithin** parameter: **"type":"box", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
The response body is the same as for querying stations by provider and type.
#### Querying by polygon
Query example for getting stations by polygon: ```locatedWithin={"type":"polygon","coordinates":[[[-0.16,51.70],[-0.43,51.29],[0.18,51.30],[-0.16,51.70]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22polygon%22%2C%22coordinates%22%3A%5B%5B%5B-0.16%2C51.70%5D%2C%5B-0.43%2C51.29%5D%2C%5B0.18%2C51.30%5D%2C%5B-0.16%2C51.70%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Querying by multi-polygon
Query example for getting stations by multi-polygon: ```locatedWithin={"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22multipolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B102.0%2C2.0%5D%2C%5B103.0%2C2.0%5D%2C%5B103.0%2C3.0%5D%2C%5B102.0%2C3.0%5D%2C%5B102.0%2C2.0%5D%5D%5D%2C%5B%5B%5B100.0%2C0.0%5D%2C%5B101.0%2C0.0%5D%2C%5B101.0%2C1.0%5D%2C%5B100.0%2C1.0%5D%2C%5B100.0%2C0.0%5D%5D%2C%5B%5B100.2%2C0.2%5D%2C%5B100.8%2C0.2%5D%2C%5B100.8%2C0.8%5D%2C%5B100.2%2C0.8%5D%2C%5B100.2%2C0.2%5D%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Get all station types
Query example:
```
GET /stations/types
```
Return all station types
```
[
"WMO",
"ROAD",
"VIRTUAL",
"OTHER_OBS_HQ",
"AVIATION",
"NMI_SECONDARY",
"SPECIAL_OBS",
"SKI",
"MARINE",
"MG_NETWORK",
"AIRQUALITY",
"RAIL",
"OTHER_OBS_LQ"
]
```
#### Get all providers
Query example:
```
GET /stations/providers
```
Return all providers
```
[
"ENGLN",
"NOWCAST",
"WMO",
"MG",
"VARIOUS",
"ICAO",
"CUSTOMER",
"MADIS/RAWS",
"DWD",
"SKI",
"EAUK",
"DACOM",
"SMHI",
"METEOSWISS",
"METEOFRANCE",
"KNMI",
"RAIL",
"USAF",
"BZIT",
"DWD/BuWe",
"MICKS",
"AMATEUR",
"TEMES",
"FUB",
"NATO"
]
```
## Integrated resources
The primary source for Station Metadata Service is a GeoJSON file: sms_stations.geojson which is located on S3 bucket: meta.var.meta.ac.s3.mg
## Useful links
- [Feature request](https://jira.meteogroup.net/browse/RMWAPI-146)
- [Bamboo build plan](http://ci.de.meteogroup.net/bamboo/browse/BMDD-SMD)
- [Maven configuration](https://confluence.meteogroup.net/pages/viewpage.action?pageId=3114420).
- [polygon and multipolygon coordinates example](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html).
|
FORMAT: 1A
Station Metadata API
=============================
# General information
This Service exists to provide the canonical API for querying and returning MeteoGroup stations and their capabilities.
The output response with requested stations is always in GEOJson format.
## Requesting the Data
The GEOJson information about stations might be requested either by bounding box or by polygon.
## Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `station-metadata`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/refactor-2-guideline/authorization/Authentication.md)
### Cache control headers:
if data unchanged since this date using the If-Modified-Since request header
the server will return with an empty body with the 304 response code. Ex:
+ Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ If-Modified-Since: Thu, 13 Jul 2017 10:55:53 GMT
### Querying MeteoGroup stations data
Here is the information about all supported HTTP request parameters and HTTP Headers:
+ Headers
+ Authorization: Bearer {ENCRYPTED TOKEN HERE}
+ If-Modified-Since: {DATE}
+ Parameters
+ locatedWithin:
- {"type":"bbox","coordinates":[[lon,lat],[lon,lat]]} (string, optional) - top left and bottom right coordinates that construct bounding box;
- {"type":"polygon","coordinates":[[[-10,10],[10,5],[-5,-5],[-10,10]],[[-5,5],[0,5],[0,0],[-5,5]]]} - polygon coordinates.
- {"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]} - An array of separate polygons.
- First polygons array describes polygon and another describe holes in it.
- **lon** in degree numeric format and in range <-180,180> eg. -123.454, 179.864
- **lat** in degree numeric format and in range <-90,90> eg. -85.541, 5.32,
+ accessVisibility: `public` (string, optional) - station access visibility, valid values is `public` and `private`
+ provider: `WMO,MG` (string, optional) - currently filter by provider or providers. All possible providers are described in section: **Get all providers**
+ type: `SKI_RESORT` (string, optional) - currently filter by type. All possible types are described in section: **Get all station types**
+ hasForecastData: `false` (boolean, optional) - station has forecast data.
+ hasObservationData: `true` (boolean, optional) - station has observation data.
+ countryIsoCode: `GB` (string, optional) - station located in this country. ISO Code refers to the [ISO 3166 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166)
The API supports various combinations for querying stations data by bounding box, polygon, multi-polygon, by provider and type, by stations that produce forecast and observation data.
Here are a couple of examples how to query by provider and type, bounding box and polygon.
#### Querying by provider and type
Query example:
```
GET /stations?accessVisibility=public&provider=WMO&hasForecastData=true&hasObservationData=false&countryIsoCode=Ukraine
```
+ Response 200 (application/json)
+ Headers
Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ Body
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"icaoCode": "ENAS",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1004,
"name": "Ny-Alesund II",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
11.9222,
78.9233,
16
]
}
},
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1005,
"name": "Isfjord Radio",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
13.6333,
78.0667,
5
]
}
}
]
}
```
#### Querying by bounding box
Query example for getting stations by bounding box: ```locatedWithin={"type":"bbox","coordinates":[[-10,80],[10,5]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22bbox%22%2C%22coordinates%22%3A%5B%5B-10%2C80%5D%2C%5B10%2C5%5D%5D%7D
```
If the station data are queried by bounding box, its important to set up the correct **locatedWithin** parameter: **"type":"box", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
The response body is the same as for querying stations by provider and type.
#### Querying by polygon
Query example for getting stations by polygon: ```locatedWithin={"type":"polygon","coordinates":[[[-0.16,51.70],[-0.43,51.29],[0.18,51.30],[-0.16,51.70]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22polygon%22%2C%22coordinates%22%3A%5B%5B%5B-0.16%2C51.70%5D%2C%5B-0.43%2C51.29%5D%2C%5B0.18%2C51.30%5D%2C%5B-0.16%2C51.70%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Querying by multi-polygon
Query example for getting stations by multi-polygon: ```locatedWithin={"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22multipolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B102.0%2C2.0%5D%2C%5B103.0%2C2.0%5D%2C%5B103.0%2C3.0%5D%2C%5B102.0%2C3.0%5D%2C%5B102.0%2C2.0%5D%5D%5D%2C%5B%5B%5B100.0%2C0.0%5D%2C%5B101.0%2C0.0%5D%2C%5B101.0%2C1.0%5D%2C%5B100.0%2C1.0%5D%2C%5B100.0%2C0.0%5D%5D%2C%5B%5B100.2%2C0.2%5D%2C%5B100.8%2C0.2%5D%2C%5B100.8%2C0.8%5D%2C%5B100.2%2C0.8%5D%2C%5B100.2%2C0.2%5D%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Get all station types
Query example:
```
GET /stations/types
```
Return all station types
```
[
"WMO",
"ROAD",
"VIRTUAL",
"OTHER_OBS_HQ",
"AVIATION",
"NMI_SECONDARY",
"SPECIAL_OBS",
"SKI",
"MARINE",
"MG_NETWORK",
"AIRQUALITY",
"RAIL",
"OTHER_OBS_LQ"
]
```
#### Get all providers
Query example:
```
GET /stations/providers
```
Return all providers
```
[
"ENGLN",
"NOWCAST",
"WMO",
"MG",
"VARIOUS",
"ICAO",
"CUSTOMER",
"MADIS/RAWS",
"DWD",
"SKI",
"EAUK",
"DACOM",
"SMHI",
"METEOSWISS",
"METEOFRANCE",
"KNMI",
"RAIL",
"USAF",
"BZIT",
"DWD/BuWe",
"MICKS",
"AMATEUR",
"TEMES",
"FUB",
"NATO"
]
```
|
Remove links
|
Remove links
|
API Blueprint
|
apache-2.0
|
MeteoGroup/weather-api,MeteoGroup/weather-api
|
ff13487dc9931987ba1c76567305e4177a2b8ba8
|
apiary.apib
|
apiary.apib
|
FORMAT:alpha-1
HOST: TODO
# Ace of Blades
Take a regular deck and remove all face cards, leave only the ace of spades and numbered cards (37 total)
- 2 player, each starts with 5 cards
- first player to discard entire hand wins
## Starting a New Game [/new]
+ Parameters
+ creator_id (required, number) - unique ID for player creating the game
+ rival_id (required, number) - unique ID for opponent player to challenge
### Start a new game [GET]
## Playing the Game [/play]
Make a move or check the current game state
### Get the current game state [GET]
Get information about the current game, including your current hand
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - Your player ID
+ Response 200 (application/json)
{
"game_id": '42'
"creator_id": '31337'
"rival_id": '8888'
"status": "active"
"player_id" : '31337'
"hand" : [ {value: '2', suit:'diamonds']
}
+ Response 401
player_id was invalid for the provided game_
### Play a Card [POST]
Choose a card value to play. Until your opponent chooses their card for this round, you may update the card you wish to play
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - your unique player ID
+ card (required, number) - the card value you wish to play (suits are ignored)
+ Request (application/json)
{
"game_id": '42'
"player_id": '31337'
"card": '7'
}
+ Response 200 (application/json)
Once both players have chosen a card value, the server will resolve the round and update each player's hand
+ Response 401
player_id was invalid for the provided game_
+ Response 403
player_id did not have access to the provided card value
|
FORMAT:alpha-1
HOST: https://aceofblades-bschmoker.c9users.io
# Ace of Blades
Take a regular deck and remove all face cards, leave only the ace of spades and numbered cards (37 total)
Start each player with starts with 5 cards from a shuffled deck
> The first player to discard their entire hand wins
## Starting a New Game [/new]
Create a new game for two players
+ Parameters
+ creator_id (required, number) - unique ID for player creating the game
+ rival_id (required, number) - unique ID for opponent player to challenge
### Start a new game [GET]
+ Response 200 (application/json)
{
"game_id": '42',
"player_id" : '31337',
"hand" : [ {value: '2', suit:'diamonds']
## Playing the Game [/play]
Make a move or check the current game state
### Get the current game state [GET]
Get information about a given game (including their current hand) for a player
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - Your player ID
+ Response 200 (application/json)
{
"game_id": '42',
"creator_id": '31337',
"rival_id": '8888',
"status": "active",
"player_id" : '31337',
"hand" : [ {value: '2', suit:'diamonds']
}
+ Response 401
player_id was invalid for the provided game_
### Play a Card [POST]
Choose a card value to play. Until your opponent chooses their card for this round, you may update the card you wish to play
+ Parameters
+ game_id (required, number) - unique ID for the game
+ player_id (required, number) - your unique player ID
+ card (required, number) - the card value you wish to play (suits are ignored)
+ Request (application/json)
{
"game_id": '42',
"player_id": '31337',
"card": '7'
}
+ Response 200 (application/json)
Once both players have chosen a card value, the server will resolve the round and update each player's hand
+ Response 401
player_id was invalid for the provided game_
+ Response 403
player_id did not have access to the provided card value
|
update api spec
|
update api spec
|
API Blueprint
|
mit
|
bschmoker/highnoon,bschmoker/aceofblades
|
043d4dba9827c7d983426d8422cd003dddf0877d
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://horizon-testnet.stellar.org
# Horizon
*NOTE: Horizon is in very active development*
Horizon is the client facing API server for the Stellar network ecosystem. See [an overview of the Stellar ecosystem](TODO) for more details.
Horizon provides (well, intends to provide when complete) two significant portions of functionality: The Transactions API and the History API.
## Transactions API
The Transactions API exists to help you make transactions against the stellar network. It provides ways to help you create valid transactions, such as providing an account's sequence number or latest known balances.
In addition to the read endpoints, the Transactions API also provides the endpoint to submit transactions.
### Future additions
The current capabilities of the Transactions API does not represent what will be available at the official launch of the new Stellar network. Notable additions to come:
- Endpoints to read the current state of a given order book or books to aid in creating offer transactions
- Endpoints to calculate suitable paths for a payments
## History API
The History API provides endpoints for retrieving data about what has happened in the past on the stellar network. It provides (or will provide) a endpoints that let you:
- Retrieve transaction details
- Load transactions that effect a given account
- Load payment history for an account
- Load trade history for a given order book
### Future additions
The history API is pretty sparse at present. Presently you can page through all transactions in application order, or page through transactions that a apply to a single account. This is really only useful for explaining how paging and filtering works within horizon, as most useful information for transactions are related to their operations.
## API Overview
The following section describes a couple of important concepts for the horizon api at a high level. Understanding these concepts will help make your overall experience integrating with horizon much easier.
### Response Format
Rather than using a full custom way of representing the resources we expose in Horizon, we use [HAL](http://stateless.co/hal_specification.html). HAL is a simple hypermedia format in JSON that remains simple while giving us a couple of benefits such as simpler client integration for several languages. See [this wiki page](https://github.com/mikekelly/hal_specification/wiki/Libraries) for a list of libraries.
See [Responses](responses.md) for more details
### Error Format
HAL doesn't really have any special consideration for error responses. To provide some standardization to our API's error messages we use the [Problem Details for HTTP APIs RFC](https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00)
See [errors](errors.md) for more details
### Paging
Some resources in horizon represent a collection of other resources. Almost always, loading this collection in its entirety is not feasible. To work around this, we provide a way to page through a collection.
The paging system in horizon is known as a _token-based_ paging system. There is no "page 3" or the like. Paging through a collection in a token-based paging system involves three pieces of data:
- the *paging token*, which is an opaque value that logically represents the last record seen by a client.
- the *limit*, or page size, a positive integer.
- the *order* applied to the whole collection
See [paging](paging.md) for more details.
## Ledger [/ledgers/{sequence}]
The Stellar network stores data in shared public ledger, and is changes by a series of transactions applied one after the other. Each round of consensus produces a new ledger, identified by a sequence number. The ledger resource represents a summary of a closed ledger and contains links to further details.
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
+ hash (string, required) - The Hex-encoded hash of the ledger header
+ prev_hash (string, optional) - The Hex-encoded hash of the ledger header preceding this ledger
+ sequence (number, required) - This ledger's sequence number
+ transaction_count (number, required) - The number of transactions that were validated and applied during the creation of this ledger
+ operations_count (number, required) - The number of operations that were applied during the creation of this ledger
+ closed_at (Date, required) - The time that this ledger was validated by the network and closed
### View ledger summary [GET]
+ Parameters
+ sequence: 123 (number, required) - A sequence number
+ Response 200
+ Attributes (Ledger)
## Account [/accounts/{address}]
Represents the current state of an account as of the latest closed
ledger imported by horizon.
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
### View account details [GET]
+ Parameters
+ address (required, string, `gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs`) ... Address of an account
+ Response 200
+ Attributes (Account)
## Transaction [/transactions/{hash}]
Represents a single transaction that has been submitted and validated by the stellar network
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
+ hash (string, required) - Hex-encoded hash of the transaction
+ ledger (number, required) - The ledger sequence in which this transaction was validated
+ account (string, required) - The base58-encoded address of this transaction's source account
+ account_sequence (number, required) - The sequence number for this transaction and source account
+ max_fee (number, required) - The maximum fee configured to be acceptable to this transaction
+ fee_paid (number, required) - The actual fee paid by this transaction's source account during application to the ledger
+ operation_count (number, required) - The number of operations that are encoded into this transaction
+ result_code (number, required) - The result code for the application of this transaction to the ledger
+ result_code_s (string, required) - The string representation of the result code
+ envelope_xdr (string, required) - The base64-encoded XDR representation of the original TransactionEnveleop
+ result_xdr (string, required) - The base64-encoded XDR representation of the TransactionResultPair returned during application
+ result_meta_xdr (string, required) - The base64-encoded XDR representation of the TransactionMeta created during transaction application
### View transaction's details [GET]
+ Parameters
+ hash (required, string, `0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54`) ... The hex-encoded hash of a transaction
+ Response 200
+ Attributes (Transaction)
## Transaction Collection [/transactions{?order}{?limit}{?after}]
+ Model (application/hal+json)
{
"_links": {
"next": {
"href": "/transactions?after=373a31&limit=1&order=asc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "/transactions/0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54"
},
"account": {
"href": "/accounts/gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
}
},
"hash": "0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54",
"ledger": 7,
"application_order": [
7,
1
],
"account": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7",
"account_sequence": 1,
"max_fee": 10,
"fee_paid": 10,
"operation_count": 1
}
]
}
}
### View a page of transaction history [GET]
+ Parameters
+ after (optional, string, `373a31`) ... A paging token
+ limit (optional, number, `10`) ... The maximum number of transactions to return in the response
+ order (string)
The order to traverse the transaction collection
+ Values
+ `asc`
+ `desc`
+ Response 200
[Transaction Collection][]
### Submitting a transaction [POST]
+ Request (application/x-www-form-urlencoded)
tx=fffff
+ Response 200 (application/hal+json)
{}
# Data Structures
## Date (string)
An ISO8601 string representation of a time
### Sample
"2012-06-30T13:15:00Z"
### Sample
"2015-06-12T08:15:10.12345Z"
## Resource (object)
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
|
FORMAT: 1A
HOST: https://horizon-testnet.stellar.org
# Horizon
Horizon is the client facing API server for the Stellar ecosystem. See [an overview of the Stellar ecosystem](#) for more details.
Horizon provides three significant portions of functionality: The Transactions API, the History API, and the Trading API.
## Transactions API
The Transactions API exists to help you make transactions against the Stellar network. It provides ways to help you create valid transactions, such as providing an account's sequence number or latest known balances.
In addition to the read endpoints, the Transactions API also provides the endpoint to submit transactions.
## History API
The History API provides endpoints for retrieving data about what has happened in the past on the Stellar network. It provides (or will provide) endpoints that let you:
- Retrieve transaction details
- Load transactions that effect a given account
- Load payment history for an account
- Load trade history for a given order book
## Trading API
The Trading API provides endpoints for retrieving data about the distributed
currency exchange within stellar. It provides data regarding open offers to
exchange currency (often called an order book) and also provides data about
trades that were executed within the exchange.
## API Overview
The following section describes a couple of important concepts for the horizon api at a high level. Understanding these concepts will help make your overall experience integrating with horizon much easier.
### Response Format
Rather than using a full custom way of representing the resources we expose in Horizon, we use [HAL](http://stateless.co/hal_specification.html). HAL is a simple hypermedia format in JSON that remains simple while giving us a couple of benefits such as simpler client integration for several languages. See [this wiki page](https://github.com/mikekelly/hal_specification/wiki/Libraries) for a list of libraries.
See [Responses](responses.md) for more details
### Error Format
HAL doesn't really have any special consideration for error responses. To provide some standardization to our API's error messages we use the [Problem Details for HTTP APIs RFC](https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00)
See [errors](errors.md) for more details
### Paging
Some resources in horizon represent a collection of other resources. Almost always, loading this collection in its entirety is not feasible. To work around this, we provide a way to page through a collection.
The paging system in horizon is known as a _token-based_ paging system. There is no "page 3" or the like. Paging through a collection in a token-based paging system involves three pieces of data:
- the *paging token*, which is an opaque value that logically represents the last record seen by a client.
- the *limit*, or page size, a positive integer.
- the *order* applied to the whole collection
See [paging](paging.md) for more details.
## Ledger [/ledgers/{sequence}]
The Stellar network stores data in shared public ledger, and is changes by a series of transactions applied one after the other. Each round of consensus produces a new ledger, identified by a sequence number. The ledger resource represents a summary of a closed ledger and contains links to further details.
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
+ hash (string, required) - The Hex-encoded hash of the ledger header
+ prev_hash (string, optional) - The Hex-encoded hash of the ledger header preceding this ledger
+ sequence (number, required) - This ledger's sequence number
+ transaction_count (number, required) - The number of transactions that were validated and applied during the creation of this ledger
+ operations_count (number, required) - The number of operations that were applied during the creation of this ledger
+ closed_at (Date, required) - The time that this ledger was validated by the network and closed
### View ledger summary [GET]
+ Parameters
+ sequence: 4 (number, required) - A sequence number
+ Response 200
+ Attributes (Ledger)
+ Body
{
"_links": {
"effects": {
"href": "/ledgers/4/effects{?cursor}{?limit}{?order}",
"templated": true
},
"operations": {
"href": "/ledgers/4/operations{?cursor}{?limit}{?order}",
"templated": true
},
"self": {
"href": "/ledgers/4"
},
"transactions": {
"href": "/ledgers/4/transactions{?cursor}{?limit}{?order}",
"templated": true
}
},
"id": "4f9c63d164aa1e4fcd04d19e6022e9a551f53583eff2e3501db9068837a19a4f",
"paging_token": "17179869184",
"hash": "4f9c63d164aa1e4fcd04d19e6022e9a551f53583eff2e3501db9068837a19a4f",
"prev_hash": "1812a844552b6ef10665ff429f69e5af77460db28cbf108870d1cb0e607c909b",
"sequence": 4,
"transaction_count": 4,
"operation_count": 4,
"closed_at": "2015-06-12T17:41:32Z"
}
## Account [/accounts/{address}]
Represents the current state of an account as of the latest closed
ledger imported by horizon.
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
+ address (string, required) - The address for the account
+ sequence (number, required) - The current sequence for the account, as of the last validated ledger
+ balances (array, required) - TODO
### View account details [GET]
+ Parameters
+ address: gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe (string, required) - Address of an account
+ Response 200
+ Attributes (Account)
+ Body
{
"_links": {
"effects": {
"href": "/accounts/gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe/effects/{?cursor}{?limit}{?order}",
"templated": true
},
"offers": {
"href": "/accounts/gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe/offers/{?cursor}{?limit}{?order}",
"templated": true
},
"operations": {
"href": "/accounts/gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe/operations/{?cursor}{?limit}{?order}",
"templated": true
},
"self": {
"href": "/accounts/gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe"
},
"transactions": {
"href": "/accounts/gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe/transactions/{?cursor}{?limit}{?order}",
"templated": true
}
},
"id": "gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe",
"paging_token": "1163936141312",
"address": "gcEuhxySh58bKtCY3UPaWQDR7a1BzGB3ePdxc4UrinkBJyxESe",
"sequence": 1163936137285,
"balances": [
{
"currency_type": "native",
"balance": 99939999999310
}
]
}
## Transaction [/transactions/{hash}]
Represents a single transaction that has been submitted and validated by the stellar network
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
+ hash (string, required) - Hex-encoded hash of the transaction
+ ledger (number, required) - The ledger sequence in which this transaction was validated
+ account (string, required) - The base58-encoded address of this transaction's source account
+ account_sequence (number, required) - The sequence number for this transaction and source account
+ max_fee (number, required) - The maximum fee configured to be acceptable to this transaction
+ fee_paid (number, required) - The actual fee paid by this transaction's source account during application to the ledger
+ operation_count (number, required) - The number of operations that are encoded into this transaction
+ result_code (number, required) - The result code for the application of this transaction to the ledger
+ result_code_s (string, required) - The string representation of the result code
+ envelope_xdr (string, required) - The base64-encoded XDR representation of the original TransactionEnveleop
+ result_xdr (string, required) - The base64-encoded XDR representation of the TransactionResultPair returned during application
+ result_meta_xdr (string, required) - The base64-encoded XDR representation of the TransactionMeta created during transaction application
### View transaction's details [GET]
+ Parameters
+ hash (required, string, `0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54`) ... The hex-encoded hash of a transaction
+ Response 200
+ Attributes (Transaction)
## Transaction Collection [/transactions{?order}{?limit}{?after}]
+ Model (application/hal+json)
{
"_links": {
"next": {
"href": "/transactions?after=373a31&limit=1&order=asc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "/transactions/0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54"
},
"account": {
"href": "/accounts/gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7"
}
},
"hash": "0ab231385734ad4092cc0651f3acd2a6e3eead24282f2725a79d019d4b791d54",
"ledger": 7,
"application_order": [
7,
1
],
"account": "gM4gu1GLe3vm8LKFfRJcmTt1eaEuQEbo61a8BVkGcou78m21K7",
"account_sequence": 1,
"max_fee": 10,
"fee_paid": 10,
"operation_count": 1
}
]
}
}
### View a page of transaction history [GET]
+ Parameters
+ after (optional, string, `373a31`) ... A paging token
+ limit (optional, number, `10`) ... The maximum number of transactions to return in the response
+ order (string)
The order to traverse the transaction collection
+ Values
+ `asc`
+ `desc`
+ Response 200
[Transaction Collection][]
### Submitting a transaction [POST]
+ Request (application/x-www-form-urlencoded)
tx=fffff
+ Response 200 (application/hal+json)
{}
# Data Structures
## Date (string)
An ISO8601 string representation of a time
### Sample
"2012-06-30T13:15:00Z"
### Sample
"2015-06-12T08:15:10.12345Z"
## Resource (object)
+ Attributes
+ id (string, required) - An opaque identifier for this resource
+ paging_token (string, required) - An opaque cursor, which may be used for paging through the collection (i.e. used as the cursor parameter)
|
Add to documentation
|
Add to documentation
|
API Blueprint
|
apache-2.0
|
nullstyle/go-horizon,masonforest/go-horizon,FredericHeem/go-horizon,masonforest/go-horizon,masonforest/horizon,masonforest/go-horizon,stellar/horizon,lackac/horizon,irisli/horizon,stellar/horizon,lackac/horizon,masonforest/horizon,masonforest/horizon,stellar/horizon,FredericHeem/go-horizon,irisli/horizon,irisli/horizon,FredericHeem/go-horizon,nullstyle/go-horizon,lackac/horizon,nullstyle/go-horizon
|
9bd8ca92c6070578f25524b92585c9738533440a
|
blueprint/api.apib
|
blueprint/api.apib
|
FORMAT: 1A
HOST: https://api.thegrid.io/
# The Grid API
# Group Long-running jobs
Several actions in the API takes a significant time.
Current examples include POST /share, /publish and /unpublish.
Performing such an action returns a Location header with a Job URL.
## Job details [/job/{id}]
### Retriving job details [GET]
+ Parameters
+ id (required, string) - Job UUID
+ Response 200 (application/json)
+ Body
```
<!-- include(examples/job-share-completed.json) -->
```
## Jobs [/job]
### Listing current jobs [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/job-share-completed.json) -->
]
```
# Group Site Management
## Site information [/site]
### List user websites [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/site-minimal.json) -->
]
```
### Create a website [POST]
+ Request (application/json)
**Note:** the repository must be in `the-domains` organization. The repository name can later be used for sharing content to the newly-created site.
+ Body
```
<!-- include(examples/site-without-owner.json) -->
```
+ Schema
```
<!-- include(schema/site.json) -->
```
+ Response 201
Site was successfully created
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing site information
+ Body
## User website [/site/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Get website details [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/site.json) -->
```
### Update website details [PUT]
+ Request (application/json)
+ Body
```
<!-- include(examples/site-with-config.json) -->
```
+ Schema
```
<!-- include(schema/site.json) -->
```
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/site.json) -->
```
## Website discovery [/site/discover{?url}]
### Match URL to a website [GET]
+ Parameters
+ url (required, string) - URL of the website
+ Response 302
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 404
No Grid site was found for the URL
+ Body
# Group Content Management
## Share [/share]
### Sharing content [POST]
Users can share content to The Grid. The shared items will be normalized, analyzed and made available via the item API.
Sharing creates a Job, whos progress can be monitored using the /job API.
There are typically three different things you can be sharing:
* Full article pages: share with URL
* HTML fragments: selection or img tag. Share with content, type text/html and with the URL of the originating page
* Uploaded files: image, word document, HTML file, Markdown file, etc. Share with multi-part upload, URL and MIME type needed
Note that publishing an item to a website is a separate step. See /publish
+ Request with JSON payload (application/json)
+ Body
```
<!-- include(examples/share-url-only.json) -->
```
+ Schema
```
<!-- include(schema/share.json) -->
```
+ Request with file upload (multipart/form-data)
For images and other files the content is a file sent via multipart/form-data. If there is no relevant URL for the content, it is a good idea to generate a UUID URI.
```
formData = new FormData()
formData.append 'url', 'content://'
formData.append 'type', file.type
formData.append 'content', file
```
+ Body
+ Response 202
Sharing was successful and will be processed.
+ Headers
Location: /job/b8838e11-1d97-4799-85d8-1aafec52e927
+ Body
+ Response 422
Missing required parameters
+ Body
+ Response 403
Not allowed to share to the specified website
+ Body
## Items list [/item]
### Retrieve user's content items [GET]
When an item is being worked on by a user it is available via the API.
+ Response 200 (application/json)
### Create an item [POST]
+ Response 201
+ Headers
Location: /item/b8838e11-1d97-4799-85d8-1aafec52e927
+ Response 422
Missing item information
+ Body
## Item [/item/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Retrieve an item [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/item.json) -->
```
+ Response 404
### Update item [PUT]
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/item.json) -->
```
+ Response 422
Missing item information
+ Body
### Update item metadata [PATCH]
+ Response 204
+ Response 422
Missing item information
+ Body
### Remove item [DELETE]
+ Response 204
## Publishing [/publish]
### Publish an item to sites [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(schema/publish.json) -->
```
+ Response 202
## Unpublishing [/unpublish]
### Unpublish an item from sites [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(schema/publish.json) -->
```
+ Response 202
# Group Client Application
Client application registration allows a Grid app to receive notifications about changes to data.
The notifications sent to clients use the [notifications schema](schema/notification.json).
When reacting to an action the client needs to make the request using the regular Bearer token.
## User clients [/client]
### List user's active client apps [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/client-gcm.json) -->
<!-- include(examples/client-apn.json) -->
]
```
### Register a new client app [POST]
+ Request (application/json)
+ Body
```
<!-- include(examples/client-gcm.json) -->
```
+ Schema
```
<!-- include(schema/client.json) -->
```
+ Response 201
+ Headers
Location: /client/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
## Client app [/client/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Remove a client app [DELETE]
+ Response 204
## Notifications testing [/molly/repeat]
### Send a test notification [POST]
For development purposes, you can make Molly talk to you over the registered notification channels (like Google Cloud Messaging).
A push message will be sent to the user's all registered clients.
+ Request (application/json)
+ Schema
```
<!-- include(schema/notification.json) -->
```
+ Response 202
|
FORMAT: 1A
HOST: https://api.thegrid.io/
# The Grid API
# Group Long-running jobs
Several actions in the API takes a significant time.
Current examples include POST /share, /publish and /unpublish.
Performing such an action returns a Location header with a Job URL.
## Job details [/job/{id}]
### Retriving job details [GET]
+ Parameters
+ id (required, string) - Job UUID
+ Response 200 (application/json)
+ Body
```
<!-- include(examples/job-share-completed.json) -->
```
## Jobs [/job]
### Listing current jobs [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/job-share-completed.json) -->
]
```
# Group Site Management
## Site information [/site]
### List user websites [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/site-minimal.json) -->
]
```
### Create a website [POST]
+ Request (application/json)
**Note:** the repository must be in `the-domains` organization. The repository name can later be used for sharing content to the newly-created site.
+ Body
```
<!-- include(examples/site-without-owner.json) -->
```
+ Schema
```
<!-- include(schema/site.json) -->
```
+ Response 201
Site was successfully created
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 422
Missing site information
+ Body
## User website [/site/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Get website details [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/site.json) -->
```
### Update website details [PUT]
+ Request (application/json)
+ Body
```
<!-- include(examples/site-with-config.json) -->
```
+ Schema
```
<!-- include(schema/site.json) -->
```
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/site.json) -->
```
### Delete website [DELETE]
+ Response 200
## Website discovery [/site/discover{?url}]
### Match URL to a website [GET]
+ Parameters
+ url (required, string) - URL of the website
+ Response 302
+ Headers
Location: /site/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
+ Response 404
No Grid site was found for the URL
+ Body
# Group Content Management
## Share [/share]
### Sharing content [POST]
Users can share content to The Grid. The shared items will be normalized, analyzed and made available via the item API.
Sharing creates a Job, whos progress can be monitored using the /job API.
There are typically three different things you can be sharing:
* Full article pages: share with URL
* HTML fragments: selection or img tag. Share with content, type text/html and with the URL of the originating page
* Uploaded files: image, word document, HTML file, Markdown file, etc. Share with multi-part upload, URL and MIME type needed
Note that publishing an item to a website is a separate step. See /publish
+ Request with JSON payload (application/json)
+ Body
```
<!-- include(examples/share-url-only.json) -->
```
+ Schema
```
<!-- include(schema/share.json) -->
```
+ Request with file upload (multipart/form-data)
For images and other files the content is a file sent via multipart/form-data. If there is no relevant URL for the content, it is a good idea to generate a UUID URI.
```
formData = new FormData()
formData.append 'url', 'content://'
formData.append 'type', file.type
formData.append 'content', file
```
+ Body
+ Response 202
Sharing was successful and will be processed.
+ Headers
Location: /job/b8838e11-1d97-4799-85d8-1aafec52e927
+ Body
+ Response 422
Missing required parameters
+ Body
+ Response 403
Not allowed to share to the specified website
+ Body
## Items list [/item]
### Retrieve user's content items [GET]
When an item is being worked on by a user it is available via the API.
+ Response 200 (application/json)
### Create an item [POST]
+ Response 201
+ Headers
Location: /item/b8838e11-1d97-4799-85d8-1aafec52e927
+ Response 422
Missing item information
+ Body
## Item [/item/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Retrieve an item [GET]
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/item.json) -->
```
+ Response 404
### Update item [PUT]
+ Response 200 (application/json)
+ Schema
```
<!-- include(schema/item.json) -->
```
+ Response 422
Missing item information
+ Body
### Update item metadata [PATCH]
+ Response 204
+ Response 422
Missing item information
+ Body
### Remove item [DELETE]
+ Response 204
## Publishing [/publish]
### Publish an item to sites [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(schema/publish.json) -->
```
+ Response 202
## Unpublishing [/unpublish]
### Unpublish an item from sites [POST]
TODO: make return a Job id in Location header
+ Request (application/json)
+ Body
```
<!-- include(examples/publish-with-sites.json) -->
```
+ Schema
```
<!-- include(schema/publish.json) -->
```
+ Response 202
# Group Client Application
Client application registration allows a Grid app to receive notifications about changes to data.
The notifications sent to clients use the [notifications schema](schema/notification.json).
When reacting to an action the client needs to make the request using the regular Bearer token.
## User clients [/client]
### List user's active client apps [GET]
+ Response 200 (application/json)
+ Body
```
[
<!-- include(examples/client-gcm.json) -->
<!-- include(examples/client-apn.json) -->
]
```
### Register a new client app [POST]
+ Request (application/json)
+ Body
```
<!-- include(examples/client-gcm.json) -->
```
+ Schema
```
<!-- include(schema/client.json) -->
```
+ Response 201
+ Headers
Location: /client/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177
## Client app [/client/{id}]
+ Parameters
+ id (required, string) - Site UUID
### Remove a client app [DELETE]
+ Response 204
## Notifications testing [/molly/repeat]
### Send a test notification [POST]
For development purposes, you can make Molly talk to you over the registered notification channels (like Google Cloud Messaging).
A push message will be sent to the user's all registered clients.
+ Request (application/json)
+ Schema
```
<!-- include(schema/notification.json) -->
```
+ Response 202
|
DELETE site
|
DELETE site
|
API Blueprint
|
mit
|
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
|
69498a2a9c17c9e5b638a7431a4331b44e109b63
|
apiary.apib
|
apiary.apib
|
HOST: http://dcp.jboss.org/v1
--- Distributed Contribution Platform API v1 ---
---
# Overview
**Distributed Contribution Platform** provides **Rest API** for data manipulation and search.
# DCP Content object
This is main content object which can be pushed/retrieved or searched.
DCP Content object is JSON document with free structure. There is no restriction how many key value pairs must be defined or in which structure.
However this document is during push to DCP and reindex normalized and internal DCP data are added. Those data are prefixed by dcp_.
DCP Content described by example:
{
Free JSON Structure repsesenting content. Can be one key value pair or something more structured.
It's defined only by source provider.
"tags": ["Content tag1", "tag2", "tag2"],
"dcp_content_id": "Any value from content provider",
"dcp_content_typev: "Source provider type like 'issue'"
"dcp_content_provider": "Name of content provider like JIRA River"
"dcp_id": "internal_id"
"dcp_title": "Content Title"
"dcp_url_view": "URL representing content view"
"dcp_description": "Short description used by search GUI"
"dcp_type": "Normalized internal type of content"
"dcp_updated": "Timestamp of last update"
"dcp_project": "Normalized internal project"
"dcp_contributors": ["Firstname Lastname <e-mail>", "Firstname Lastname <e-mail>"]
"dcp_activity_dates": [Timestamp1, Timestamp2]
"dcp_tags": ["Tags constructed from 'tags' tag and user tags from persistance storage"]
}
All DCP Internal data are set during push and reindex except these which can be defined during data push:
* `dcp_title`
* `dcp_url_view`
* `dcp_description`
---
--
Authentication
Distinct operations needs to be authenticated. Content provider provides credintials by URL parameters provider and password or via standard HTTP Basic authentication.
If authentication is not successfull then standard forbidden http code is returned.
--
--
Content
--
Return Document JSON data
GET /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
All content for specified type.
GET /rest/content/{type}
< 200
< Content-Type: application/json
{
"total": "count of returned values",
"hits": [
{
"id": "internal dcp id of document"
"data": "document content"
}
]
}
JSON document in http body which is pushed to DCP.
Http body empty
POST /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
Document deleted
DELETE /rest/content/{type}/{id}
< 200
--
Search
--
Search contributions.
GET /rest/search?TODO
< 200
{ "foo": "bar" }
--
Suggestions
--
Get suggestions for user query.
Returned JSON contains two parts:
- `view`
- `model`
#### view
The `view` represents the visual part of query suggestions.
It *always* contains section `search` which will *always* have only one option matching incoming user query.
It can then contain one or more additional sections (like `suggestions`, `filters`, `mails`, ... etc.).
#### model
The `model` represents possible "actions" that are relevant to individual `option`s in the `view` part.
This means both `view` and `model` parts have the same highlevel structure and each `option`
in the `view` part have corresponding "action" in the `model` part.
Individual actions are described using symbolic commands. Interpretation of these commands is up to the client
the following is just a recommendation about how client can interpret the commands:
##### Commands:
`search` - execute search for `query` value.
`suggestion` - replace text in the search field with the `value`'s value.
`filter` - replace current filters with provided filters.
`filter_add` - enable provided filters (on top of currently active filters).
... more TDB.
GET /rest/suggestions/query_string?q={user_query_string}
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["${query_string}"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"option #1",
"option #2",
"..."
]
},
"filters": {
"caption": "Filters",
"options": [
"option #1",
"option #2",
"..."
]
},
"mails": {
"caption": "Mails",
"options": [
"option #1",
"option #2",
"..."
]
}
},
"model" : {
"search": {
"search": { "query": "${query_string}" }
},
"suggestions" : [
{ "action #1" },
{ "action #2" },
{ "..." }
],
"filters": [
{ "action #1" },
{ "action #2" },
{ "..." }
],
"mails": [
{ "action #1" },
{ "action #2" },
{ "..." }
]
}
}
Example for user query 'Hiberna'.
GET /rest/suggestions/query_string?q=Hiberna
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["Hiberna"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"<strong>Hiberna</strong>te",
"<strong>Hiberna</strong>te query",
"<strong>Hiberna</strong>te session"
]
},
"filters": {
"caption": "Filters",
"options": [
"<strong>Add</strong> project filter for <strong>Hibernate</strong>",
"<strong>Add</strong> project filter for <strong>Infinispan</strong>",
"<strong>Search</strong> project <strong>Hibernate</strong> only"
]
},
"mails": {
"caption": "Mails",
"options": [
"<strong>Add</strong> some Mails filter",
"Do some other fancy thing here",
"Or do something else"
]
}
},
"model" : {
"search": { "search": { "query": "Hiberna" } },
"suggestions" : [
{ "suggestion": { "value": "Hibernate" }, "search": { "query": "Hibernate" } },
{ "suggestion": { "value": "Hibernate query" }, "search": { "query": "Hibernate query" } },
{ "suggestion": { "value": "Hibernate session" }, "search": { "query": "Hibernate session" } }
],
"filters": [
{ "filter_add": [ "Hibernate" ] },
{ "filter_add": [ "Infinispan" ] },
{ "filter": [ "Hibernate" ] }
],
"mails": [
{ "filter_add": [ "foo" ] },
{},
{}
]
}
}
|
HOST: http://dcp.jboss.org/v1
--- Distributed Contribution Platform API v1 ---
---
# Overview
**Distributed Contribution Platform** provides **Rest API** for data manipulation and search.
# DCP Content object
This is main content object which can be pushed/retrieved or searched.
DCP Content object is JSON document with free structure. There is no restriction how many key value pairs must be defined or in which structure.
However this document is during push to DCP and reindex normalized and internal DCP data are added. Those data are prefixed by dcp_.
DCP Content described by example:
{
Free JSON Structure repsesenting content. Can be one key value pair or something more structured.
It's defined only by source provider.
"tags": ["Content tag1", "tag2", "tag2"],
"dcp_content_id": "Any value from content provider",
"dcp_content_typev: "Source provider type like 'issue'"
"dcp_content_provider": "Name of content provider like JIRA River"
"dcp_id": "internal_id"
"dcp_title": "Content Title"
"dcp_url_view": "URL representing content view"
"dcp_description": "Short description used by search GUI"
"dcp_type": "Normalized internal type of content"
"dcp_updated": "Timestamp of last update"
"dcp_project": "Normalized internal project"
"dcp_contributors": ["Firstname Lastname <e-mail>", "Firstname Lastname <e-mail>"]
"dcp_activity_dates": [Timestamp1, Timestamp2]
"dcp_tags": ["Tags constructed from 'tags' tag and user tags from persistance storage"]
}
All DCP Internal data are set during push and reindex except these which can be defined during data push:
* `dcp_title`
* `dcp_url_view`
* `dcp_description`
---
--
Authentication
Distinct operations needs to be authenticated. Content provider provides credintials by URL parameters provider and password or via standard HTTP Basic authentication.
If authentication is not successfull then standard forbidden http code is returned.
--
--
Content
--
Return Document JSON data
GET /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
All content for specified type.
GET /rest/content/{type}
< 200
< Content-Type: application/json
{
"total": "count of returned values",
"hits": [
{
"id": "internal dcp id of document"
"data": "document content"
}
]
}
JSON document in http body which is pushed to DCP.
Http body empty
POST /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
Document deleted
DELETE /rest/content/{type}/{id}
< 200
--
Search
--
Search contributions.
GET /rest/search?TODO
< 200
{ "foo": "bar" }
--
Suggestions
--
Get suggestions for user query.
Returned JSON contains two parts:
- `view`
- `model`
#### view
The `view` represents the visual part of query suggestions.
It *always* contains section `search` which will *always* have only one option matching incoming user query.
It can then contain one or more additional sections (like `suggestions`, `filters`, `mails`, ... etc.).
#### model
The `model` represents possible "actions" that are relevant to individual `option`s in the `view` part.
This means both `view` and `model` parts have the same highlevel structure and each `option`
in the `view` part have corresponding "action" in the `model` part.
Individual actions are described using symbolic commands. Interpretation of these commands is up to the client
the following is just a recommendation about how client can interpret the commands:
##### Commands:
`search` - execute search for `query` value.
`suggestion` - replace text in the search field with the `value`'s value.
`filter` - replace current filters with provided filters.
`filter_add` - enable provided filters (on top of currently active filters).
... more TDB.
GET /rest/suggestions/query_string?q={user_query_string}
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["${query_string}"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"option #1",
"option #2",
"..."
]
},
"filters": {
"caption": "Filters",
"options": [
"option #1",
"option #2",
"..."
]
},
"mails": {
"caption": "Mails",
"options": [
"option #1",
"option #2",
"..."
]
}
},
"model" : {
"search": {
"search": { "query": "${query_string}" }
},
"suggestions" : [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"filters": [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"mails": [
{ "action #1": {} },
{ "action #2": {} },
{ }
]
}
}
Example for user query 'Hiberna'.
GET /rest/suggestions/query_string?q=Hiberna
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["Hiberna"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"<strong>Hiberna</strong>te",
"<strong>Hiberna</strong>te query",
"<strong>Hiberna</strong>te session"
]
},
"filters": {
"caption": "Filters",
"options": [
"<strong>Add</strong> project filter for <strong>Hibernate</strong>",
"<strong>Add</strong> project filter for <strong>Infinispan</strong>",
"<strong>Search</strong> project <strong>Hibernate</strong> only"
]
},
"mails": {
"caption": "Mails",
"options": [
"<strong>Add</strong> some Mails filter",
"Do some other fancy thing here",
"Or do something else"
]
}
},
"model" : {
"search": { "search": { "query": "Hiberna" } },
"suggestions" : [
{ "suggestion": { "value": "Hibernate" }, "search": { "query": "Hibernate" } },
{ "suggestion": { "value": "Hibernate query" }, "search": { "query": "Hibernate query" } },
{ "suggestion": { "value": "Hibernate session" }, "search": { "query": "Hibernate session" } }
],
"filters": [
{ "filter_add": [ "Hibernate" ] },
{ "filter_add": [ "Infinispan" ] },
{ "filter": [ "Hibernate" ] }
],
"mails": [
{ "filter_add": [ "foo" ] },
{},
{}
]
}
}
|
fix invalid JSON response
|
fix invalid JSON response
|
API Blueprint
|
apache-2.0
|
ollyjshaw/searchisko,searchisko/searchisko,ollyjshaw/searchisko,searchisko/searchisko,searchisko/searchisko,ollyjshaw/searchisko
|
9a8f833587a9210b2b20eed567cf0ae0884712e1
|
doc/apiary.apib
|
doc/apiary.apib
|
FORMAT: X-1A
# Jobs API v1.0
Welcome to the our Jobs API documentation.
## Job Offer Resources
The following is a section of resources related to the job offers
## Job offer [/job/{webid}|{graphid}]
Get Job Offer informations using either a GraphID or a webID
### Get a Job offer [GET]
+ Parameters
+ id (required, graphid, `0023ac3vf970lf7p`) ... Id of a job.
+ Response 200 (application/json)
{
"type": "MOBILE JOB",
"updated_time" : "2013-09-24T10:23:38+0200
}
+ Response 400 (application/json)
## Apply to a job offer [/user/{webid}|{graphid}/apply/job/{webid}|{graphid}]
Apply to a job offer
### Apply to a job offer [POST]
+ Request (application/json)
{
"message": "message of my application"
}
+ Response 201 (application/json)
{
"status": "created"
}
|
FORMAT: X-1A
# Jobs API v1.1
Welcome to the our Jobs API documentation.
## Job Offer Resources
The following is a section of resources related to the job offers
## Job offer [/job/{webid}|{graphid}]
Get Job Offer informations using either a GraphID or a webID
### Get a Job offer [GET]
+ Parameters
+ id (required, graphid, `0023ac3vf970lf7p`) ... Id of a job.
+ Response 200 (application/json)
{
"type": "MOBILE JOB",
"updated_time" : "2013-09-24T10:23:38+0200
}
+ Response 400 (application/json)
## Apply to a job offer [/user/{webid}|{graphid}/apply/job/{webid}|{graphid}]
Apply to a job offer
### Apply to a job offer [POST]
+ Request (application/json)
{
"message": "message of my application"
}
+ Response 201 (application/json)
{
"status": "created"
}
|
Update apiary.apib
|
Update apiary.apib
|
API Blueprint
|
mit
|
yannickcr/test
|
fdc10f75cc28606ac92211666bd990541a84e024
|
STATION-METADATA-API-BLUEPRINT.apib
|
STATION-METADATA-API-BLUEPRINT.apib
|
FORMAT: 1A
Station Metadata API
=============================
# General information
This Service exists to provide the canonical API for querying and returning MeteoGroup stations and their capabilities.
The output response with requested stations is always in GEOJson format.
## Requesting the Data
The GEOJson information about stations might be requested either by bounding box or by polygon.
## Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `station-metadata`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/refactor-2-guideline/authorization/Authentication.md)
### Cache control headers:
if data unchanged since this date using the If-Modified-Since request header
the server will return with an empty body with the 304 response code. Ex:
+ Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ If-Modified-Since: Thu, 13 Jul 2017 10:55:53 GMT
### Querying MeteoGroup stations data
Here is the information about all supported HTTP request parameters and HTTP Headers:
+ Headers
+ Authorization: Bearer {ENCRYPTED TOKEN HERE}
+ If-Modified-Since: {DATE}
+ Parameters
+ locatedWithin:
- {"type":"bbox","coordinates":[[lon,lat],[lon,lat]]} (string, optional) - top left and bottom right coordinates that construct bounding box;
- {"type":"polygon","coordinates":[[[-10,10],[10,5],[-5,-5],[-10,10]],[[-5,5],[0,5],[0,0],[-5,5]]]} - polygon coordinates.
- {"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]} - An array of separate polygons.
- First polygons array describes polygon and another describe holes in it.
- **lon** in degree numeric format and in range <-180,180> eg. -123.454, 179.864
- **lat** in degree numeric format and in range <-90,90> eg. -85.541, 5.32,
+ accessVisibility: `public` (string, optional) - station access visibility, valid values is `public` and `private`
+ provider: `WMO,MG` (string, optional) - currently filter by provider or providers. All possible providers are described in section: **Get all providers**
+ type: `SKI_RESORT` (string, optional) - currently filter by type. All possible types are described in section: **Get all station types**
+ hasForecastData: `false` (boolean, optional) - station has forecast data.
+ hasObservationData: `true` (boolean, optional) - station has observation data.
+ countryIsoCode: `GB` (string, optional) - station located in this country. ISO Code refers to the [ISO 3166 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166)
The API supports various combinations for querying stations data by bounding box, polygon, multi-polygon, by provider and type, by stations that produce forecast and observation data.
Here are a couple of examples how to query by provider and type, bounding box and polygon.
#### Querying by provider and type
Query example:
```
GET /stations?accessVisibility=public&provider=WMO&hasForecastData=true&hasObservationData=false&countryIsoCode=Ukraine
```
+ Response 200 (application/json)
+ Headers
Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ Body
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"icaoCode": "ENAS",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1004,
"name": "Ny-Alesund II",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
11.9222,
78.9233,
16
]
}
},
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1005,
"name": "Isfjord Radio",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
13.6333,
78.0667,
5
]
}
}
]
}
```
#### Querying by bounding box
Query example for getting stations by bounding box: ```locatedWithin={"type":"bbox","coordinates":[[-10,80],[10,5]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22bbox%22%2C%22coordinates%22%3A%5B%5B-10%2C80%5D%2C%5B10%2C5%5D%5D%7D
```
If the station data are queried by bounding box, its important to set up the correct **locatedWithin** parameter: **"type":"box", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
The response body is the same as for querying stations by provider and type.
#### Querying by polygon
Query example for getting stations by polygon: ```locatedWithin={"type":"polygon","coordinates":[[[-0.16,51.70],[-0.43,51.29],[0.18,51.30],[-0.16,51.70]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22polygon%22%2C%22coordinates%22%3A%5B%5B%5B-0.16%2C51.70%5D%2C%5B-0.43%2C51.29%5D%2C%5B0.18%2C51.30%5D%2C%5B-0.16%2C51.70%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Querying by multi-polygon
Query example for getting stations by multi-polygon: ```locatedWithin={"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22multipolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B102.0%2C2.0%5D%2C%5B103.0%2C2.0%5D%2C%5B103.0%2C3.0%5D%2C%5B102.0%2C3.0%5D%2C%5B102.0%2C2.0%5D%5D%5D%2C%5B%5B%5B100.0%2C0.0%5D%2C%5B101.0%2C0.0%5D%2C%5B101.0%2C1.0%5D%2C%5B100.0%2C1.0%5D%2C%5B100.0%2C0.0%5D%5D%2C%5B%5B100.2%2C0.2%5D%2C%5B100.8%2C0.2%5D%2C%5B100.8%2C0.8%5D%2C%5B100.2%2C0.8%5D%2C%5B100.2%2C0.2%5D%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Get all station types
Query example:
```
GET /stations/types
```
Return all station types
```
[
"WMO",
"ROAD",
"VIRTUAL",
"OTHER_OBS_HQ",
"AVIATION",
"NMI_SECONDARY",
"SPECIAL_OBS",
"SKI",
"MARINE",
"MG_NETWORK",
"AIRQUALITY",
"RAIL",
"OTHER_OBS_LQ"
]
```
#### Get all providers
Query example:
```
GET /stations/providers
```
Return all providers
```
[
"ENGLN",
"NOWCAST",
"WMO",
"MG",
"VARIOUS",
"ICAO",
"CUSTOMER",
"MADIS/RAWS",
"DWD",
"SKI",
"EAUK",
"DACOM",
"SMHI",
"METEOSWISS",
"METEOFRANCE",
"KNMI",
"RAIL",
"USAF",
"BZIT",
"DWD/BuWe",
"MICKS",
"AMATEUR",
"TEMES",
"FUB",
"NATO"
]
```
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. If you do not, you will receive **empty** response with status code **400 Bad Request**.
|
FORMAT: 1A
Station Metadata API
=============================
# General information
This Service exists to provide the canonical API for querying and returning MeteoGroup stations and their capabilities.
The output response with requested stations is always in GEOJson format.
## Requesting the Data
The GEOJson information about stations might be requested either by bounding box or by polygon.
## Authentication
To access active-warning-service the request has to be authorised with a valid
JWT OAuth 2.0 access token, obtained from the MeteoGroup Authorisation server
`https://auth.weather.mg/oauth/token` with according client credentials. The
required scope is `station-metadata`.
The documentation about how to authenticate against MeteoGroup Weather API with
OAuth 2.0 can be found here: [Weather API documentation](https://github.com/MeteoGroup/weather-api/blob/refactor-2-guideline/authorization/Authentication.md)
### Cache control headers:
if data unchanged since this date using the If-Modified-Since request header
the server will return with an empty body with the 304 response code. Ex:
+ Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ If-Modified-Since: Thu, 13 Jul 2017 10:55:53 GMT
### Querying MeteoGroup stations data
Here is the information about all supported HTTP request parameters and HTTP Headers:
+ Headers
+ Authorization: Bearer {ENCRYPTED TOKEN HERE}
+ If-Modified-Since: {DATE}
+ Parameters
+ locatedWithin:
- {"type":"bbox","coordinates":[[lon,lat],[lon,lat]]} (string, optional) - top left and bottom right coordinates that construct bounding box;
- {"type":"polygon","coordinates":[[[-10,10],[10,5],[-5,-5],[-10,10]],[[-5,5],[0,5],[0,0],[-5,5]]]} - polygon coordinates.
- {"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]} - An array of separate polygons.
- First polygons array describes polygon and another describe holes in it.
- **lon** in degree numeric format and in range <-180,180> eg. -123.454, 179.864
- **lat** in degree numeric format and in range <-90,90> eg. -85.541, 5.32,
+ accessVisibility: `public` (string, optional) - station access visibility, valid values is `public` and `private`
+ provider: `WMO,MG` (string, optional) - currently filter by provider or providers. All possible providers are described in section: **Get all providers**
+ type: `SKI_RESORT` (string, optional) - currently filter by type. All possible types are described in section: **Get all station types**
+ hasForecastData: `false` (boolean, optional) - station has forecast data.
+ hasObservationData: `true` (boolean, optional) - station has observation data.
+ countryIsoCode: `GB` (string, optional) - station located in this country. ISO Code refers to the [ISO 3166 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166)
The API supports various combinations for querying stations data by bounding box, polygon, multi-polygon, by provider and type, by stations that produce forecast and observation data.
Here are a couple of examples how to query by provider and type, bounding box and polygon.
#### Querying by provider and type
Query example:
```
GET /stations?accessVisibility=public&provider=WMO&hasForecastData=true&hasObservationData=false&countryIsoCode=Ukraine
```
+ Response 200 (application/json)
+ Headers
Last-Modified: Mon, 10 Jul 2017 08:37:16 GMT
+ Body
```
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"icaoCode": "ENAS",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1004,
"name": "Ny-Alesund II",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
11.9222,
78.9233,
16
]
}
},
{
"type": "Feature",
"properties": {
"accessVisibility": "public",
"countryIsoCode": "NO",
"provider": "WMO",
"hasForecastData": true,
"wmoCountryId": 165,
"meteoGroupStationId": 1005,
"name": "Isfjord Radio",
"hasObservationData": false,
"stationTimeZoneName": "Arctic/Longyearbyen",
"type": "WMO"
},
"geometry": {
"type": "Point",
"coordinates": [
13.6333,
78.0667,
5
]
}
}
]
}
```
#### Querying by bounding box
Query example for getting stations by bounding box: ```locatedWithin={"type":"bbox","coordinates":[[-10,80],[10,5]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22bbox%22%2C%22coordinates%22%3A%5B%5B-10%2C80%5D%2C%5B10%2C5%5D%5D%7D
```
If the station data are queried by bounding box, its important to set up the correct **locatedWithin** parameter: **"type":"box", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
The response body is the same as for querying stations by provider and type.
#### Querying by polygon
Query example for getting stations by polygon: ```locatedWithin={"type":"polygon","coordinates":[[[-0.16,51.70],[-0.43,51.29],[0.18,51.30],[-0.16,51.70]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22polygon%22%2C%22coordinates%22%3A%5B%5B%5B-0.16%2C51.70%5D%2C%5B-0.43%2C51.29%5D%2C%5B0.18%2C51.30%5D%2C%5B-0.16%2C51.70%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Querying by multi-polygon
Query example for getting stations by multi-polygon: ```locatedWithin={"type":"multipolygon","coordinates":[[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],
[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],
[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}```
The HTTP request with encoded **locatedWithin** param is:
```
GET /stations?locatedWithin=%7B%22type%22%3A%22multipolygon%22%2C%22coordinates%22%3A%5B%5B%5B%5B102.0%2C2.0%5D%2C%5B103.0%2C2.0%5D%2C%5B103.0%2C3.0%5D%2C%5B102.0%2C3.0%5D%2C%5B102.0%2C2.0%5D%5D%5D%2C%5B%5B%5B100.0%2C0.0%5D%2C%5B101.0%2C0.0%5D%2C%5B101.0%2C1.0%5D%2C%5B100.0%2C1.0%5D%2C%5B100.0%2C0.0%5D%5D%2C%5B%5B100.2%2C0.2%5D%2C%5B100.8%2C0.2%5D%2C%5B100.8%2C0.8%5D%2C%5B100.2%2C0.8%5D%2C%5B100.2%2C0.2%5D%5D%5D%5D%7D
```
If the station data are queried by polygon box, appropriate "type" in **locatedWithin** parameter must be mentioned: **"type":"polygon", "coordinates":{...}**.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. Online URL encoder: http://www.url-encode-decode.com/
#### Get all station types
Query example:
```
GET /stations/types
```
Returns a list containing all current known station types. This list can be extended in the future.
#### Get all providers
Query example:
```
GET /stations/providers
```
Returns a list containing all current known data providers. This list can be extended in the future.
**NOTE**: The **locatedWithin** parameter has to be encoded before putting it to the request. If you do not, you will receive **empty** response with status code **400 Bad Request**.
|
remove known types.
|
remove known types.
|
API Blueprint
|
apache-2.0
|
MeteoGroup/weather-api,MeteoGroup/weather-api
|
f5437359e4bf7b758b697897bfb6e7aa7416edec
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://iot-camera-object-recognizer.herokuapp.com/webapi
# IOT Object Camera Recognizer.
IOT object camera recognizer.
Orginize camera objects list and check current state of stage.
# Ping [/ping]
## Ping service [GET]
Returns `200` if service is alive.
+ Response 200 (application/json)
# Get List or Add new Object api [/houses/{house_id}/objects]
+ Parameters
+ house_id (required, string, `76c6-456d-8971`) ... Unique house identifier
## List All Objects [GET]
Returns code 200 and list of jsons if correct house_id, 404 otherwise.
+ Response 200 (application/json)
+ Body
[
{
"id": "randomid1",
"type": "chair"
},
{
"id": "kokanto",
"type": "toxic"
},
{
"id": "randomid3",
"type": "table"
}
]
+ Response 404 (application/json)
## Add Object [POST]
You may put new object in camera known list(placed on the stage).
If house_id is incorrect 404 is returned.
+ type (string) - object type
+ Request (application/json)
{
"type": "alien"
}
+ Response 200 (application/json)
+ Body
{
"id": "newObjectId",
"type": "alien"
}
+ Response 404 (application/json)
# Manage Known objects api [/houses/{house_id}/objects/{object_id}]
+ Parameters
+ object_id (required, string, `76c6-456d-8971`) ... ID of an object, returned by api when called put object
### Get Object by id [GET]
Get an object type by id, if house_id or object_id is not valid 404 is returned.
+ Response 200 (application/json)
+ Body
{
"id": "requestedid",
"type": "objecttype"
}
+ Response 404 (application/json)
### Put Object by id [PUT]
You may update object type by id. 404 if invalid ids
+ type (string): new object type
+ Request (application/json)
{
"type": "newType"
}
+ Response 200 (application/json)
+ Response 404 (application/json)
### Delete Object by id [DELETE]
You may delete object type by id. 404 if invalid ids
+ type (string): new object type
+ Response 200 (application/json)
+ Response 404 (application/json)
# Check for unknown objects api [GET/houses/{house_id}/check]
You may ask recognizer for uknown objects on the stage.
if result is false then list of objects is returned as value of "objects"
key. If everything is Ok then only result true is returned.
404 is returned if house_id is invalid.
+ Parameters
+ house_id - string, same house identifier as in manage objects api.
+ Response 200 (application/json)
+ Body
{
"result": false,
"objects": [
"unknownchair",
"unknownkoka",
"unknownakunamatata"
]
}
+ Response 404 (application/json)
|
FORMAT: 1A
HOST: http://iot-camera-object-recognizer.herokuapp.com/webapi
# IOT Object Camera Recognizer.
IOT object camera recognizer.
Orginize camera objects list and check current state of stage.
# Ping [/ping]
## Ping service [GET]
Returns `200` if service is alive.
+ Response 200 (application/json)
# Get List or Add new Object api [/houses/{house_id}/objects]
+ Parameters
+ house_id (required, string, `76c6-456d-8971`) ... Unique house identifier
## List All Objects [GET]
Returns code 200 and list of jsons if correct house_id, 404 otherwise.
+ Response 200 (application/json)
+ Body
[
{
"id": "randomid1",
"type": "chair"
},
{
"id": "kokanto",
"type": "toxic"
},
{
"id": "randomid3",
"type": "table"
}
]
+ Response 404 (application/json)
## Add Object [POST]
You may put new object in camera known list(placed on the stage).
If house_id is incorrect 404 is returned.
+ type (string) - object type
+ Request (application/json)
{
"type": "alien"
}
+ Response 200 (application/json)
+ Body
{
"id": "newObjectId",
"type": "alien"
}
+ Response 404 (application/json)
# Manage Known objects api [/houses/{house_id}/objects/{object_id}]
+ Parameters
+ object_id (required, string, `76c6-456d-8971`) ... ID of an object, returned by api when called put object
### Get Object by id [GET]
Get an object type by id, if house_id or object_id is not valid 404 is returned.
+ Response 200 (application/json)
+ Body
{
"id": "requestedid",
"type": "objecttype"
}
+ Response 404 (application/json)
### Put Object by id [PUT]
You may update object type by id. 404 if invalid ids
+ type (string): new object type
+ Request (application/json)
{
"type": "newType"
}
+ Response 200 (application/json)
+ Body
{
"id": "objectid",
"type": "newType"
}
+ Response 404 (application/json)
### Delete Object by id [DELETE]
You may delete object type by id. 404 if invalid ids
+ type (string): new object type
+ Response 200 (application/json)
+ Response 404 (application/json)
# Check for unknown objects api [GET/houses/{house_id}/check]
You may ask recognizer for uknown objects on the stage.
if result is false then list of objects is returned as value of "objects"
key. If everything is Ok then only result true is returned.
404 is returned if house_id is invalid.
+ Parameters
+ house_id - string, same house identifier as in manage objects api.
+ Response 200 (application/json)
+ Body
{
"result": false,
"objects": [
"unknownchair",
"unknownkoka",
"unknownakunamatata"
]
}
+ Response 404 (application/json)
|
Update API blueprints
|
Update API blueprints
|
API Blueprint
|
mit
|
freeuni-sdp/iot-camera-object-recognizer
|
6c219f92afe080341462f52132afd528618c01c6
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
# Keystone SCIM
Keystone SCIM is an OpenStack Keystone extension that enables the management
of User, Groups and Roles using [SCIM v1.1 standard](
http://www.simplecloud.info). As any Keystone extension, it's designed to be
installed on top of an existing Keystone installation, following Keystone
recommendations for extensions.
A brief description of SCIM:
> The SCIM standard was created to simplify user management in the cloud by
defining a schema for representing users and groups and a REST API for all
the necessary CRUD operations.
SCIM User and Group API are a direct translation of Keystone User and Group
APIs, they even share the same security policies (with the exact same names).
On the other hand, SCIM Roles are slightly different from Keystone Roles: now
SCIM Roles are _domain aware_. The extension implementation does not make
any modification to the underlying database, in order to maintain backward
compatibility with Keystone Roles API.
SCIM Roles are implemented on top of Keystone Roles, prefixing the `domain
id` to the role name. You may argue that this is a kinda of a hack, and the
relational integrity is not maintained. And that's true, but in this way the
database schema is not modified and thus the Keystone Roles API can interact
with SCIM Roles _out-of-the-box_.
# Group Users
## Users Collection [/v3/OS-SCIM/Users{?domain_id}{?count}{?startIndex}]
### Create an User [POST]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"displayName": "Alice Smith",
"password": "passw0rd",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"id": "19041ee7679649879ada04417753ad4d",
"displayName": "Alice Smith",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### List Users [GET]
+ Parameters
+ domain_id (optional, string) ... filter users by its domain
+ count (optional, int) ... (pagination) limit the number of results
+ startIndex (optional, int) ... (pagination) the start of the listing
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200 (application/json)
```json
{
"Resources": [
{
"active": true,
"userName": "alice",
"displayName": "Alice Smith",
"id": "19041ee7679649879ada04417753ad4d",
"emails": [
{
"value": "[email protected]"
}
],
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
],
"schemas": [
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"
]
}
```
## User Resource [/v3/OS-SCIM/Users/{id}]
+ Parameters
+ id (string) ... The User Id.
### Update an existing User [PUT]
+ Request
+ Parameters
+ id (string, mandatory) ... The User Id.
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"id": "19041ee7679649879ada04417753ad4d",
"displayName": "Alice Smith",
"password": "N3W-passw0rd",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"displayName": "Alice Smith",
"id": "19041ee7679649879ada04417753ad4d",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Get an existing User [GET]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"displayName": "Alice Smith",
"id": "19041ee7679649879ada04417753ad4d",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Delete an existing User [DELETE]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 204
# Group Groups
## Groups Collection [/v3/OS-SCIM/Groups{?domain_id}{?count}{?startIndex}]
### Create a Group [POST]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "aGroup",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "aGroup",
"id": "1d50bfc013ee407c84daa4912bf870b1"
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### List Groups [GET]
+ Parameters
+ domain_id (optional, string) ... filter users by its domain
+ count (optional, int) ... (pagination) limit the number of results
+ startIndex (optional, int) ... (pagination) the start of the listing
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200 (application/json)
```json
{
"Resources": [
{
"displayName": "aGroup",
"id": "19041ee7679649879ada04417753ad4d",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
],
"schemas": [
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"
]
}
```
## Group Resource [/v3/OS-SCIM/Groups/{id}]
+ Parameters
+ id (string) ... The Group Id.
### Update an existing Group [PUT]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"id": "19041ee7679649879ada04417753ad4d",
"displayName": "New Group Name",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "New Group Name",
"id": "19041ee7679649879ada04417753ad4d",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Get an existing Group [GET]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "New Group Name",
"id": "19041ee7679649879ada04417753ad4d",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Delete an existing Group [DELETE]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 204
# Group Roles
## Roles Collection [/v3/OS-SCIM/Roles{?domain_id}{?count}{?startIndex}]
### Create an Roles [POST]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
### List Roles [GET]
+ Parameters
+ domain_id (optional, string) ... filter users by its domain
+ count (optional, int) ... (pagination) limit the number of results
+ startIndex (optional, int) ... (pagination) the start of the listing
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200 (application/json)
```json
{
"Resources": [
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
],
"schemas": [
"urn:scim:schemas:extension:keystone:1.0"
]
}
```
## Role Resource [/v3/OS-SCIM/Roles/{id}]
+ Parameters
+ id (string) ... The User Id.
### Update an existing Role [PUT]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aNewRoleName",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aNewRoleName",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
### Get an existing Role [GET]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
### Delete an existing Role [DELETE]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 204
|
FORMAT: 1A
# Keystone SCIM
Keystone SCIM is an OpenStack Keystone extension that enables the management
of User, Groups and Roles using [SCIM v1.1 standard](
http://www.simplecloud.info). As any Keystone extension, it's designed to be
installed on top of an existing Keystone installation, following Keystone
recommendations for extensions.
A brief description of SCIM:
> The SCIM standard was created to simplify user management in the cloud by
defining a schema for representing users and groups and a REST API for all
the necessary CRUD operations.
SCIM User and Group API are a direct translation of Keystone User and Group
APIs, they even share the same security policies (with the exact same names).
On the other hand, SCIM Roles are slightly different from Keystone Roles: now
SCIM Roles are _domain aware_. The extension implementation does not make
any modification to the underlying database, in order to maintain backward
compatibility with Keystone Roles API.
SCIM Roles are implemented on top of Keystone Roles, prefixing the `domain
id` to the role name. You may argue that this is a kinda of a hack, and the
relational integrity is not maintained. And that's true, but in this way the
database schema is not modified and thus the Keystone Roles API can interact
with SCIM Roles _out-of-the-box_.
This document specifies the SCIM API, but do not attemp to describe Keystone,
as it is already specified by OpenStack. For information regarding obtaining
token for use Keystone API, management of Keystone resources (Domains,
Projects, Users, Groups, Roles, Role assigment) please refer to [Keystone
official documentation](https://github.com/openstack/identity-api/tree/master/v3/src/markdown).
# Group Users
## Users Collection [/v3/OS-SCIM/Users{?domain_id}{?count}{?startIndex}]
### Create an User [POST]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"displayName": "Alice Smith",
"password": "passw0rd",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"id": "19041ee7679649879ada04417753ad4d",
"displayName": "Alice Smith",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### List Users [GET]
+ Parameters
+ domain_id (optional, string) ... filter users by its domain
+ count (optional, int) ... (pagination) limit the number of results
+ startIndex (optional, int) ... (pagination) the start of the listing
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200 (application/json)
```json
{
"Resources": [
{
"active": true,
"userName": "alice",
"displayName": "Alice Smith",
"id": "19041ee7679649879ada04417753ad4d",
"emails": [
{
"value": "[email protected]"
}
],
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
],
"schemas": [
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"
]
}
```
## User Resource [/v3/OS-SCIM/Users/{id}]
+ Parameters
+ id (string) ... The User Id.
### Update an existing User [PUT]
+ Request
+ Parameters
+ id (string, mandatory) ... The User Id.
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"id": "19041ee7679649879ada04417753ad4d",
"displayName": "Alice Smith",
"password": "N3W-passw0rd",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"displayName": "Alice Smith",
"id": "19041ee7679649879ada04417753ad4d",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Get an existing User [GET]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"userName": "alice",
"displayName": "Alice Smith",
"id": "19041ee7679649879ada04417753ad4d",
"emails": [
{
"value": "[email protected]"
}
],
"active": true,
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Delete an existing User [DELETE]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 204
# Group Groups
## Groups Collection [/v3/OS-SCIM/Groups{?domain_id}{?count}{?startIndex}]
### Create a Group [POST]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "aGroup",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "aGroup",
"id": "1d50bfc013ee407c84daa4912bf870b1"
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### List Groups [GET]
+ Parameters
+ domain_id (optional, string) ... filter users by its domain
+ count (optional, int) ... (pagination) limit the number of results
+ startIndex (optional, int) ... (pagination) the start of the listing
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200 (application/json)
```json
{
"Resources": [
{
"displayName": "aGroup",
"id": "19041ee7679649879ada04417753ad4d",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
],
"schemas": [
"urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"
]
}
```
## Group Resource [/v3/OS-SCIM/Groups/{id}]
+ Parameters
+ id (string) ... The Group Id.
### Update an existing Group [PUT]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"id": "19041ee7679649879ada04417753ad4d",
"displayName": "New Group Name",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "New Group Name",
"id": "19041ee7679649879ada04417753ad4d",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Get an existing Group [GET]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:core:1.0",
"urn:scim:schemas:extension:keystone:1.0"],
"displayName": "New Group Name",
"id": "19041ee7679649879ada04417753ad4d",
"urn:scim:schemas:extension:keystone:1.0": {
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
}
```
### Delete an existing Group [DELETE]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 204
# Group Roles
## Roles Collection [/v3/OS-SCIM/Roles{?domain_id}{?count}{?startIndex}]
### Create an Roles [POST]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df"
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
### List Roles [GET]
+ Parameters
+ domain_id (optional, string) ... filter users by its domain
+ count (optional, int) ... (pagination) limit the number of results
+ startIndex (optional, int) ... (pagination) the start of the listing
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200 (application/json)
```json
{
"Resources": [
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
],
"schemas": [
"urn:scim:schemas:extension:keystone:1.0"
]
}
```
## Role Resource [/v3/OS-SCIM/Roles/{id}]
+ Parameters
+ id (string) ... The User Id.
### Update an existing Role [PUT]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
Content-Type: application/son
```
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aNewRoleName",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aNewRoleName",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
### Get an existing Role [GET]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 200
+ Body
```json
{
"schemas": ["urn:scim:schemas:extension:keystone:1.0"],
"name": "aRole",
"domain_id": "91d79dc2211d43a7985ebc27cdd146df",
"id": "2e24460ee4bd40c0aaac2f4317a77706"
}
```
### Delete an existing Role [DELETE]
+ Request
+ Headers
```
X-Auth-Token: <TOKEN>
```
+ Response 204
|
ADD link to Keystone official documentation
|
ADD link to Keystone official documentation
|
API Blueprint
|
apache-2.0
|
telefonicaid/fiware-keystone-scim,telefonicaid/fiware-keystone-scim,ging/fiware-keystone-scim,ging/fiware-keystone-scim
|
2f5a4397eccafe0ebb30bc4144c50716726c06bd
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://localhost:3993
# scifgif
Humorous image microservice for isolated networks - xkcd and giphy full text search API
## xkcd [/xkcd]
### Get Random Xkcd Comic [GET]
## xkcd [/xkcd/number/{number}]
### Get Xkcd by Number [GET]
+ Parameters
+ number: `1319` (number, required) - The xkcd comic ID
## xkcd [/xkcd/search]
### Get Xkcd Search [GET]
+ ```query```: Query (string, required) - Search terms
## xkcd [/xkcd/slash]
### Send xkcd slash query [POST]
+ ```text```: Query (string, required) - Search terms
## xkcd [/xkcd/new_post]
### Send xkcd outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
## Giphy [/giphy]
### Get Random Giphy Gif [GET]
## giphy GET [/giphy/search]
### Get Giphy Search [GET]
+ ```query```: Query (string, required) - Search terms
## Giphy [/giphy/slash]
### Send Giphy slash query [POST]
+ ```text```: Query (string, required) - Search terms
## Giphy [/giphy/new_post]
### Send Giphy outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
## image [/image/{folder}/{file}]
### Get Image [GET]
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
### Delete Image [DELETE]
Allows users to delete possibly offensive images
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
+ Response 200 (text/plain)
HTTP/1.1 200 OK
Content-Length: 27
Content-Type: text/plain; charset=utf-8
Date: Thu, 03 Aug 2017 19:45:20 GMT
image successfully removed
|
FORMAT: 1A
HOST: http://localhost:3993
# scifgif
Humorous image microservice for isolated networks - xkcd and giphy full text search API
## xkcd [/xkcd]
### Get Random Xkcd Comic [GET]
## xkcd [/xkcd/number/{number}]
### Get Xkcd by Number [GET]
+ Parameters
+ number: `1319` (number, required) - The xkcd comic ID
## xkcd [/xkcd/search]
### Get Xkcd Search [GET]
+ ```query```: Query (string, required) - Search terms
## xkcd [/xkcd/slash]
### Send xkcd slash query [POST]
+ ```text```: Query (string, required) - Search terms
## xkcd [/xkcd/new_post]
### Send xkcd outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
## giphy [/giphy]
### Get Random Giphy Gif [GET]
## giphy [/giphy/search]
### Get Giphy Search [GET]
+ ```query```: Query (string, required) - Search terms
## giphy [/giphy/slash]
### Send Giphy slash query [POST]
+ ```text```: Query (string, required) - Search terms
## giphy [/giphy/new_post]
### Send Giphy outgoing-webhook query [POST]
+ ```token```: Token (string, required) - Integration token
+ ```trigger_word```: Query (string, required) - Search
## image [/image/{folder}/{file}]
### Get Image [GET]
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
### Delete Image [DELETE]
Allows users to delete possibly offensive images
+ Parameters
+ source: `(xkcd|giphy)` (string, required) - The image source
+ file: `some.png` (string, required) - The image filename
+ Response 200 (text/plain)
image successfully removed
|
update api docs
|
update api docs
|
API Blueprint
|
mit
|
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
|
3bfb940c20b4619630b9208a2d37c5c12a180e1e
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
|
Add details of API consumer to Blueprint.
|
Add details of API consumer to Blueprint.
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
74f27459b24a4fdf9615147f6b720b2bd62616e9
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://api.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/articles/{id}]
A single Article object with all its details
+ Parameters
+ id (required, string, `foo-bar`) ... String `id` of the Article to perform action with. Has example value.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"id": "where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt"
}
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service.
# Articles
Article related resources of the **Money Advice Service**.
## Article [/articles/{id}]
A single Article object with all its details
+ Parameters
+ id (required, string, `foo-bar`) ... String `id` of the Article to perform action with. Has example value.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"url": "https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice",
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt"
}
|
Add URLs to API Blueprint
|
Add URLs to API Blueprint
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
de3ff8b82b8bcfcb0e4d73a76fca3095b6229777
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
|
FORMAT: 1A
HOST: https://www.moneyadviceservice.org.uk
# Money Advice Service
API for the Money Advice Service, to be consumed by the responsive frontend.
# Group Categories
## Category [/{locale}/category/{id}]
A single category with its children
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `mortgages-and-buying-property`) ... ID of the Category.
### Retrieve a Category [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/categories/mortgages-and-buying-property>; rel="alternate"; hreflang="cy"; title="Morgeisi a phrynu eiddo"
+ Body
{
"title": "Life events",
"description": "When big things happen - having a baby, losing your job, getting divorced or retiring\n - it helps to be in control of your money\n",
"id":"life-events",
"content":[{
"url":"/categories/setting-up-home",
"type":"category",
"title":"Setting up home",
"id":"setting-up-home",
"description":"Deciding whether to rent or buy, working out what you can afford and managing\n money when sharing with others\n"
},
{
"url":"/content/guides/how-much-rent-can-you-afford",
"type":"guide",
"title":"How much rent can you afford?",
"id":"how-much-rent-can-you-afford",
"description":"When working out what rent you can afford, remember to factor in upfront costs and your ongoing bills once you’ve moved in"
}]
}
# Group Articles
Article related resources of the **Money Advice Service**.
## Article [/{locale}/articles/{id}]
A single Article object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Article.
+ Values
+ `en`
+ `cy`
+ id (required, string, `where-to-go-to-get-free-debt-advice`) ... ID of the Article.
### Retrieve a Article [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/articles/ble-i-gael-cyngor-am-ddim-ynghylch-dyled>; rel="alternate"; hreflang="cy"; title="Ble i gael cyngor am ddim ynghylch dyled"
+ Body
{
"title": "Where to go to get free debt advice",
"description": "Find out where you can get free, confidential help if you are struggling with debt",
"body": "<h2>Watch out for companies that aren't charities</h2><p>Look out for companies with misleading names that sound like debt charities but are actually commercial businesses.</p><p>Never ever pay for services from this type of company.</p>"
}
# Group Action Plans
Action Plan related resources of the **Money Advice Service**.
## Action Plan [/{locale}/action_plans/{id}]
A single Action Plan object with all its details
+ Parameters
+ locale = `en` (optional, string, `en`) ... Locale of the Action Plan.
+ Values
+ `en`
+ `cy`
### Retrieve an Action Plan [GET]
+ Response 200 (application/json)
+ Header
Link: <https://www.moneyadviceservice.org.uk/cy/action_plans/paratowch-am-y-gost-o-gael-babi>; rel="alternate"; hreflang="cy"; title="Cynllun gweithredu - Paratowch am y gost o gael babi - Gwasanaeth Cynghori Ariannol"
+ Body
{
"title": "Prepare for the cost of having a baby",
"description": "A handy action plan which can help with planning of the costs involved in having a new baby",
"body": "<h4>Why?</h4><p>Knowing how much everything costs will help you prepare for your new arrival and avoid any unexpected expenses.</p>"
}
|
Add categories to API blueprint
|
Add categories to API blueprint
|
API Blueprint
|
mit
|
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
|
e3a683c18fdcfa30f1dc3ca5511fb5a6ff7ad66b
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://www.google.com
# Neighbor.ly
Notes API is a *short texts saving* service similar to its physical paper presence on your table.
# Group Notes
Notes related resources of the **Notes API**
## Notes Collection [/notes]
### List all Notes [GET]
+ Response 200 (application/json)
[{
"id": 1, "title": "Jogging in park"
}, {
"id": 2, "title": "Pick-up posters from post-office"
}]
### Create a Note [POST]
+ Request (application/json)
{ "title": "Buy cheese and bread for breakfast." }
+ Response 201 (application/json)
{ "id": 3, "title": "Buy cheese and bread for breakfast." }
## Note [/notes/{id}]
A single Note object with all its details
+ Parameters
+ id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.
### Retrieve a Note [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{ "id": 2, "title": "Pick-up posters from post-office" }
### Remove a Note [DELETE]
+ Response 204
|
FORMAT: 1A
HOST: https://neighbor.ly/api/
# Neighbor.ly
Here you will find how to integrate an application with Neighbor.ly. Check our [Dashboard source code](https://github.com/neighborly/neighborly-dashboard) for a real use case.
# Sessions
Your first stop when integrating with Neighborly. For a lot of endpoints, you are expected to provide an `access_token`, managed by this section.
## Sessions [/sessions]
### Create a session [POST]
+ Request (application/json)
{ "email": "[email protected]", "password": "your-really-strong-password" }
+ Response 201 (application/json)
{ "access_token": "Ndf6kxgLfr_KMhAg8wMpm7Yit2cvHkv9oI8qIXWiHmZdeqI1h0cmn8p4wCEhoZS-AQY", "user_id": 1 }
Can also respond with 400 and 401, depending on the parameters given.
|
Document [POST] /sessions
|
Document [POST] /sessions
[ci skip]
|
API Blueprint
|
mit
|
FromUte/dune-api
|
3090794b03da6e9a62a4fc4333b9244bdb753c3c
|
apiary.apib
|
apiary.apib
|
HOST: http://dcp.jboss.org/v1
--- Distributed Contribution Platform API v1 ---
---
# Overview
**Distributed Contribution Platform** provides **Rest API** for data manipulation and search.
# DCP Content object
This is main content object which can be pushed/retrieved or searched.
DCP Content object is JSON document with free structure. There is no restriction how many key value pairs must be defined or in which structure.
However this document is during push to DCP and reindex normalized and internal DCP data are added. Those data are prefixed by dcp_.
DCP Content described by example:
{
Free JSON Structure repsesenting content. Can be one key value pair or something more structured.
It's defined only by source provider.
"tags": ["Content tag1", "tag2", "tag2"],
"dcp_content_id": "Any value from content provider",
"dcp_content_typev: "Source provider type like 'issue'"
"dcp_content_provider": "Name of content provider like JIRA River"
"dcp_id": "internal_id"
"dcp_title": "Content Title"
"dcp_url_view": "URL representing content view"
"dcp_description": "Short description used by search GUI"
"dcp_type": "Normalized internal type of content"
"dcp_updated": "Timestamp of last update"
"dcp_project": "Normalized internal project"
"dcp_contributors": ["Firstname Lastname <e-mail>", "Firstname Lastname <e-mail>"]
"dcp_activity_dates": [Timestamp1, Timestamp2]
"dcp_tags": ["Tags constructed from 'tags' tag and user tags from persistance storage"]
}
All DCP Internal data are set during push and reindex except these which can be defined during data push:
* `dcp_title`
* `dcp_url_view`
* `dcp_description`
---
--
Authentication
Distinct operations needs to be authenticated. Content provider provides credintials by URL parameters provider and password or via standard HTTP Basic authentication.
If authentication is not successfull then standard forbidden http code is returned.
--
--
Content
--
Return Document JSON data
GET /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
All content for specified type.
GET /rest/content/{type}
< 200
< Content-Type: application/json
{
"total": "count of returned values",
"hits": [
{
"id": "internal dcp id of document"
"data": "document content"
}
]
}
JSON document in http body which is pushed to DCP.
Http body empty
POST /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
Document deleted
DELETE /rest/content/{type}/{id}
< 200
--
Search
--
Search contributions.
GET /rest/search?TODO
< 200
{ "foo": "bar" }
--
Suggestions
--
Get suggestions for user query.
Returned JSON contains two parts:
- `view`
- `model`
#### view
The `view` represents the visual part of query suggestions.
It *always* contains section `search` which will *always* have only one option matching incoming user query.
It can then contain one or more additional sections (like `suggestions`, `filters`, `mails`, ... etc.).
#### model
The `model` represents possible "actions" that are relevant to individual `option`s in the `view` part.
This means both `view` and `model` parts have the same highlevel structure and each `option`
in the `view` part have corresponding "action" in the `model` part.
Individual actions are described using symbolic commands. Interpretation of these commands is up to the client
the following is just a recommendation about how client can interpret the commands:
##### Commands:
`search` - execute search for `query` value.
`suggestion` - replace text in the search field with the `value`'s value.
`filter` - replace current filters with provided filters.
`filter_add` - enable provided filters (on top of currently active filters).
... more TDB.
To allow CORS we need to response to `OPTIONS` requests (for more see: <http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0>). We allow `GET` requests only.
OPTIONS /rest/suggestions/query_string
< 200
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET
GET /rest/suggestions/query_string?q={user_query_string}
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["${query_string}"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"option #1",
"option #2",
"..."
]
},
"filters": {
"caption": "Filters",
"options": [
"option #1",
"option #2",
"..."
]
},
"mails": {
"caption": "Mails",
"options": [
"option #1",
"option #2",
"..."
]
}
},
"model" : {
"search": {
"search": { "query": "${query_string}" }
},
"suggestions" : [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"filters": [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"mails": [
{ "action #1": {} },
{ "action #2": {} },
{ }
]
}
}
Example for user query 'Hiberna'.
GET /rest/suggestions/query_string?q=Hiberna
< 200
{
"view": {
"search": {
"caption": "Search",
"options": ["Hiberna"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"<strong>Hiberna</strong>te",
"<strong>Hiberna</strong>te query",
"<strong>Hiberna</strong>te session"
]
},
"filters": {
"caption": "Filters",
"options": [
"<strong>Add</strong> project filter for <strong>Hibernate</strong>",
"<strong>Add</strong> project filter for <strong>Infinispan</strong>",
"<strong>Search</strong> project <strong>Hibernate</strong> only"
]
},
"mails": {
"caption": "Mails",
"options": [
"<strong>Add</strong> some Mails filter",
"Do some other fancy thing here",
"Or do something else"
]
}
},
"model" : {
"search": { "search": { "query": "Hiberna" } },
"suggestions" : [
{ "suggestion": { "value": "Hibernate" }, "search": { "query": "Hibernate" } },
{ "suggestion": { "value": "Hibernate query" }, "search": { "query": "Hibernate query" } },
{ "suggestion": { "value": "Hibernate session" }, "search": { "query": "Hibernate session" } }
],
"filters": [
{ "filter_add": [ "Hibernate" ] },
{ "filter_add": [ "Infinispan" ] },
{ "filter": [ "Hibernate" ] }
],
"mails": [
{ "filter_add": [ "foo" ] },
{},
{}
]
}
}
|
HOST: http://dcp.jboss.org/v1
--- Distributed Contribution Platform API v1 ---
---
# Overview
**Distributed Contribution Platform** provides **Rest API** for data manipulation and search.
# DCP Content object
This is main content object which can be pushed/retrieved or searched.
DCP Content object is JSON document with free structure. There is no restriction how many key value pairs must be defined or in which structure.
However this document is during push to DCP and reindex normalized and internal DCP data are added. Those data are prefixed by dcp_.
DCP Content described by example:
{
Free JSON Structure repsesenting content. Can be one key value pair or something more structured.
It's defined only by source provider.
"tags": ["Content tag1", "tag2", "tag2"],
"dcp_content_id": "Any value from content provider",
"dcp_content_typev: "Source provider type like 'issue'"
"dcp_content_provider": "Name of content provider like JIRA River"
"dcp_id": "internal_id"
"dcp_title": "Content Title"
"dcp_url_view": "URL representing content view"
"dcp_description": "Short description used by search GUI"
"dcp_type": "Normalized internal type of content"
"dcp_updated": "Timestamp of last update"
"dcp_project": "Normalized internal project"
"dcp_contributors": ["Firstname Lastname <e-mail>", "Firstname Lastname <e-mail>"]
"dcp_activity_dates": [Timestamp1, Timestamp2]
"dcp_tags": ["Tags constructed from 'tags' tag and user tags from persistance storage"]
}
All DCP Internal data are set during push and reindex except these which can be defined during data push:
* `dcp_title`
* `dcp_url_view`
* `dcp_description`
---
--
Authentication
Distinct operations needs to be authenticated. Content provider provides credintials by URL parameters provider and password or via standard HTTP Basic authentication.
If authentication is not successfull then standard forbidden http code is returned.
--
--
Content
--
Return Document JSON data
GET /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
All content for specified type.
GET /rest/content/{type}
< 200
< Content-Type: application/json
{
"total": "count of returned values",
"hits": [
{
"id": "internal dcp id of document"
"data": "document content"
}
]
}
JSON document in http body which is pushed to DCP.
Http body empty
POST /rest/content/{type}/{id}
< 200
< Content-Type: application/json
{ "foo": "bar" }
Document deleted
DELETE /rest/content/{type}/{id}
< 200
--
Search
--
Search contributions.
GET /rest/search?TODO
< 200
{ "foo": "bar" }
--
Suggestions
--
Get suggestions for user query.
Returned JSON contains two parts:
- `view`
- `model`
#### view
The `view` represents the visual part of query suggestions.
It *always* contains section `search` which will *always* have only one option matching incoming user query.
It can then contain one or more additional sections (like `suggestions`, `filters`, `mails`, ... etc.).
#### model
The `model` represents possible "actions" that are relevant to individual `option`s in the `view` part.
This means both `view` and `model` parts have the same highlevel structure and each `option`
in the `view` part have corresponding "action" in the `model` part.
Individual actions are described using symbolic commands. Interpretation of these commands is up to the client
the following is just a recommendation about how client can interpret the commands:
##### Commands:
`search` - execute search for `query` value.
`suggestion` - replace text in the search field with the `value`'s value.
`filter` - replace current filters with provided filters.
`filter_add` - enable provided filters (on top of currently active filters).
... more TDB.
GET /rest/suggestions/query_string?q={user_query_string}
< 200
< Access-Control-Allow-Origin: *
{
"view": {
"search": {
"caption": "Search",
"options": ["${query_string}"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"option #1",
"option #2",
"..."
]
},
"filters": {
"caption": "Filters",
"options": [
"option #1",
"option #2",
"..."
]
},
"mails": {
"caption": "Mails",
"options": [
"option #1",
"option #2",
"..."
]
}
},
"model" : {
"search": {
"search": { "query": "${query_string}" }
},
"suggestions" : [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"filters": [
{ "action #1": {} },
{ "action #2": {} },
{ }
],
"mails": [
{ "action #1": {} },
{ "action #2": {} },
{ }
]
}
}
Example for user query 'Hiberna'.
GET /rest/suggestions/query_string?q=Hiberna
< 200
< Access-Control-Allow-Origin: *
{
"view": {
"search": {
"caption": "Search",
"options": ["Hiberna"]
},
"suggestions": {
"caption": "Query Completions",
"options": [
"<strong>Hiberna</strong>te",
"<strong>Hiberna</strong>te query",
"<strong>Hiberna</strong>te session"
]
},
"filters": {
"caption": "Filters",
"options": [
"<strong>Add</strong> project filter for <strong>Hibernate</strong>",
"<strong>Add</strong> project filter for <strong>Infinispan</strong>",
"<strong>Search</strong> project <strong>Hibernate</strong> only"
]
},
"mails": {
"caption": "Mails",
"options": [
"<strong>Add</strong> some Mails filter",
"Do some other fancy thing here",
"Or do something else"
]
}
},
"model" : {
"search": { "search": { "query": "Hiberna" } },
"suggestions" : [
{ "suggestion": { "value": "Hibernate" }, "search": { "query": "Hibernate" } },
{ "suggestion": { "value": "Hibernate query" }, "search": { "query": "Hibernate query" } },
{ "suggestion": { "value": "Hibernate session" }, "search": { "query": "Hibernate session" } }
],
"filters": [
{ "filter_add": [ "Hibernate" ] },
{ "filter_add": [ "Infinispan" ] },
{ "filter": [ "Hibernate" ] }
],
"mails": [
{ "filter_add": [ "foo" ] },
{},
{}
]
}
}
|
switch to simple cross-origin request
|
switch to simple cross-origin request
|
API Blueprint
|
apache-2.0
|
searchisko/searchisko,ollyjshaw/searchisko,searchisko/searchisko,searchisko/searchisko,ollyjshaw/searchisko,ollyjshaw/searchisko
|
e35cfa67407b83c4e08691864b65af7d770d02ba
|
apiary.apib
|
apiary.apib
|
HOST: https://api.loader.io/v2
--- loader.io API load testing documentation ---
---
All requests require an API key. While you can specify the API key in the body of your request, we’d prefer it be passed via the loaderio-Auth header. You can do this as follows:
In the Header: loaderio-Auth: {api_key}
In the Body: api_key={api_key}
---
--
Application Resources
--
List registered applications
GET /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
},
{
"app": "google.com",
"status": "unverified",
"app_id": "b579bbed7ef480e7318ac4d7b69e5caa"
}
]
Application status
GET /apps/{app_id}
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Register a new application
Format: myapp.com or www.myapp.com (note: myapp.com & www.myapp.com are different applications)
POST /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
{
"app": "gonnacrushya.com"
}
< 200
< Content-Type: application/json
{
"message": "success",
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"verification_id": "loaderio-0f2fabf74c5451cf71dce7cf43987477"
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["We are unable to register this app"]
}
Verify a registered application
POST /apps/{app_id}/verify
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message": "success"
}
+++++
< 422
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message":"error",
"errors":["can't verify domain gonnacrushya.com"]
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
--
Test Resources
--
List of load tests
GET /tests
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{ "param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
]
List of active load tests (verified, not archived)
GET /tests/active
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{ "param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
]
Create a new load test
POST /tests
> loaderio-Auth: {api_key}
> Content-type: application/json
{
"initial": 0,
"total": 60,
"duration": 60,
"callback": "http://gonnacrushya.com/loader-callback",
"name": "GonnaCrushYa Home Page",
"timeout": 10000,
"callback_email": "[email protected]",
"test_type": "cycling",
"notes": "Going to kicks the crap out of this server",
"scheduled_at": "2013-5-15 3:30:00",
"urls": [
{
"url": "http://gonnacrushya.com",
"request_type": "GET",
"post_body": "post body params go here",
"payload_file_url": "http://loader.io/payload_file.yml",
"authentication": {"login": "login", "password": "secret", "type": "basic"},
"headers": { "header1": "value1", "header2": "value2" },
"request_params": { "params1": "value1", "params2": "value2" }
}
]
}
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"processing"
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
+++++
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"unverified"
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["can't create test"]
}
Load test status
GET /tests/{test_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"from":0,
"to":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{"param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Run load test
PUT /tests/{test_id}/run
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"processing"
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["Can't run test for unverified application"]
}
Stop load test
PUT /tests/{test_id}/stop
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"message":"success",
"test_id":"1187538bb5d5fd60a1b99a6e67978c15",
"status":"finished",
"summary_id":"7c55ad8408f7c4326b7fa0e069b7a011"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["Can't stop test with finished status"]
}
--
Test results
--
Load test results
GET /tests/{test_id}/summaries
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
[
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
]
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Load test result
GET /tests/{test_id}/summaries/{summary_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
--
Servers
--
Load test server's ip addresses
GET /servers
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"ip_addresses": ["127.0.0.1"]
}
|
HOST: https://api.loader.io/v2
--- loader.io API load testing documentation ---
---
All requests require an API key. While you can specify the API key in the body of your request, we’d prefer it be passed via the loaderio-Auth header. You can do this as follows:
In the Header: loaderio-Auth: {api_key}
In the Body: api_key={api_key}
---
--
Application Resources
--
List registered applications
GET /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
},
{
"app": "google.com",
"status": "unverified",
"app_id": "b579bbed7ef480e7318ac4d7b69e5caa"
}
]
Application status
GET /apps/{app_id}
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app": "gonnacrushya.com",
"status": "verified",
"app_id": "0f2fabf74c5451cf71dce7cf43987477"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Register a new application
Format: myapp.com or www.myapp.com (note: myapp.com & www.myapp.com are different applications)
POST /apps
> loaderio-Auth: {api_key}
> Content-Type: application/json
{
"app": "gonnacrushya.com"
}
< 200
< Content-Type: application/json
{
"message": "success",
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"verification_id": "loaderio-0f2fabf74c5451cf71dce7cf43987477"
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["We are unable to register this app"]
}
Verify a registered application
POST /apps/{app_id}/verify
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message": "success"
}
+++++
< 422
< Content-Type: application/json
{
"app_id": "0f2fabf74c5451cf71dce7cf43987477",
"message":"error",
"errors":["can't verify domain gonnacrushya.com"]
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
--
Test Resources
--
List of load tests
GET /tests
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"initial":0,
"total":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{ "param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
]
List of active load tests (verified, not archived)
GET /tests/active
> loaderio-Auth: {api_key}
> Content-Type: application/json
< 200
< Content-Type: application/json
[
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"initial":0,
"total":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{ "param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
]
Create a new load test
POST /tests
> loaderio-Auth: {api_key}
> Content-type: application/json
{
"initial": 0,
"total": 60,
"duration": 60,
"callback": "http://gonnacrushya.com/loader-callback",
"name": "GonnaCrushYa Home Page",
"timeout": 10000,
"callback_email": "[email protected]",
"test_type": "cycling",
"notes": "Going to kicks the crap out of this server",
"scheduled_at": "2013-5-15 3:30:00",
"urls": [
{
"url": "http://gonnacrushya.com",
"request_type": "GET",
"post_body": "post body params go here",
"payload_file_url": "http://loader.io/payload_file.yml",
"authentication": {"login": "login", "password": "secret", "type": "basic"},
"headers": { "header1": "value1", "header2": "value2" },
"request_params": { "params1": "value1", "params2": "value2" }
}
]
}
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"processing"
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
+++++
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"unverified"
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["can't create test"]
}
Load test status
GET /tests/{test_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"name":"",
"duration":60,
"timeout":10000,
"notes":"",
"initial":0,
"total":60,
"status":"complete",
"test_id":"9b24d675afb6c09c6813a79c956f0d02",
"test_type":"Non-Cycling",
"callback":"http://loader.io",
"callback_email":"[email protected]",
"scheduled_at": "2013-06-07T19:30:00+03:00",
"urls":
[
{
"url":"http://loader.io/signin",
"raw_post_body":null,
"request_type":"GET",
"payload_file_url":null,
"headers":{ "header": "value", "header2": "value2" },
"request_params":{"param": "value", "param2": "value2" },
"authentication":{"login": "login", "password": "password", "type": "basic"}
}
]
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Run load test
PUT /tests/{test_id}/run
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-Type: application/json
{
"message":"success",
"test_id":"0642ee5387b4ee35b581b6bf1332c70b",
"status":"processing"
"summary_id": "35b581b6bf1332c70b0642ee5387b4ee"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["Can't run test for unverified application"]
}
Stop load test
PUT /tests/{test_id}/stop
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"message":"success",
"test_id":"1187538bb5d5fd60a1b99a6e67978c15",
"status":"finished",
"summary_id":"7c55ad8408f7c4326b7fa0e069b7a011"
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
+++++
< 422
< Content-Type: application/json
{
"message":"error",
"errors":["Can't stop test with finished status"]
}
--
Test results
--
Load test results
GET /tests/{test_id}/summaries
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
[
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
]
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
Load test result
GET /tests/{test_id}/summaries/{summary_id}
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0
}
+++++
< 404
< Content-Type: application/json
{
"message":"error",
"errors":["Requested record was not found"]
}
GET /tests/{test_id}/summaries/{summary_id}?errors_threshold=0&response_time_threshold=10
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"summary_id": "8fb213af34c1cf7b675dc21e900e533a",
"started_at":"2013-06-10T23:42:01+02:00",
"status":"ready",
"public_results_url":"http://loader.io/results/a72944b62d576f0f68fb30ca41d20b99/summaries/8fb213af34c1cf7b675dc21e900e533a",
"success":77,
"error":0,
"timeout_error":0,
"network_error":0,
"data_sent":28259,
"data_received":8393,
"avg_response_time":1,
"avg_error_rate":0.0,
"errors_threshold_status":"failed",
"response_time_threshold_status":"passed"
}
--
Servers
--
Load test server's ip addresses
GET /servers
> loaderio-Auth: {api_key}
> Content-type: application/json
< 200
< Content-type: application/json
{
"ip_addresses": ["127.0.0.1"]
}
|
Update docs
|
[#51206839] Update docs
|
API Blueprint
|
mit
|
sendgridlabs/loaderio-docs,sendgridlabs/loaderio-docs
|
c40b9422b9447634e64cb238bec7d498b85f8302
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://tidepool.io
# tidepool-user-api
The Tidepool User API is used to manage the user login information and pretty much nothing else.
Temporarily, it also manages sessions. That will change.
# Group User
User related resources of the **User API**
## Status [/status]
### Retrieve status information [GET]
Returns a status health check with a list of status of its dependencies
+ Response 200
If the server is operating properly and all dependencies are up and running.
{
"up" : [ "mongo" ],
"down" : []
}
+ Response 500
If the server is *not* operating properly and one or more dependencies
have failed to start or are no longer running.
{
"up" : [],
"down" : [ "mongo" ]
}
## Testing Status [/status/{statusvalue}]
### Retrieve status information [GET]
Returns whatever status it was sent as a parameter
+ Parameters
+ statusvalue (required, integer, `404`) ... The return code you want from the status call
+ Response 404
## Login [/login]
### Log in an existing user [POST]
+ Request
+ Headers
X-Tidepool-UserID: blipuser
X-Tidepool-Password: my_1337_password
+ Response 200 (application/json)
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Body
{
"userid": "ebe58036a5",
"username": "[email protected],
"emails" : [ "[email protected]" ]
}
### Refresh a session token [GET]
This call takes a token, and if the token was still valid, issues
a new (different) token; it also returns the userid in the body. This may
be a bad idea.
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200 (application/json)
+ Headers
x-tidepool-session-token : 1324234234.adfa234.123ad34
+ Body
{
"userid": "123123abcd",
}
## Logout [/logout]
### Log out from an existing session [POST]
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200
## User records [/user]
### Retrieve current user's info [GET]
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200 (application/json)
+ Body
{
"userid": "ebe58036a5",
"username": "[email protected],
"emails" : [ "[email protected]" ]
}
### Create a user [POST]
+ Request (application/json)
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Body
{
"username": "[email protected]",
"emails" : [ "[email protected]" ],
"password" : "secret"
}
+ Response 201 (application/json)
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Body
{
"userid": "ebe58036a5",
"username": "[email protected]",
"emails" : [ "[email protected]" ]
}
## User info for another user [/user/{userid}]
### Retrieve other user's info [GET]
+ Parameters
+ userid (required, string, `123123abcd`) ... Tidepool-assigned user ID
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200 (application/json)
+ Body
{
"userid": userid,
"username": "[email protected]",
"emails" : [ "[email protected]" ]
}
|
FORMAT: 1A
HOST: http://tidepool.io
# tidepool-user-api
The Tidepool User API is used to manage the user login information and pretty much nothing else.
Temporarily, it also manages sessions. That will change.
# Group User
User related resources of the **User API**
## Status [/status]
### Retrieve status information [GET]
Returns a status health check with a list of status of its dependencies
+ Response 200
If the server is operating properly and all dependencies are up and running.
{
"up" : [ "mongo" ],
"down" : []
}
+ Response 500
If the server is *not* operating properly and one or more dependencies
have failed to start or are no longer running.
{
"up" : [],
"down" : [ "mongo" ]
}
## Testing Status [/status/{statusvalue}]
### Retrieve status information [GET]
Returns whatever status it was sent as a parameter
+ Parameters
+ statusvalue (required, integer, `404`) ... The return code you want from the status call
+ Response 404
## Login [/login]
### Log in an existing user [POST]
+ Request
+ Headers
X-Tidepool-UserID: blipuser
X-Tidepool-Password: my_1337_password
+ Response 200 (application/json)
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Body
{
"userid": "ebe58036a5",
"username": "[email protected],
"emails" : [ "[email protected]" ]
}
+ Response 401
When the username/password combination fails.
### Refresh a session token [GET]
This call takes a token, and if the token was still valid, issues
a new (different) token; it also returns the userid in the body. This may
be a bad idea.
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200 (application/json)
+ Headers
x-tidepool-session-token : 1324234234.adfa234.123ad34
+ Body
{
"userid": "123123abcd",
}
+ Response 401
When the token is invalid.
+ Response 404
When the token is not provided.
## Logout [/logout]
### Log out from an existing session [POST]
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200
+ Response 401
When the token is invalid or not provided or has expired.
## User records [/user]
### Retrieve current user's info [GET]
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200 (application/json)
+ Body
{
"userid": "ebe58036a5",
"username": "[email protected],
"emails" : [ "[email protected]" ]
}
+ Response 401
When the token is invalid or not provided.
### Create a user [POST]
+ Request (application/json)
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Body
{
"username": "[email protected]",
"emails" : [ "[email protected]" ],
"password" : "secret"
}
+ Response 201 (application/json)
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Body
{
"userid": "ebe58036a5",
"username": "[email protected]",
"emails" : [ "[email protected]" ]
}
+ Response 400
When the body information is invalid (usually because something
is not unique)
+ Response 401
When the token is invalid or not provided.
## User info for another user [/user/{userid}]
### Retrieve other user's info [GET]
+ Parameters
+ userid (required, string, `123123abcd`) ... Tidepool-assigned user ID
+ Request
+ Headers
x-tidepool-session-token : 23sadf87.123840.aasd90JKj
+ Response 200 (application/json)
+ Body
{
"userid": userid,
"username": "[email protected]",
"emails" : [ "[email protected]" ]
}
+ Response 401
When the token is invalid or not provided.
+ Response 404
When the userid was not found.
|
Add the error response codes to the API
|
Add the error response codes to the API
|
API Blueprint
|
bsd-2-clause
|
tidepool-org/user-api,tidepool-org/user-api
|
4e94e81cedc75dd7f4920c7582d9c9e7fd60edab
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: https://awesome-bucketlist-api.herokuapp.com/
# Awesome Bucketlist API Docs
A Bucketlist is a list of items, activities or goals you want to achieve before you "kick the bucket"
this is an API to allow you create a new user account, login into your account, create, update, view or delete
bucketlists and bucketlist items.
# Allowed methods:
```
POST - To create a resource.
PUT - Update a resource.
GET - Get a resource or list of resources.
DELETE - To delete a resource.
```
# HTTP status codes description:
- 200 `OK` - the request was successful (some API calls may return 201 instead).
- 201 `Created` - the request was successful and a resource was created.
- 204 `No Content` - the request was successful but there is no representation to return (i.e. the response is empty).
- 400 `Bad Request` - the request could not be understood or was missing required parameters.
- 401 `Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- 403 `Forbidden` - access denied.
- 404 `Not Found` - resource was not found.
- 405 `Method Not Allowed` - requested method is not supported for resource.
## features covered include:
* User login and registration.
* Token based authentication.
* Creating a bucketlist.
* Viewing bucketlists.
* Viewing a single bucketlist.
* Updating a bucketlist.
* Deleting a single bucketlist.
* Creating a bucketlist item.
* Viewing all bucketlist items.
* Viewing a single bucketlist item.
* Updating a bucketlist item.
* Deleting a bucketlist item.
## Registration Resource [/auth/register]
### Create a new account [POST]
Create a new account using a username and password.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 201 (application/json)
{
"message": "user registered successfully"
}
+ Response 409 (application/json)
{
"message": "username already exists"
}
## Login Resource [/auth/login]
### Login to your account [POST]
Send your account credentials which returns a token for use with all requests to the API.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 200 (application/json)
{
"token": "The token generated"
}
+ Response 401 (application/json)
{
"message": "username or password is incorrect"
}
## Bucketlists Resource [/bucketlists]
### Create New Bucketlist [POST]
Creates a new bucketlist under your account.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 201 (application/json)
{
"message": "Bucketlist created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Get All Bucketlists [GET]
Gets all bucketlists created under your account, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
[
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
]
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Resource [/bucketlists/{id}]
+ Parameters
+ id - the bucketlist id
### Get single bucketlist [GET]
Gets a single bucketlist for the specified id, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
### Update a bucketlist [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
## Bucketlist Items Resource [/bucketlists/{bucketlist_id}/items/]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
### Create new item [POST]
Gets bucketlist items created under the specified **bucketlist_id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "climb Mt.Kilimanjaro"
}
+ Response 201 (application/json)
{
"message": "Item created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Item with similar name already exists"
}
### Get all items [GET]
Gets all bucketlist items created under the specified **bucketlist id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Item Resource [/bucketlists/{bucketlist_id}/items/{item_id}]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
+ item_id - the id for any of the items created earlier
### Update an item [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist item with the **item id** specified.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
|
FORMAT: 1A
HOST: https://awesome-bucketlist-api.herokuapp.com/
# Awesome Bucketlist API Docs
A Bucketlist is a list of items, activities or goals you want to achieve before you "kick the bucket"
this is an API to allow you create a new user account, login into your account, create, update, view or delete
bucketlists and bucketlist items.
# Allowed methods:
```
POST - To create a resource.
PUT - Update a resource.
GET - Get a resource or list of resources.
DELETE - To delete a resource.
```
# HTTP status codes description:
- 200 `OK` - the request was successful (some API calls may return 201 instead).
- 201 `Created` - the request was successful and a resource was created.
- 204 `No Content` - the request was successful but there is no representation to return (i.e. the response is empty).
- 400 `Bad Request` - the request could not be understood or was missing required parameters.
- 401 `Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- 403 `Forbidden` - access denied.
- 404 `Not Found` - resource was not found.
- 405 `Method Not Allowed` - requested method is not supported for resource.
## features covered include:
* User login and registration.
* Token based authentication.
* Creating a bucketlist.
* Viewing bucketlists.
* Viewing a single bucketlist.
* Updating a bucketlist.
* Deleting a single bucketlist.
* Creating a bucketlist item.
* Viewing all bucketlist items.
* Viewing a single bucketlist item.
* Updating a bucketlist item.
* Deleting a bucketlist item.
## Registration Resource [/auth/register]
### Create a new account [POST]
Create a new account using a username and password.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 201 (application/json)
{
"message": "user registered successfully"
}
+ Response 409 (application/json)
{
"message": "username already exists"
}
## Login Resource [/auth/login]
### Login to your account [POST]
Send your account credentials which returns a token for use with all requests to the API.
+ Request (application/json)
{
"username": "john",
"password": "janedoe"
}
+ Response 200 (application/json)
{
"token": "The token generated"
}
+ Response 401 (application/json)
{
"message": "username or password is incorrect"
}
## Bucketlists Resource [/bucketlists]
### Create New Bucketlist [POST]
Creates a new bucketlist under your account.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil",
"description": "Stunts I want to try out."
}
+ Response 201 (application/json)
{
"message": "Bucketlist created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Get All Bucketlists [GET]
Gets all bucketlists created under your account, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
[
{
"id": "bucketlist id",
"name": "bucketlist name",
"description": "bucketlist description",
"created_at": "timestamp when bucketlist was created"
}
]
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Resource [/bucketlists/{id}]
+ Parameters
+ id - the bucketlist id
### Get single bucketlist [GET]
Gets a single bucketlist for the specified id, a user can only access his/her bucketlists only.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"id": "bucketlist id",
"name": "bucketlist name",
"description": "bucketlist description",
"created_at": "timestamp when bucketlist was created"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
### Update a bucketlist [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
## Bucketlist Items Resource [/bucketlists/{bucketlist_id}/items/]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
### Create new item [POST]
Gets bucketlist items created under the specified **bucketlist_id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "climb Mt.Kilimanjaro"
}
+ Response 201 (application/json)
{
"message": "Item created successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Item with similar name already exists"
}
### Get all items [GET]
Gets all bucketlist items created under the specified **bucketlist id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"id": "item id",
"name": "item name",
"done": "item status",
"bucketlist_id": "item bucketlist id",
"created_at": "timestamp when item was created"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
## Single Bucketlist Item Resource [/bucketlists/{bucketlist_id}/items/{item_id}]
+ Parameters
+ bucketlist_id - the id for any of the bucketlist you created earlier
+ item_id - the id for any of the items created earlier
### Get single item [GET]
Gets item with the specified **item id**.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Response 200 (application/json)
{
"id": "item id",
"name": "item name",
"done": "item status",
"bucketlist_id": "item bucketlist id",
"created_at": "timestamp when item was created"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
### Update an item [PUT]
Update bucketlist name or description.
+ Request (application/json)
+ Headers
Authorization: "Your Token"
+ Body
{
"name": "Dare Devil 2",
"description": "List of Stunts I want to try out."
}
+ Response 200 (application/json)
{
"message": "Bucketlist updated successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 409 (application/json)
{
"message": "Bucketlist with a similar name exists"
}
### Delete a bucketlist [DELETE]
Delete bucketlist item with the **item id** specified.
+ Request (application/json)
+ Headers
Authorization: "Your TokeEn"
+ Response 200 (application/json)
{
"message": "Bucketlist deleted successfully"
}
+ Response 401 (application/json)
{
"message": "please login to access your bucketlists"
}
+ Response 404 (application/json)
{
"message": "Bucketlist not found"
}
|
Update paramaters for bucketlist and bucketlist items
|
[CHORE] Update paramaters for bucketlist and bucketlist items
|
API Blueprint
|
mit
|
brayoh/bucket-list-api
|
771fdb9a68048b826f835226b612d19ba1540536
|
doc/apiary/iotagent.apib
|
doc/apiary/iotagent.apib
|
FORMAT: 1A
HOST: http://idas.lab.fiware.org
TITLE: FIWARE IoT Agents API
DATE: December 2016
VERSION: stable
APIARY_PROJECT: telefonicaiotiotagents
SPEC_URL: https://telefonicaid.github.io/iotagent-node-lib/api/
GITHUB_SOURCE: https://github.com/telefonicaid/iotagent-node-lib
## Copyright
Copyright (c) 2014-2016 Telefonica Investigacion y Desarrollo
## License
This specification is licensed under the
[FIWARE Open Specification License (implicit patent license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
# IoT Agent Provision API Documentacion
An [IoT Agent](https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus) is a component that mediates between a set of Devices using their own native protocols and a NGSI compliant Context Provider (i.e. Fiware Context Broker).
This documentation covers the IoT Agent Provision API and the resources you can manipulate on an IoT Agent in order to publish custom information in IoT Platform. The IoT Agent Provision API is based on REST principles.
|Allowed HTTPs requests | |
|:---------------------------|:----------------------------------------|
|POST: |Creates a resource or list of resources |
|PUT: |Updates a resource |
|GET: |Retrieves a resource or list of resources|
|DELETE: |Delete a resource |
|Server Responses | |
|:---------------------------|:--------------------------------------------------------------------------------------------------|
|200 OK |The request was succesful (some API calls may return 201 instead) |
|201 Created |The request was succesful and a resource or list of resources was created |
|204 No Content |The request was succesful but there is no representation to return (that is, the response is empty)|
|400 Bad Request |The request could not be understood or was missing required parameters |
|401 Unauthorized |Authentication failed |
|403 Forbidden |Access denied |
|404 Not Found |Resource was not found |
|409 Conflict |A resource cannot be created because it already exists |
|500 Internal Server Error |Generic error when server has a malfunction. This error will be removed |
Responses related with authentication and authorization depends on this feature is configured and a Keystone OpenStack sytem is present.
When an error is returned, a representation is returned as:
```json
{
"reason": "contains why an error is returned",
"details": "contains specific information about the error, if possible"
}
```
## Authentication and Authorization
If the IoT Agent is in authenticated environment, this API requires a token, which you obtain from authentication system. This system and its API is out of scope of present documentation. In this environment, a mandatory header is needed: `X-Auth-Token`.
## Mandatory HTTP Headers
The API needs two headers in order to manage requests:
|Http Header |Level |If not present |Observations |
|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|
|<b>Fiware-Service</b> |Represents a tenant. Higher level in resources hierachy in IoT Platform |An error is returned |Must only contain less than 50 Underscores and Alphanumeric lowercase characters |
|<b>Fiware-ServicePath</b> |Represents the second level |We assume '/'. Allowed operation '/*'|Must only contain less than 50 Underscores and Alphanumeric characters. Must start with character '/'. Max. length is 51 characters (with /)|
## API Access
All API base URLs are relative and depend on where the IoT Agent is listening (depends on each service).
For example, `http://127.0.0.1:8080/iot/`.
# Configuration Group API
## Services [/services{?limit,offset,resource,apikey,device}]
Configuration group for iotagents.
Fields in JSON object representing a configuration group are:
|Fields in JSON Object | |
|:-----------------------|:------------------------------------------------------------|
|`apikey` |It is a key used for devices belonging to this service. If "", service does not use apikey, but it must be specified.|
|`token` |If authentication/authorization system is configured, IoT Agent works as user when it publishes information. That token allows that other components to verify the identity of IoT Agent. Depends on authentication and authorization system.|
|`cbroker` |Context Broker endpoint assigned to this service, it must be a real uri.|
|`outgoing_route` |It is an identifier for VPN/GRE tunnel. It is used when device is into a VPN and a command is sent.|
|`resource` |Path in IoTAgent. When protocol is HTTP a device could send information to this uri. In general, it is a uri in a HTTP server needed to load and execute a module.|
|`entity_type` |Entity type used in entity publication (overload default).|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
| `timestamp`. |(optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.|
| `autoprovision`. |(optional, boolean): If `false`, autoprovisioned devices (i.e. devices that are not created with an explicit provision operation but when the first measure arrives) are not allowed in this group. Default (in the case of omitting the field) is `true`.|
Mandatory fields are identified in every operation.
`static_attributes` and `attributes` are used if device has not this information.
### Retrieve a configuration group [GET]
Retrieve a configuration group.
+ Parameters [limit, offset, resource]
+ `limit` (optional, number). In order to specify the maximum number of services (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `resource` (optional, string). URI for the iotagent, return only services for this iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /*
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
### Create a configuration group [POST]
Create a new configuration group. From service model, mandatory fields are: apikey, resource (cbroker field is temporary mandatory).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"services": [
{
"apikey": "apikey3",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Response 201
### Update a configuration group [PUT]
If you want modify only a field, you can do it. You cannot modify an element into an array field, but whole array. ("/*" is not allowed).
+ Parameters [apikey, resource]
+ `apikey` (optional, string). If you don't specify, apikey=" " is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_type": "entity_type"
}
+ Response 204
### Remove a configuration group [DELETE]
Remove a configuration group.
+ Parameters [apikey, resource, device]
+ `apikey` (optional, string). If you don't specify, apikey="" is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ `device` (optional, boolean). Default value is false. Remove devices in service/subservice. This parameter is not valid when Fiware-ServicePath is '/*' or '/#'.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
## Devices [/devices{?limit,offset,detailed,protocol,entity}]
A device is a resource that publish information to IoT Platform and it uses the IoT Agent.
### Device Model
- `device_id`. Unique identifier into a service.
- `protocol`. Protocol assigned to device. This field is easily provided by IoTA Manager if it is used. Every module implmenting a protocol has an identifier.
- `entity_name`. Entity name used for entity publication (overload default)
- `entity_type`. Entity type used for entity publication (overload entity_type defined in service).
- `timezone`. Used to automatically generate timestamps attributes for the entity publication.
- `attributes`. Mapping for protocol parameters to entity attributes.
`object_id` (string, mandatory): protocol parameter to be mapped.
`name` (string, mandatory): attribute name to publish.
`type`: (string, mandatory): attribute type to publish.
- `static_attributes` (optional, array). Attributes published as defined.
`name` (string, mandatory): attribute name to publish.
`type` (string, mandatory): attribute type to publish.
`value` (string, mandatory): attribute value to publish.
- `endpoint` (optional, string): when a device uses push commands.
- `commands` (optional, array). Attributes working as commands.
`name` (string, mandatory): command identifier.
`type` (string, mandatory). It must be 'command'.
`value` (string, mandatory): command representation depends on protocol.
- `timestamp`. (optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.
- `autoprovision`. (optional, boolean): If true, APPEND is used upon measure arrival (thus effectively allowing autoprovisioned devices). If false, UPDATE is used open measure arrival (thus effectively avoiding autoprovisioned devices). This field is optional, so if it omitted then the global IoTAgent appendModel configuration is used.
Mandatory fields are identified in every operation.
### Retrieve all devices [GET]
+ Parameters [limit, offset, detailed, entity, protocol]
+ `limit` (optional, number). In order to specify the maximum number of devices (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `detailed` (optional, string). `on` return all device information, `off` (default) return only name.
+ `entity` (optional, string). It allows get a device from entity name.
+ `protocol` (optional, string). It allows get devices with this protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testService
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
### Create a device [POST]
From device model, mandatory fields are: device_id and protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
+ Response 201
+ Headers (only if ONE device is in request)
Location: /iot/devices/device_id
+ Response 400
{
"reason": "parameter limit must be an integer"
}
+ Response 404
## Device [/devices/{device_id}]
### Retrieve a device [GET]
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"device_id": "device_id",
"protocol": "121345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
### Update a device [PUT]
If you want modify only a field, you can do it, except field `protocol` (this field, if provided it is removed from request).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_name": "entity_name"
}
+ Response 204
### Remove a device [DELETE]
If specific device is not found, we work as deleted.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
|
FORMAT: 1A
HOST: http://idas.lab.fiware.org
TITLE: FIWARE IoT Agents API
DATE: December 2016
VERSION: stable
APIARY_PROJECT: telefonicaiotiotagents
SPEC_URL: https://telefonicaid.github.io/iotagent-node-lib/api/
GITHUB_SOURCE: https://github.com/telefonicaid/iotagent-node-lib
## Copyright
Copyright (c) 2014-2016 Telefonica Investigacion y Desarrollo
## License
This specification is licensed under the
[FIWARE Open Specification License (implicit patent license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
# IoT Agent Provision API Documentacion
An [IoT Agent](https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus) is a component that mediates between a set of Devices using their own native protocols and a NGSI compliant Context Provider (i.e. Fiware Context Broker).
This documentation covers the IoT Agent Provision API and the resources you can manipulate on an IoT Agent in order to publish custom information in IoT Platform. The IoT Agent Provision API is based on REST principles.
|Allowed HTTPs requests | |
|:---------------------------|:----------------------------------------|
|POST: |Creates a resource or list of resources |
|PUT: |Updates a resource |
|GET: |Retrieves a resource or list of resources|
|DELETE: |Delete a resource |
|Server Responses | |
|:---------------------------|:--------------------------------------------------------------------------------------------------|
|200 OK |The request was succesful (some API calls may return 201 instead) |
|201 Created |The request was succesful and a resource or list of resources was created |
|204 No Content |The request was succesful but there is no representation to return (that is, the response is empty)|
|400 Bad Request |The request could not be understood or was missing required parameters |
|401 Unauthorized |Authentication failed |
|403 Forbidden |Access denied |
|404 Not Found |Resource was not found |
|409 Conflict |A resource cannot be created because it already exists |
|500 Internal Server Error |Generic error when server has a malfunction. This error will be removed |
Responses related with authentication and authorization depends on this feature is configured and a Keystone OpenStack sytem is present.
When an error is returned, a representation is returned as:
```json
{
"reason": "contains why an error is returned",
"details": "contains specific information about the error, if possible"
}
```
## Authentication and Authorization
If the IoT Agent is in authenticated environment, this API requires a token, which you obtain from authentication system. This system and its API is out of scope of present documentation. In this environment, a mandatory header is needed: `X-Auth-Token`.
## Mandatory HTTP Headers
The API needs two headers in order to manage requests:
|Http Header |Level |If not present |Observations |
|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|
|<b>Fiware-Service</b> |Represents a tenant. Higher level in resources hierachy in IoT Platform |An error is returned |Must only contain less than 50 Underscores and Alphanumeric lowercase characters |
|<b>Fiware-ServicePath</b> |Represents the second level |We assume '/'. Allowed operation '/*'|Must only contain less than 50 Underscores and Alphanumeric characters. Must start with character '/'. Max. length is 51 characters (with /)|
## API Access
All API base URLs are relative and depend on where the IoT Agent is listening (depends on each service).
For example, `http://127.0.0.1:8080/iot/`.
# Configuration Group API
## Services [/services{?limit,offset,resource,apikey,device}]
Configuration group for iotagents.
Fields in JSON object representing a configuration group are:
|Fields in JSON Object | |
|:-----------------------|:------------------------------------------------------------|
|`apikey` |It is a key used for devices belonging to this service. If "", service does not use apikey, but it must be specified.|
|`token` |If authentication/authorization system is configured, IoT Agent works as user when it publishes information. That token allows that other components to verify the identity of IoT Agent. Depends on authentication and authorization system.|
|`cbroker` |Context Broker endpoint assigned to this service, it must be a real uri.|
|`outgoing_route` |It is an identifier for VPN/GRE tunnel. It is used when device is into a VPN and a command is sent.|
|`resource` |Path in IoTAgent. When protocol is HTTP a device could send information to this uri. In general, it is a uri in a HTTP server needed to load and execute a module.|
|`entity_type` |Entity type used in entity publication (overload default).|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
| `timestamp`. |(optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.|
| `autoprovision`. |(optional, boolean): If `false`, autoprovisioned devices (i.e. devices that are not created with an explicit provision operation but when the first measure arrives) are not allowed in this group. Default (in the case of omitting the field) is `true`.|
Mandatory fields are identified in every operation.
`static_attributes` and `attributes` are used if device has not this information.
### Retrieve a configuration group [GET]
Retrieve a configuration group.
+ Parameters [limit, offset, resource]
+ `limit` (optional, number). In order to specify the maximum number of services (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `resource` (optional, string). URI for the iotagent, return only services for this iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /*
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
### Create a configuration group [POST]
Create a new configuration group. From service model, mandatory fields are: apikey, resource (cbroker field is temporary mandatory).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"services": [
{
"apikey": "apikey3",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Response 201
### Update a configuration group [PUT]
If you want modify only a field, you can do it. You cannot modify an element into an array field, but whole array. ("/*" is not allowed).
+ Parameters [apikey, resource]
+ `apikey` (optional, string). If you don't specify, apikey=" " is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_type": "entity_type"
}
+ Response 204
### Remove a configuration group [DELETE]
Remove a configuration group.
+ Parameters [apikey, resource, device]
+ `apikey` (optional, string). If you don't specify, apikey="" is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ `device` (optional, boolean). Default value is false. Remove devices in service/subservice. This parameter is not valid when Fiware-ServicePath is '/*' or '/#'.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
## Devices [/devices{?limit,offset,detailed,protocol,entity}]
A device is a resource that publish information to IoT Platform and it uses the IoT Agent.
### Device Model
- `device_id`. Unique identifier into a service.
- `protocol`. Protocol assigned to device. This field is easily provided by IoTA Manager if it is used. Every module implmenting a protocol has an identifier.
- `entity_name`. Entity name used for entity publication (overload default)
- `entity_type`. Entity type used for entity publication (overload entity_type defined in service).
- `timezone`. Used to automatically generate timestamps attributes for the entity publication.
- `attributes`. Mapping for protocol parameters to entity attributes.
`object_id` (string, mandatory): protocol parameter to be mapped.
`name` (string, mandatory): attribute name to publish.
`type`: (string, mandatory): attribute type to publish.
- `static_attributes` (optional, array). Attributes published as defined.
`name` (string, mandatory): attribute name to publish.
`type` (string, mandatory): attribute type to publish.
`value` (string, mandatory): attribute value to publish.
- `endpoint` (optional, string): when a device uses push commands.
- `commands` (optional, array). Attributes working as commands.
`name` (string, mandatory): command identifier.
`type` (string, mandatory). It must be 'command'.
`value` (string, mandatory): command representation depends on protocol.
- `timestamp`. (optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.
Mandatory fields are identified in every operation.
### Retrieve all devices [GET]
+ Parameters [limit, offset, detailed, entity, protocol]
+ `limit` (optional, number). In order to specify the maximum number of devices (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `detailed` (optional, string). `on` return all device information, `off` (default) return only name.
+ `entity` (optional, string). It allows get a device from entity name.
+ `protocol` (optional, string). It allows get devices with this protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testService
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
### Create a device [POST]
From device model, mandatory fields are: device_id and protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
+ Response 201
+ Headers (only if ONE device is in request)
Location: /iot/devices/device_id
+ Response 400
{
"reason": "parameter limit must be an integer"
}
+ Response 404
## Device [/devices/{device_id}]
### Retrieve a device [GET]
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"device_id": "device_id",
"protocol": "121345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
### Update a device [PUT]
If you want modify only a field, you can do it, except field `protocol` (this field, if provided it is removed from request).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_name": "entity_name"
}
+ Response 204
### Remove a device [DELETE]
If specific device is not found, we work as deleted.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
|
Update iotagent.apib
|
Update iotagent.apib
|
API Blueprint
|
agpl-3.0
|
telefonicaid/iotagent-node-lib,telefonicaid/iotagent-node-lib,telefonicaid/iotagent-node-lib
|
d46856411b426e9012420f64ed2ff154b79a8255
|
doc/example-httpbin.apib
|
doc/example-httpbin.apib
|
--- Examples against httpbin.org ---
---
Examples of how some requests to _httpbin.org_ can be specified. Read more about
the httpbin.org API at http://httpbin.org/.
See ../README.md for details on how to test this specification.
---
# First request and response
Get a teapot from some full URL.
Leading or trailing blank lines in the body are stripped, unless you delimit
the body lines with the markers <<< (start) and >>> (end). The newlines after
<<< as well as the newline before >>> is not included in the body.
GET /status/418
> Accept: *
> User-Agent: KATT
> Host: {{<hostname}}:{{<port}}
< 418
< X-More-Info: http://tools.ietf.org/html/rfc2324
<<<
-=[ teapot ]=-
_...._
.' _ _ `.
| ."` ^ `". _,
\_;`"---"`|//
| ;/
\_ _/
`"""`
>>>
# Second request and response
Get unauthorized.
Also note that we don't expect any body.
The current date will be available to use in later requests as `{{<some_date}}.`
GET /status/401
> Accept: *
> User-Agent: KATT
< 401
< Www-Authenticate: Basic realm="Fake Realm"
< Date: {{>some_date}}
# Third request
Note that the title of this operation is "Third request", but that's just
markdown for you. You don't need to include a title, or even a description of
the operations unless you want to. In the fourth request will will skip the
description altogether.
Here we are getting a cached response.
GET /cache
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"url": "http://httpbin.org/cache",
"headers": "{{_}}",
"args": "{{_}}",
"origin": "{{>origin}}"
}
GET /cache
> Accept: application/json
> User-Agent: KATT
> If-Modified-Since: {{<some_date}}
< 304
A fifth request to show that whitespace in JSON body is insignificant.
POST /post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
{"origin":"{{<origin}}","whoarewe":"{{<your_name}}_and_{{<my_name}}","date":"{{<some_date}}"}
< 200
< Content-Type: application/json
{
"args": "{{_}}",
"data": "{{>raw_data}}",
"files": [],
"form": [],
"headers": "{{_}}",
"origin": "{{<origin}}",
"url": "http://httpbin.org/post",
"json": {
"origin": "{{<origin}}",
"date": "{{<some_date}}",
"whoarewe": "{{>whoarewe}}"
}
}
GET /get?origin={{<origin}}&whoarewe={{<whoarewe}}
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"args": {
"whoarewe": "{{<your_name}}_and_{{<my_name}}",
"origin": "{{<origin}}"
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "http://httpbin.org/get?origin={{<origin}}&whoarewe={{<whoarewe}}",
}
|
--- Examples against httpbin.org ---
---
Examples of how some requests to _httpbin.org_ can be specified. Read more about
the httpbin.org API at http://httpbin.org/.
See ../README.md for details on how to test this specification.
---
# First request and response
Get a teapot from some full URL.
Leading or trailing blank lines in the body are stripped, unless you delimit
the body lines with the markers <<< (start) and >>> (end). The newlines after
<<< as well as the newline before >>> is not included in the body.
GET /status/418
> Accept: *
> User-Agent: KATT
> Host: {{<hostname}}:{{<port}}
< 418
< X-More-Info: http://tools.ietf.org/html/rfc2324
<<<
-=[ teapot ]=-
_...._
.' _ _ `.
| ."` ^ `". _,
\_;`"---"`|//
| ;/
\_ _/
`"""`
>>>
# Second request and response
Get unauthorized.
Also note that we don't expect any body.
The current date will be available to use in later requests as `{{<some_date}}.`
GET /status/401
> Accept: *
> User-Agent: KATT
< 401
< Www-Authenticate: Basic realm="Fake Realm"
< Date: {{>some_date}}
# Third request
Note that the title of this operation is "Third request", but that's just
markdown for you. You don't need to include a title, or even a description of
the operations unless you want to. In the fourth request will will skip the
description altogether.
Here we are getting a cached response.
GET /cache
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"url": "http://httpbin.org/cache",
"headers": "{{_}}",
"args": "{{_}}",
"origin": "{{>origin}}"
}
GET /cache
> Accept: application/json
> User-Agent: KATT
> If-Modified-Since: {{<some_date}}
< 304
A fifth request to show that whitespace in JSON body is insignificant.
POST /post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
{"origin":"{{<origin}}","whoarewe":"{{<your_name}}_and_{{<my_name}}","date":"{{<some_date}}"}
< 200
< Content-Type: application/json
{
"args": "{{_}}",
"data": "{{>raw_data}}",
"files": [],
"form": [],
"headers": "{{_}}",
"origin": "{{<origin}}",
"url": "http://httpbin.org/post",
"json": {
"origin": "{{<origin}}",
"date": "{{<some_date}}",
"whoarewe": "{{>whoarewe}}"
}
}
GET /get?origin={{<origin}}&whoarewe={{<whoarewe}}
> Accept: application/json
> User-Agent: KATT
< 200
< Content-Type: application/json
{
"args": {
"whoarewe": "{{<your_name}}_and_{{<my_name}}",
"origin": "{{<origin}}"
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "http://httpbin.org/get?origin={{<origin}}&whoarewe={{<whoarewe}}"
}
|
fix dangling json comma
|
fix dangling json comma
|
API Blueprint
|
apache-2.0
|
for-GET/katt
|
e7c403282ea59608d70953f69b5117b53e5f7c09
|
docs/docs.apib
|
docs/docs.apib
|
FORMAT: 1A
HOST: http://pluto.treecom.net:8088/
# TolloT API Documentation
API Docs...
- API URL: http://pluto.treecom.net:8088/
- X-Auth-Token header is WC device token
## WC Collection [/wc]
### List WCs [GET /wc{?cateogry}]
List of toilets.
Header is optional.
+ Parameters
+ category: "2oucniwjni" (optional, string) - Filter by category id
+ Request
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": [
{
"_id":"2ud92939dj203j0d2j923jd",
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 123,
"banner": "http://someurl.com/banner.jpg"
}
]
}
### Get WC state [GET /wc/{_id}]
Get toilate state. Header is optional.
+ Parameters
+ _id: "2oucniwjni" (optional, string) - Toilet id
+ Request
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": {
"_id":"2ud92939dj203j0d2j923jd",
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 5,
"banner": "http://someurl.com/banner.jpg"
}
}
+ Response 404 (application/json)
+ Body
{
"status": "error",
"message": "WC not found"
}
### Subscribe to WC [POST /wc/{_id}/subsribe]
Subscribe user mobile to WC. If header with wc token is set it mean manager is subscribing to alerts.
Header is optional.
+ Parameters
+ _id: "2oucniwjni" (optional, string) - Toilet ID
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Body
{
"deviceToken": "wd8278hd72hduh23du2h3d8i2uh3d2u"
}
+ Response 200 (application/json)
+ Body
{
"status": "success"
}
### Unsubscribe to WC [POST /wc/{_id}/unsubsribe]
Unsubscribe user mobile from WC. If header with wc token is set it mean manager is subscribing to alerts.
Header is optional.
+ Parameters
+ _id: "2oucniwjni" (optional, string) - Toilet ID
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Body
{
"deviceToken": "wd8278hd72hduh23du2h3d8i2uh3d2u"
}
+ Response 200 (application/json)
+ Body
{
"status": "success"
}
### WC states report [GET /wc/{_id}/last{?from}]
Header is required.
+ Parameters
+ from: 2017-02-01 (optional, string) - From date
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
+ Body
{
"status": "success"
"data": [
{
"_id": "lxmlaksxmlkasml"
}
]
}
### Update WC [PUT /wc/{_id}]
Update WC Setttings.
Header is required.
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Body
{
"banner": "http://someurl.com/banner.jpg"
}
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": {
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 5,
"banner": "http://someurl.com/banner.jpg"
}
}
## Categories Collection [/categories]
### Get categories [GET /categories]
+ Response 200 (application/json)
{
"status": "success",
"data": [
{
"_id": "98hf92h7387f4873gf87g",
"title": "Kosice"
}
]
}
## Reports Collection [/reports]
### Get reports [GET /reports]
Header is required.
+ Request
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
{
"status": "success",
"data": [
{
"idWc": "ro2i3niof32i2"
}
]
}
|
FORMAT: 1A
HOST: http://pluto.treecom.net:8088/
# TolloT API Documentation
API Docs...
- API URL: http://pluto.treecom.net:8088/
- X-Auth-Token header is WC device token
## WC Collection [/wc]
### List WCs [GET /wc{?cateogry}]
List of toilets.
Header is optional.
+ Parameters
+ category: "2oucniwjni" (optional, string) - Filter by category id
+ Request
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": [
{
"_id":"2ud92939dj203j0d2j923jd",
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 123,
"banner": "http://someurl.com/banner.jpg"
}
]
}
### Get WC state [GET /wc/{_id}]
Get toilate state. Header is optional.
+ Parameters
+ _id: "2oucniwjni" (optional, string) - Toilet id
+ Request
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": {
"_id":"2ud92939dj203j0d2j923jd",
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 5,
"banner": "http://someurl.com/banner.jpg"
}
}
+ Response 404 (application/json)
+ Body
{
"status": "error",
"message": "WC not found"
}
### Get WC state with token [PUT /wc/token/{token}]
Get toilate state as manager. Header is optional.
+ Parameters
+ token: "28f9j394hf87hh4f" (optional, string) - Toilet token
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": {
"_id":"2ud92939dj203j0d2j923jd",
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 5,
"banner": "http://someurl.com/banner.jpg"
}
}
+ Response 404 (application/json)
+ Body
{
"status": "error",
"message": "WC not found"
}
### Subscribe to WC [POST /wc/{_id}/subsribe]
Subscribe user mobile to WC. If header with wc token is set it mean manager is subscribing to alerts.
Header is optional.
+ Parameters
+ _id: "2oucniwjni" (optional, string) - Toilet ID
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Body
{
"deviceToken": "wd8278hd72hduh23du2h3d8i2uh3d2u"
}
+ Response 200 (application/json)
+ Body
{
"status": "success"
}
### Unsubscribe to WC [POST /wc/{_id}/unsubsribe]
Unsubscribe user mobile from WC. If header with wc token is set it mean manager is subscribing to alerts.
Header is optional.
+ Parameters
+ _id: "2oucniwjni" (optional, string) - Toilet ID
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Body
{
"deviceToken": "wd8278hd72hduh23du2h3d8i2uh3d2u"
}
+ Response 200 (application/json)
+ Body
{
"status": "success"
}
### WC states report [GET /wc/{_id}/last{?from}]
Header is required.
+ Parameters
+ from: 2017-02-01 (optional, string) - From date
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
+ Body
{
"status": "success"
"data": [
{
"_id": "lxmlaksxmlkasml"
}
]
}
### Update WC [PUT /wc/{_id}]
Update WC Setttings.
Header is required.
+ Request (application/json)
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Body
{
"banner": "http://someurl.com/banner.jpg"
}
+ Response 200 (application/json)
+ Body
{
"status": "success",
"data": {
"categoryId": "982j9f8h2983fh98",
"status": true,
"active": true,
"token": "28f9j394hf87hh4f",
"title": "Hore",
"inactivity": 0,
"usageCount": 5,
"banner": "http://someurl.com/banner.jpg"
}
}
## Categories Collection [/categories]
### Get categories [GET /categories]
+ Response 200 (application/json)
{
"status": "success",
"data": [
{
"_id": "98hf92h7387f4873gf87g",
"title": "Kosice"
}
]
}
## Reports Collection [/reports]
### Get reports [GET /reports]
Header is required.
+ Request
+ Headers
X-Auth-Token: JCAiSjGefNprusgyRmtN51_CoQUutKOa9cPBu18kDCI
+ Response 200 (application/json)
{
"status": "success",
"data": [
{
"idWc": "ro2i3niof32i2"
}
]
}
|
update docs
|
update docs
|
API Blueprint
|
apache-2.0
|
KrakenTyP-co/ToIIoT,KrakenTyP-co/ToIIoT
|
cd3beabe7e744729958ad5af32fb48cf6b07246e
|
apiary.apib
|
apiary.apib
|
FORMAT: 1A
HOST: http://api.socialjukebox.scjug.org
# SCJUG SocialJukebox
A group-built application for the Space Coast Java User's Group. A distributed jukebox experience for owners and patrons which allow social interaction.
## Jukebox [/jukeboxes/{id}]
+ Parameters
+ id (string) ... ID of the Jukebox
+ Model (application/hal+json)
+ Headers
Link: <http:/api.socialjukebox.scjug.org/jukeboxes/1>;rel="self", <http:/api.socialjukebox.scjug.org/jukeboxes/1/tracks>;rel="tracks"
+ Body
{
"_links": {
"self": { "href": "/jukeboxes/1" },
"tracks": { "href": "/jukeboxes/1/tracks" }
},
"name": "TrepHub",
"location": {
"address": "907 E Strawbridge Ave, Melbourne, FL 32907",
"lat": "28.079250",
"long": "-80.605619"
},
"music_provider": {
"name": "Spotify"
}
}
### List a single jukebox by ID [GET]
+ Response 200 (applicaiton/hal+json)
[Jukebox][]
## Jukeboxes Collection [/jukeboxes{?distance}{&lat}(&long}]
+ Model (application/hal+json)
+ Headers
Link: <http:/api.socialjukebox.scjug.org/jukeboxes>;rel="self"
+ Body
{
"_links": {
"self": { "href": "/jukeboxes" },
"findNearBy": { "href" : "/jukeboxes{?distance}{&lat}{&long}", "templated": true }
},
"_embedded": {
"jukeboxes": [
{
"_links": {
"self": { "href": "/jukeboxes/1" },
"tracks": { "href": "/jukeboxes/1/tracks" }
},
"name": "TrepHub",
"location": {
"address": "907 E Strawbridge Ave, Melbourne, FL 32907",
"lat": "28.079250",
"long": "-80.605619"
},
"music_provider": {
"name": "Spotify"
}
},
{
"_links": {
"self": { "href": "/jukeboxes/2" },
"tracks": { "href": "/jukeboxes/2/tracks" }
},
"name": "Coasters Pub",
"location": {
"address": "971 E Eau Gallie Blvd, Melbourne, FL 32937",
"lat": "28.138622",
"long": "-80.582488"
},
"music_provider": {
"name": "Rdio.com"
}
}
]
}
}
### List all the Jukeboxes [GET]
+ Parameters
+ distance (int, optional) ... Distance relative to provided coordinates, only used when searching
+ lat (int, optional) ... Latitude, only used when searching
+ long (int, optional) ... Longitude, only used when searching
+ Response 200 (applicaiton/hal+json)
[Jukeboxes Collection][]
### Create a Jukebox [POST]
+ Request (application/json)
{
"name": "TrepHub",
"location": {
"address": "907 E Strawbridge Ave, Melbourne, FL 32907"
},
"music_provider": {
"name": "Spotify"
}
}
+ Response 201 (applicaiton/hal+json)
[Jukebox][]
|
FORMAT: 1A
HOST: http://api.socialjukebox.scjug.org
# SCJUG SocialJukebox
A group-built application for the Space Coast Java User's Group. A distributed jukebox experience for owners and patrons which allow social interaction.
## Jukebox [/jukeboxes/{id}]
+ Parameters
+ id (string) ... ID of the Jukebox
+ Model (application/hal+json)
+ Headers
Link: <http:/api.socialjukebox.scjug.org/jukeboxes/1>;rel="self", <http:/api.socialjukebox.scjug.org/jukeboxes/1/tracks>;rel="tracks"
+ Body
{
"_links": {
"self": { "href": "/jukeboxes/1" },
"tracks": { "href": "/jukeboxes/1/tracks" }
},
"name": "TrepHub",
"location": {
"address": "907 E Strawbridge Ave, Melbourne, FL 32907",
"lat": "28.079250",
"long": "-80.605619"
},
"music_provider": {
"name": "Spotify"
}
}
### List a single jukebox by ID [GET]
+ Response 200 (applicaiton/hal+json)
[Jukebox][]
## Jukeboxes Collection [/jukeboxes{?distance}{&lat}(&long}]
+ Model (application/hal+json)
+ Headers
Link: <http:/api.socialjukebox.scjug.org/jukeboxes>;rel="self";<http:/api.socialjukebox.scjug.org/jukeboxes{?distance}{&lat}{&long}>;rel="findNearBy"
+ Body
{
"_links": {
"self": { "href": "/jukeboxes" },
"findNearBy": { "href" : "/jukeboxes{?distance}{&lat}{&long}", "templated": true }
},
"_embedded": {
"jukeboxes": [
{
"_links": {
"self": { "href": "/jukeboxes/1" },
"tracks": { "href": "/jukeboxes/1/tracks" }
},
"name": "TrepHub",
"location": {
"address": "907 E Strawbridge Ave, Melbourne, FL 32907",
"lat": "28.079250",
"long": "-80.605619"
},
"music_provider": {
"name": "Spotify"
}
},
{
"_links": {
"self": { "href": "/jukeboxes/2" },
"tracks": { "href": "/jukeboxes/2/tracks" }
},
"name": "Coasters Pub",
"location": {
"address": "971 E Eau Gallie Blvd, Melbourne, FL 32937",
"lat": "28.138622",
"long": "-80.582488"
},
"music_provider": {
"name": "Rdio.com"
}
}
]
}
}
### List all the Jukeboxes [GET]
+ Parameters
+ distance (int, optional) ... Distance relative to provided coordinates, only used when searching
+ lat (int, optional) ... Latitude, only used when searching
+ long (int, optional) ... Longitude, only used when searching
+ Response 200 (applicaiton/hal+json)
[Jukeboxes Collection][]
### Create a Jukebox [POST]
+ Request (application/json)
{
"name": "TrepHub",
"location": {
"address": "907 E Strawbridge Ave, Melbourne, FL 32907"
},
"music_provider": {
"name": "Spotify"
}
}
+ Response 201 (applicaiton/hal+json)
[Jukebox][]
|
Add link details.
|
Add link details.
|
API Blueprint
|
mit
|
SCJUG/SocialJukebox
|
981dc23b075dd55b1a8fee60323d32e0f90e7d57
|
doc/apiary.apib
|
doc/apiary.apib
|
FORMAT: X-1A
# Machines API
# Group Machines
# Machines collection [/machines2]
## Create a Machine [POST]
+ Request (application/json)
{
"type": "bulldozer",
"name": "willy"
}
+ Response 202 (application/json)
{
"message": "Accepted"
}
## Retreive all Machines [GET]
+ Response 200 (application/json)
[{
"_id": "52341870ed55224b15ff07ef",
"type": "bulldozer",
"name": "willy"
}]
# Machine [/machines/{name}]
+ Parameters
+ name (required,`willy`)
## Retrieve a Machine [GET]
+ Response 200 (application/json)
{
"type": "bulldozer",
"name": "willy",
"_id": "5229c6e8e4b0bd7dbb07e29c"
}
## Delete Message [DELETE]
+ Response 204
|
FORMAT: X-1A
# Machines API
# Group Machines
# Machines collections [/machines]
## Create a Machine [POST]
+ Request (application/json)
{
"type": "bulldozer",
"name": "willy"
}
+ Response 202 (application/json)
{
"message": "Accepted"
}
## Retreive all Machines [GET]
+ Response 200 (application/json)
[{
"_id": "52341870ed55224b15ff07ef",
"type": "bulldozer",
"name": "willy"
}]
# Machine [/machines/{name}]
+ Parameters
+ name (required,`willy`)
## Retrieve a Machine [GET]
+ Response 200 (application/json)
{
"type": "bulldozer",
"name": "willy",
"_id": "5229c6e8e4b0bd7dbb07e29c"
}
## Delete Message [DELETE]
+ Response 204
|
Update apiary.apib
|
Update apiary.apib
|
API Blueprint
|
mit
|
yannickcr/test
|
ad54e4edc563568e1539f201ad40bb3a3154f100
|
doc/apiary/iotagent.apib
|
doc/apiary/iotagent.apib
|
FORMAT: 1A
HOST: http://idas.lab.fiware.org
TITLE: FIWARE IoT Agents API
DATE: December 2016
VERSION: stable
APIARY_PROJECT: telefonicaiotiotagents
SPEC_URL: https://telefonicaid.github.io/iotagent-node-lib/api/
GITHUB_SOURCE: https://github.com/telefonicaid/iotagent-node-lib
## Copyright
Copyright (c) 2014-2016 Telefonica Investigacion y Desarrollo
## License
This specification is licensed under the
[FIWARE Open Specification License (implicit patent license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
# IoT Agent Provision API Documentacion
An [IoT Agent](https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus) is a component that mediates between a set of Devices using their own native protocols and a NGSI compliant Context Provider (i.e. Fiware Context Broker).
This documentation covers the IoT Agent Provision API and the resources you can manipulate on an IoT Agent in order to publish custom information in IoT Platform. The IoT Agent Provision API is based on REST principles.
|Allowed HTTPs requests | |
|:---------------------------|:----------------------------------------|
|POST: |Creates a resource or list of resources |
|PUT: |Updates a resource |
|GET: |Retrieves a resource or list of resources|
|DELETE: |Delete a resource |
|Server Responses | |
|:---------------------------|:--------------------------------------------------------------------------------------------------|
|200 OK |The request was succesful (some API calls may return 201 instead) |
|201 Created |The request was succesful and a resource or list of resources was created |
|204 No Content |The request was succesful but there is no representation to return (that is, the response is empty)|
|400 Bad Request |The request could not be understood or was missing required parameters |
|401 Unauthorized |Authentication failed |
|403 Forbidden |Access denied |
|404 Not Found |Resource was not found |
|409 Conflict |A resource cannot be created because it already exists |
|500 Internal Server Error |Generic error when server has a malfunction. This error will be removed |
Responses related with authentication and authorization depends on this feature is configured and a Keystone OpenStack sytem is present.
When an error is returned, a representation is returned as:
```
{
"reason": "contains why an error is returned",
"details": "contains specific information about the error, if possible"
}
```
## Authentication and Authorization
If the IoT Agent is in authenticated environment, this API requires a token, which you obtain from authentication system. This system and its API is out of scope of present documentation. In this environment, a mandatory header is needed: `X-Auth-Token`.
## Mandatory HTTP Headers
The API needs two headers in order to manage requests:
|Http Header |Level |If not present |Observations |
|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|
|<b>Fiware-Service</b> |Represents a tenant. Higher level in resources hierachy in IoT Platform |An error is returned |Must only contain less than 50 Underscores and Alphanumeric lowercase characters |
|<b>Fiware-ServicePath</b> |Represents the second level |We assume '/'. Allowed operation '/*'|Must only contain less than 50 Underscores and Alphanumeric characters. Must start with character '/'. Max. length is 51 characters (with /)|
## API Access
All API base URLs are relative and depend on where the IoT Agent is listening (depends on each service).
For example, `http://127.0.0.1:8080/iot/`.
# Group Configuration API
## Services [/services{?limit,offset,resource,apikey,device}]
Services are the higher level in IoT Platform. When you manipulate a service, you use a Fiware-Service header with its name. Parameters apply to different operations.
Fields in JSON object representing a service are:
|Fields in JSON Object | |
|:-----------------------|:------------------------------------------------------------|
|`apikey` |It is a key used for devices belonging to this service. If "", service does not use apikey, but it must be specified.|
|`token` |If authentication/authorization system is configured, IoT Agent works as user when it publishes information. That token allows that other components to verify the identity of IoT Agent. Depends on authentication and authorization system.|
|`cbroker` |Context Broker endpoint assigned to this service, it must be a real uri.|
|`outgoing_route` |It is an identifier for VPN/GRE tunnel. It is used when device is into a VPN and a command is sent.|
|`resource` |Path in IoTAgent. When protocol is HTTP a device could send information to this uri. In general, it is a uri in a HTTP server needed to load and execute a module.|
|`entity_type` |Entity type used in entity publication (overload default).|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
Mandatory fields are identified in every operation.
`static_attributes` and `attributes` are used if device has not this information.
### Retrieve a service group [GET]
With Fiware-ServicePath you can retrieve a service group.
+ Parameters [limit, offset, resource]
+ `limit` (optional, number). In order to specify the maximum number of services (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `resource` (optional, string). URI for the iotagent, return only services for this iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /*
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
### Create a service group [POST]
With one subservice defined in Fiware-ServicePath header. From service model, mandatory fields are: apikey, resource (cbroker field is temporary mandatory).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"services": [
{
"apikey": "apikey3",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Response 201
### Update a service group [PUT]
If you want modify only a field, you can do it. You cannot modify an element into an array field, but whole array. ("/*" is not allowed).
+ Parameters [apikey, resource]
+ `apikey` (optional, string). If you don't specify, apikey=" " is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_type": "entity_type"
}
+ Response 204
### Remove a service group [DELETE]
You remove a subservice into a service. If Fiware-ServicePath is '/*' or '/#' remove a service group.
+ Parameters [apikey, resource, device]
+ `apikey` (optional, string). If you don't specify, apikey="" is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ `device` (optional, boolean). Default value is false. Remove devices in service/subservice. This parameter is not valid when Fiware-ServicePath is '/*' or '/#'.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
## Devices [/devices{?limit,offset,detailed,protocol,entity}]
A device is a resource that publish information to IoT Platform and it uses the IoT Agent.
### Device Model
- `device_id`. Unique identifier into a service.
- `protocol`. Protocol assigned to device. This field is easily provided by IoTA Manager if it is used. Every module implmenting a protocol has an identifier.
- `entity_name`. Entity name used for entity publication (overload default)
- `entity_type`. Entity type used for entity publication (overload entity_type defined in service).
- `timezone`. Used to automatically generate timestamps attributes for the entity publication.
- `attributes`. Mapping for protocol parameters to entity attributes.
`object_id` (string, mandatory): protocol parameter to be mapped.
`name` (string, mandatory): attribute name to publish.
`type`: (string, mandatory): attribute type to publish.
- `static_attributes` (optional, array). Attributes published as defined.
`name` (string, mandatory): attribute name to publish.
`type` (string, mandatory): attribute type to publish.
`value` (string, mandatory): attribute value to publish.
- `endpoint` (optional, string): when a device uses push commands.
- `commands` (optional, array). Attributes working as commands.
`name` (string, mandatory): command identifier.
`type` (string, mandatory). It must be 'command'.
`value` (string, mandatory): command representation depends on protocol.
Mandatory fields are identified in every operation.
### Retrieve all devices [GET]
+ Parameters [limit, offset, detailed, entity, protocol]
+ `limit` (optional, number). In order to specify the maximum number of devices (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `detailed` (optional, string). `on` return all device information, `off` (default) return only name.
+ `entity` (optional, string). It allows get a device from entity name.
+ `protocol` (optional, string). It allows get devices with this protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testService
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
### Create a device [POST]
From device model, mandatory fields are: device_id and protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
+ Response 201
+ Headers (only if ONE device is in request)
Location: /iot/devices/device_id
+ Response 400
{
"reason": "parameter limit must be an integer"
}
+ Response 404
## Device [/devices/{device_id}]
### Retrieve a device [GET]
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"device_id": "device_id",
"protocol": "121345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
### Update a device [PUT]
If you want modify only a field, you can do it, except field `protocol` (this field, if provided it is removed from request).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_name": "entity_name"
}
+ Response 204
### Remove a device [DELETE]
If specific device is not found, we work as deleted.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
|
FORMAT: 1A
HOST: http://idas.lab.fiware.org
TITLE: FIWARE IoT Agents API
DATE: December 2016
VERSION: stable
APIARY_PROJECT: telefonicaiotiotagents
SPEC_URL: https://telefonicaid.github.io/iotagent-node-lib/api/
GITHUB_SOURCE: https://github.com/telefonicaid/iotagent-node-lib
## Copyright
Copyright (c) 2014-2016 Telefonica Investigacion y Desarrollo
## License
This specification is licensed under the
[FIWARE Open Specification License (implicit patent license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
# IoT Agent Provision API Documentacion
An [IoT Agent](https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus) is a component that mediates between a set of Devices using their own native protocols and a NGSI compliant Context Provider (i.e. Fiware Context Broker).
This documentation covers the IoT Agent Provision API and the resources you can manipulate on an IoT Agent in order to publish custom information in IoT Platform. The IoT Agent Provision API is based on REST principles.
|Allowed HTTPs requests | |
|:---------------------------|:----------------------------------------|
|POST: |Creates a resource or list of resources |
|PUT: |Updates a resource |
|GET: |Retrieves a resource or list of resources|
|DELETE: |Delete a resource |
|Server Responses | |
|:---------------------------|:--------------------------------------------------------------------------------------------------|
|200 OK |The request was succesful (some API calls may return 201 instead) |
|201 Created |The request was succesful and a resource or list of resources was created |
|204 No Content |The request was succesful but there is no representation to return (that is, the response is empty)|
|400 Bad Request |The request could not be understood or was missing required parameters |
|401 Unauthorized |Authentication failed |
|403 Forbidden |Access denied |
|404 Not Found |Resource was not found |
|409 Conflict |A resource cannot be created because it already exists |
|500 Internal Server Error |Generic error when server has a malfunction. This error will be removed |
Responses related with authentication and authorization depends on this feature is configured and a Keystone OpenStack sytem is present.
When an error is returned, a representation is returned as:
```
{
"reason": "contains why an error is returned",
"details": "contains specific information about the error, if possible"
}
```
## Authentication and Authorization
If the IoT Agent is in authenticated environment, this API requires a token, which you obtain from authentication system. This system and its API is out of scope of present documentation. In this environment, a mandatory header is needed: `X-Auth-Token`.
## Mandatory HTTP Headers
The API needs two headers in order to manage requests:
|Http Header |Level |If not present |Observations |
|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|
|<b>Fiware-Service</b> |Represents a tenant. Higher level in resources hierachy in IoT Platform |An error is returned |Must only contain less than 50 Underscores and Alphanumeric lowercase characters |
|<b>Fiware-ServicePath</b> |Represents the second level |We assume '/'. Allowed operation '/*'|Must only contain less than 50 Underscores and Alphanumeric characters. Must start with character '/'. Max. length is 51 characters (with /)|
## API Access
All API base URLs are relative and depend on where the IoT Agent is listening (depends on each service).
For example, `http://127.0.0.1:8080/iot/`.
# Group Configuration API
## Services [/services{?limit,offset,resource,apikey,device}]
Group configuration for iotagents.
Fields in JSON object representing a service are:
|Fields in JSON Object | |
|:-----------------------|:------------------------------------------------------------|
|`apikey` |It is a key used for devices belonging to this service. If "", service does not use apikey, but it must be specified.|
|`token` |If authentication/authorization system is configured, IoT Agent works as user when it publishes information. That token allows that other components to verify the identity of IoT Agent. Depends on authentication and authorization system.|
|`cbroker` |Context Broker endpoint assigned to this service, it must be a real uri.|
|`outgoing_route` |It is an identifier for VPN/GRE tunnel. It is used when device is into a VPN and a command is sent.|
|`resource` |Path in IoTAgent. When protocol is HTTP a device could send information to this uri. In general, it is a uri in a HTTP server needed to load and execute a module.|
|`entity_type` |Entity type used in entity publication (overload default).|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
Mandatory fields are identified in every operation.
`static_attributes` and `attributes` are used if device has not this information.
### Retrieve a configuration group [GET]
Retrieve a group configuration.
+ Parameters [limit, offset, resource]
+ `limit` (optional, number). In order to specify the maximum number of services (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `resource` (optional, string). URI for the iotagent, return only services for this iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /*
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
### Create a configuration group [POST]
Create a new configuration group. From service model, mandatory fields are: apikey, resource (cbroker field is temporary mandatory).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"services": [
{
"apikey": "apikey3",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Response 201
### Update a configuration group [PUT]
If you want modify only a field, you can do it. You cannot modify an element into an array field, but whole array. ("/*" is not allowed).
+ Parameters [apikey, resource]
+ `apikey` (optional, string). If you don't specify, apikey=" " is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_type": "entity_type"
}
+ Response 204
### Remove a configuration group [DELETE]
Remove a configuration group.
+ Parameters [apikey, resource, device]
+ `apikey` (optional, string). If you don't specify, apikey="" is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ `device` (optional, boolean). Default value is false. Remove devices in service/subservice. This parameter is not valid when Fiware-ServicePath is '/*' or '/#'.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
## Devices [/devices{?limit,offset,detailed,protocol,entity}]
A device is a resource that publish information to IoT Platform and it uses the IoT Agent.
### Device Model
- `device_id`. Unique identifier into a service.
- `protocol`. Protocol assigned to device. This field is easily provided by IoTA Manager if it is used. Every module implmenting a protocol has an identifier.
- `entity_name`. Entity name used for entity publication (overload default)
- `entity_type`. Entity type used for entity publication (overload entity_type defined in service).
- `timezone`. Used to automatically generate timestamps attributes for the entity publication.
- `attributes`. Mapping for protocol parameters to entity attributes.
`object_id` (string, mandatory): protocol parameter to be mapped.
`name` (string, mandatory): attribute name to publish.
`type`: (string, mandatory): attribute type to publish.
- `static_attributes` (optional, array). Attributes published as defined.
`name` (string, mandatory): attribute name to publish.
`type` (string, mandatory): attribute type to publish.
`value` (string, mandatory): attribute value to publish.
- `endpoint` (optional, string): when a device uses push commands.
- `commands` (optional, array). Attributes working as commands.
`name` (string, mandatory): command identifier.
`type` (string, mandatory). It must be 'command'.
`value` (string, mandatory): command representation depends on protocol.
Mandatory fields are identified in every operation.
### Retrieve all devices [GET]
+ Parameters [limit, offset, detailed, entity, protocol]
+ `limit` (optional, number). In order to specify the maximum number of devices (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `detailed` (optional, string). `on` return all device information, `off` (default) return only name.
+ `entity` (optional, string). It allows get a device from entity name.
+ `protocol` (optional, string). It allows get devices with this protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testService
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
### Create a device [POST]
From device model, mandatory fields are: device_id and protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
+ Response 201
+ Headers (only if ONE device is in request)
Location: /iot/devices/device_id
+ Response 400
{
"reason": "parameter limit must be an integer"
}
+ Response 404
## Device [/devices/{device_id}]
### Retrieve a device [GET]
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"device_id": "device_id",
"protocol": "121345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
### Update a device [PUT]
If you want modify only a field, you can do it, except field `protocol` (this field, if provided it is removed from request).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_name": "entity_name"
}
+ Response 204
### Remove a device [DELETE]
If specific device is not found, we work as deleted.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
|
Update iotagent.apib
|
Update iotagent.apib
|
API Blueprint
|
agpl-3.0
|
telefonicaid/iotagent-node-lib,telefonicaid/iotagent-node-lib,telefonicaid/iotagent-node-lib
|
800f7109b1bbc0de1510e7b081c91be3629e0eaf
|
doc/apiary/iotagent.apib
|
doc/apiary/iotagent.apib
|
FORMAT: 1A
HOST: http://idas.lab.fiware.org
TITLE: FIWARE IoT Agents API
DATE: December 2016
VERSION: stable
APIARY_PROJECT: telefonicaiotiotagents
SPEC_URL: https://telefonicaid.github.io/iotagent-node-lib/api/
GITHUB_SOURCE: https://github.com/telefonicaid/iotagent-node-lib
## Copyright
Copyright (c) 2014-2016 Telefonica Investigacion y Desarrollo
## License
This specification is licensed under the
[FIWARE Open Specification License (implicit patent license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
# IoT Agent Provision API Documentacion
An [IoT Agent](https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus) is a component that mediates between a set of Devices using their own native protocols and a NGSI compliant Context Provider (i.e. Fiware Context Broker).
This documentation covers the IoT Agent Provision API and the resources you can manipulate on an IoT Agent in order to publish custom information in IoT Platform. The IoT Agent Provision API is based on REST principles.
|Allowed HTTPs requests | |
|:---------------------------|:----------------------------------------|
|POST: |Creates a resource or list of resources |
|PUT: |Updates a resource |
|GET: |Retrieves a resource or list of resources|
|DELETE: |Delete a resource |
|Server Responses | |
|:---------------------------|:--------------------------------------------------------------------------------------------------|
|200 OK |The request was succesful (some API calls may return 201 instead) |
|201 Created |The request was succesful and a resource or list of resources was created |
|204 No Content |The request was succesful but there is no representation to return (that is, the response is empty)|
|400 Bad Request |The request could not be understood or was missing required parameters |
|401 Unauthorized |Authentication failed |
|403 Forbidden |Access denied |
|404 Not Found |Resource was not found |
|409 Conflict |A resource cannot be created because it already exists |
|500 Internal Server Error |Generic error when server has a malfunction. This error will be removed |
Responses related with authentication and authorization depends on this feature is configured and a Keystone OpenStack sytem is present.
When an error is returned, a representation is returned as:
```
{
"reason": "contains why an error is returned",
"details": "contains specific information about the error, if possible"
}
```
## Authentication and Authorization
If the IoT Agent is in authenticated environment, this API requires a token, which you obtain from authentication system. This system and its API is out of scope of present documentation. In this environment, a mandatory header is needed: `X-Auth-Token`.
## Mandatory HTTP Headers
The API needs two headers in order to manage requests:
|Http Header |Level |If not present |Observations |
|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|
|<b>Fiware-Service</b> |Represents a tenant. Higher level in resources hierachy in IoT Platform |An error is returned |Must only contain less than 50 Underscores and Alphanumeric lowercase characters |
|<b>Fiware-ServicePath</b> |Represents the second level |We assume '/'. Allowed operation '/*'|Must only contain less than 50 Underscores and Alphanumeric characters. Must start with character '/'. Max. length is 51 characters (with /)|
## API Access
All API base URLs are relative and depend on where the IoT Agent is listening (depends on each service).
For example, `http://127.0.0.1:8080/iot/`.
# Configuration Group API
## Services [/services{?limit,offset,resource,apikey,device}]
Configuration group for iotagents.
Fields in JSON object representing a configuration group are:
|Fields in JSON Object | |
|:-----------------------|:------------------------------------------------------------|
|`apikey` |It is a key used for devices belonging to this service. If "", service does not use apikey, but it must be specified.|
|`token` |If authentication/authorization system is configured, IoT Agent works as user when it publishes information. That token allows that other components to verify the identity of IoT Agent. Depends on authentication and authorization system.|
|`cbroker` |Context Broker endpoint assigned to this service, it must be a real uri.|
|`outgoing_route` |It is an identifier for VPN/GRE tunnel. It is used when device is into a VPN and a command is sent.|
|`resource` |Path in IoTAgent. When protocol is HTTP a device could send information to this uri. In general, it is a uri in a HTTP server needed to load and execute a module.|
|`entity_type` |Entity type used in entity publication (overload default).|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
| `timestamp`. |(optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.|
| `autoprovision`. |(optional, boolean): This field idicates if appendMode will be APPEND if true (as default in iotAgent configuration appendMode) of UPDATE if false.|
Mandatory fields are identified in every operation.
`static_attributes` and `attributes` are used if device has not this information.
### Retrieve a configuration group [GET]
Retrieve a configuration group.
+ Parameters [limit, offset, resource]
+ `limit` (optional, number). In order to specify the maximum number of services (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `resource` (optional, string). URI for the iotagent, return only services for this iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /*
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
### Create a configuration group [POST]
Create a new configuration group. From service model, mandatory fields are: apikey, resource (cbroker field is temporary mandatory).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"services": [
{
"apikey": "apikey3",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Response 201
### Update a configuration group [PUT]
If you want modify only a field, you can do it. You cannot modify an element into an array field, but whole array. ("/*" is not allowed).
+ Parameters [apikey, resource]
+ `apikey` (optional, string). If you don't specify, apikey=" " is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_type": "entity_type"
}
+ Response 204
### Remove a configuration group [DELETE]
Remove a configuration group.
+ Parameters [apikey, resource, device]
+ `apikey` (optional, string). If you don't specify, apikey="" is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ `device` (optional, boolean). Default value is false. Remove devices in service/subservice. This parameter is not valid when Fiware-ServicePath is '/*' or '/#'.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
## Devices [/devices{?limit,offset,detailed,protocol,entity}]
A device is a resource that publish information to IoT Platform and it uses the IoT Agent.
### Device Model
- `device_id`. Unique identifier into a service.
- `protocol`. Protocol assigned to device. This field is easily provided by IoTA Manager if it is used. Every module implmenting a protocol has an identifier.
- `entity_name`. Entity name used for entity publication (overload default)
- `entity_type`. Entity type used for entity publication (overload entity_type defined in service).
- `timezone`. Used to automatically generate timestamps attributes for the entity publication.
- `attributes`. Mapping for protocol parameters to entity attributes.
`object_id` (string, mandatory): protocol parameter to be mapped.
`name` (string, mandatory): attribute name to publish.
`type`: (string, mandatory): attribute type to publish.
- `static_attributes` (optional, array). Attributes published as defined.
`name` (string, mandatory): attribute name to publish.
`type` (string, mandatory): attribute type to publish.
`value` (string, mandatory): attribute value to publish.
- `endpoint` (optional, string): when a device uses push commands.
- `commands` (optional, array). Attributes working as commands.
`name` (string, mandatory): command identifier.
`type` (string, mandatory). It must be 'command'.
`value` (string, mandatory): command representation depends on protocol.
- `timestamp`. (optional, boolean): This filed indicates if a attribute 'TimeInstant' will be added (true) or not (false). Otherwise IotAgent configuration timestamp configuration will be used.
- `autoprovision`. (optional, boolean): This field idicates if appendMode will be APPEND if true (as default in iotAgent configuration appendMode) of UPDATE if false.
Mandatory fields are identified in every operation.
### Retrieve all devices [GET]
+ Parameters [limit, offset, detailed, entity, protocol]
+ `limit` (optional, number). In order to specify the maximum number of devices (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `detailed` (optional, string). `on` return all device information, `off` (default) return only name.
+ `entity` (optional, string). It allows get a device from entity name.
+ `protocol` (optional, string). It allows get devices with this protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testService
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
### Create a device [POST]
From device model, mandatory fields are: device_id and protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
+ Response 201
+ Headers (only if ONE device is in request)
Location: /iot/devices/device_id
+ Response 400
{
"reason": "parameter limit must be an integer"
}
+ Response 404
## Device [/devices/{device_id}]
### Retrieve a device [GET]
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"device_id": "device_id",
"protocol": "121345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
### Update a device [PUT]
If you want modify only a field, you can do it, except field `protocol` (this field, if provided it is removed from request).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_name": "entity_name"
}
+ Response 204
### Remove a device [DELETE]
If specific device is not found, we work as deleted.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
|
FORMAT: 1A
HOST: http://idas.lab.fiware.org
TITLE: FIWARE IoT Agents API
DATE: December 2016
VERSION: stable
APIARY_PROJECT: telefonicaiotiotagents
SPEC_URL: https://telefonicaid.github.io/iotagent-node-lib/api/
GITHUB_SOURCE: https://github.com/telefonicaid/iotagent-node-lib
## Copyright
Copyright (c) 2014-2016 Telefonica Investigacion y Desarrollo
## License
This specification is licensed under the
[FIWARE Open Specification License (implicit patent license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
# IoT Agent Provision API Documentacion
An [IoT Agent](https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus) is a component that mediates between a set of Devices using their own native protocols and a NGSI compliant Context Provider (i.e. Fiware Context Broker).
This documentation covers the IoT Agent Provision API and the resources you can manipulate on an IoT Agent in order to publish custom information in IoT Platform. The IoT Agent Provision API is based on REST principles.
|Allowed HTTPs requests | |
|:---------------------------|:----------------------------------------|
|POST: |Creates a resource or list of resources |
|PUT: |Updates a resource |
|GET: |Retrieves a resource or list of resources|
|DELETE: |Delete a resource |
|Server Responses | |
|:---------------------------|:--------------------------------------------------------------------------------------------------|
|200 OK |The request was succesful (some API calls may return 201 instead) |
|201 Created |The request was succesful and a resource or list of resources was created |
|204 No Content |The request was succesful but there is no representation to return (that is, the response is empty)|
|400 Bad Request |The request could not be understood or was missing required parameters |
|401 Unauthorized |Authentication failed |
|403 Forbidden |Access denied |
|404 Not Found |Resource was not found |
|409 Conflict |A resource cannot be created because it already exists |
|500 Internal Server Error |Generic error when server has a malfunction. This error will be removed |
Responses related with authentication and authorization depends on this feature is configured and a Keystone OpenStack sytem is present.
When an error is returned, a representation is returned as:
```
{
"reason": "contains why an error is returned",
"details": "contains specific information about the error, if possible"
}
```
## Authentication and Authorization
If the IoT Agent is in authenticated environment, this API requires a token, which you obtain from authentication system. This system and its API is out of scope of present documentation. In this environment, a mandatory header is needed: `X-Auth-Token`.
## Mandatory HTTP Headers
The API needs two headers in order to manage requests:
|Http Header |Level |If not present |Observations |
|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------|
|<b>Fiware-Service</b> |Represents a tenant. Higher level in resources hierachy in IoT Platform |An error is returned |Must only contain less than 50 Underscores and Alphanumeric lowercase characters |
|<b>Fiware-ServicePath</b> |Represents the second level |We assume '/'. Allowed operation '/*'|Must only contain less than 50 Underscores and Alphanumeric characters. Must start with character '/'. Max. length is 51 characters (with /)|
## API Access
All API base URLs are relative and depend on where the IoT Agent is listening (depends on each service).
For example, `http://127.0.0.1:8080/iot/`.
# Configuration Group API
## Services [/services{?limit,offset,resource,apikey,device}]
Configuration group for iotagents.
Fields in JSON object representing a configuration group are:
|Fields in JSON Object | |
|:-----------------------|:------------------------------------------------------------|
|`apikey` |It is a key used for devices belonging to this service. If "", service does not use apikey, but it must be specified.|
|`token` |If authentication/authorization system is configured, IoT Agent works as user when it publishes information. That token allows that other components to verify the identity of IoT Agent. Depends on authentication and authorization system.|
|`cbroker` |Context Broker endpoint assigned to this service, it must be a real uri.|
|`outgoing_route` |It is an identifier for VPN/GRE tunnel. It is used when device is into a VPN and a command is sent.|
|`resource` |Path in IoTAgent. When protocol is HTTP a device could send information to this uri. In general, it is a uri in a HTTP server needed to load and execute a module.|
|`entity_type` |Entity type used in entity publication (overload default).|
|`attributes` |Mapping for protocol parameters to entity attributes.<br> `object_id` (string, mandatory): protocol parameter to be mapped.<br> `name` (string, mandatory): attribute name to publish.<br> `type`: (string, mandatory): attribute type to publish.|
|`static_attributes` |Attributes published as defined.<br> `name` (string, mandatory): attribute name to publish.<br> `type` (string, mandatory): attribute type to publish.<br> `value` (string, mandatory): attribute value to publish.|
| `timestamp`. |(optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.|
| `autoprovision`. |(optional, boolean): This field idicates if appendMode will be APPEND if true (as default in iotAgent configuration appendMode) of UPDATE if false.|
Mandatory fields are identified in every operation.
`static_attributes` and `attributes` are used if device has not this information.
### Retrieve a configuration group [GET]
Retrieve a configuration group.
+ Parameters [limit, offset, resource]
+ `limit` (optional, number). In order to specify the maximum number of services (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `resource` (optional, string). URI for the iotagent, return only services for this iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /*
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"services": [
{
"apikey": "apikey3",
"service": "service2",
"service_path": "/srvpath2",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
### Create a configuration group [POST]
Create a new configuration group. From service model, mandatory fields are: apikey, resource (cbroker field is temporary mandatory).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"services": [
{
"apikey": "apikey3",
"token": "token2",
"cbroker": "http://127.0.0.1:1026",
"entity_type": "thing",
"resource": "/iot/d"
}
]
}
+ Response 201
### Update a configuration group [PUT]
If you want modify only a field, you can do it. You cannot modify an element into an array field, but whole array. ("/*" is not allowed).
+ Parameters [apikey, resource]
+ `apikey` (optional, string). If you don't specify, apikey=" " is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_type": "entity_type"
}
+ Response 204
### Remove a configuration group [DELETE]
Remove a configuration group.
+ Parameters [apikey, resource, device]
+ `apikey` (optional, string). If you don't specify, apikey="" is applied.
+ `resource` (mandatory, string). URI for service into iotagent.
+ `device` (optional, boolean). Default value is false. Remove devices in service/subservice. This parameter is not valid when Fiware-ServicePath is '/*' or '/#'.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
## Devices [/devices{?limit,offset,detailed,protocol,entity}]
A device is a resource that publish information to IoT Platform and it uses the IoT Agent.
### Device Model
- `device_id`. Unique identifier into a service.
- `protocol`. Protocol assigned to device. This field is easily provided by IoTA Manager if it is used. Every module implmenting a protocol has an identifier.
- `entity_name`. Entity name used for entity publication (overload default)
- `entity_type`. Entity type used for entity publication (overload entity_type defined in service).
- `timezone`. Used to automatically generate timestamps attributes for the entity publication.
- `attributes`. Mapping for protocol parameters to entity attributes.
`object_id` (string, mandatory): protocol parameter to be mapped.
`name` (string, mandatory): attribute name to publish.
`type`: (string, mandatory): attribute type to publish.
- `static_attributes` (optional, array). Attributes published as defined.
`name` (string, mandatory): attribute name to publish.
`type` (string, mandatory): attribute type to publish.
`value` (string, mandatory): attribute value to publish.
- `endpoint` (optional, string): when a device uses push commands.
- `commands` (optional, array). Attributes working as commands.
`name` (string, mandatory): command identifier.
`type` (string, mandatory). It must be 'command'.
`value` (string, mandatory): command representation depends on protocol.
- `timestamp`. (optional, boolean): This field indicates if an attribute 'TimeInstant' will be added (true) or not (false). If this field is omitted, the global IotAgent configuration timestamp will be used.
- `autoprovision`. (optional, boolean): This field idicates if appendMode will be APPEND if true (as default in iotAgent configuration appendMode) of UPDATE if false.
Mandatory fields are identified in every operation.
### Retrieve all devices [GET]
+ Parameters [limit, offset, detailed, entity, protocol]
+ `limit` (optional, number). In order to specify the maximum number of devices (default is 20, maximun allowed is 1000).
+ `offset` (optional, number). In order to skip a given number of elements at the beginning (default is 0) .
+ `detailed` (optional, string). `on` return all device information, `off` (default) return only name.
+ `entity` (optional, string). It allows get a device from entity name.
+ `protocol` (optional, string). It allows get devices with this protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testService
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"count": 1,
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
### Create a device [POST]
From device model, mandatory fields are: device_id and protocol.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"devices": [
{
"device_id": "device_id",
"protocol": "12345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
]
}
+ Response 201
+ Headers (only if ONE device is in request)
Location: /iot/devices/device_id
+ Response 400
{
"reason": "parameter limit must be an integer"
}
+ Response 404
## Device [/devices/{device_id}]
### Retrieve a device [GET]
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 200
+ Body
{
"device_id": "device_id",
"protocol": "121345",
"entity_name": "entity_name",
"entity_type": "entity_type",
"timezone": "America/Santiago",
"attributes": [
{
"object_id": "source_data",
"name": "attr_name",
"type": "int"
}
],
"static_attributes": [
{
"name": "att_name",
"type": "string",
"value": "value"
}
]
}
### Update a device [PUT]
If you want modify only a field, you can do it, except field `protocol` (this field, if provided it is removed from request).
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Body
{
"entity_name": "entity_name"
}
+ Response 204
### Remove a device [DELETE]
If specific device is not found, we work as deleted.
+ Request (application/json)
+ Headers
Fiware-Service: testservice
Fiware-ServicePath: /TestSubservice
+ Response 204
|
Update doc/apiary/iotagent.apib
|
Update doc/apiary/iotagent.apib
Co-Authored-By: Fermín Galán Márquez <a42853be7dd7164f3322943925c40e0cb15f30bb@users.noreply.github.com>
|
API Blueprint
|
agpl-3.0
|
telefonicaid/iotagent-node-lib,telefonicaid/iotagent-node-lib,telefonicaid/iotagent-node-lib
|
c8e7984059b736192723e165f2024101e800a91a
|
deoraclize-apiary.apib
|
deoraclize-apiary.apib
|
FORMAT: 1A
HOST: http://deoraclize.herokuapp.com
# Deoraclize API
## Search [GET /search{?term}]
+ Parameters
+ term: OPC (required, string) - The acronym/abbreviation you want to lookup
+ Response 200 (application/json)
+ Attributes
+ count (number) - Count of the search results
+ results (array)
+ (object)
+ abbr (string) - Abbreviation matching the search term
+ title (string) - Meaning of the abbreviation
+ description (string) - Detailed description
+ url (string) - URL to the source of the information
|
FORMAT: 1A
HOST: http://deoraclize.herokuapp.com
# Deoraclize API
API which provides you with explanations of abbreviations and acronyms used in Oracle.
## Search [GET /search{?q}]
+ Parameters
+ q: OPC (required, string) - The acronym/abbreviation you want to lookup
+ Response 200 (application/json)
+ Attributes
+ count (number, required) - Count of the search results
+ results (array, required, fixed-type)
+ (object)
+ abbr (string, required) - Abbreviation matching the search term
+ title (string, required) - Meaning of the abbreviation
+ description (string) - Detailed description
+ url (string, required) - URL to the source of the information
|
Update API docs
|
docs: Update API docs
|
API Blueprint
|
mit
|
honzajavorek/deoraclize
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.