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
eaf4cacb905186d3cd19be88042125b758d600b6
LIGHTNING-API-BLUEPRINT.apib
LIGHTNING-API-BLUEPRINT.apib
FORMAT: 1A Weather API ============================= # General information This technical document was created for developers who are creating applications based on weather data provided by this API. This document is using [API blueprint format](https://apiblueprint.org/documentation/). ### 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 `lightning`. 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) #### Client Credentials Before getting an access to any endpoints, need to obtain **client id** and **client secret**. For achieving this, please use [request form](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951). #### Authorization Token Once you have your client credentials (Client-ID + Password), you can request a token on [Authorization server](https://auth.weather.mg/oauth/token?grant_type=client_credentials with http basic auth). The token will be in the return message, encrypted with a key from the authorization service. It will contain the client-ID, scopes and expiration date. The token is only a valid for a limited time, after this it will expired and you have to request a new token again. #### Using Authorization Token HTTP GET request to the endpoints needs to provide Authorization Token into **Authorization** HTTP Header. More information about JWT token might be found here: https://en.wikipedia.org/wiki/JSON_Web_Token. HTTP Header: **Authorization** : **Bearer {ENCRYPTED TOKEN HERE}** The Authorization token contains the Scopes which the client is allowed to have. **lightning** is the scope which allows to request Lightning Service. ### Backward compatibility Every endpoint may add one or more response parameters in the future. Clients should ignore unknown parameters, to avoid technical issues. # Group Lightning ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}&occurredUntil={endTime}&startPosition={startPosition}] ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}] #### Example https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:21:14Z&occurredUntil=2017-01-05T12:21:15Z&startPosition=30000 https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:21:14Z https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5] ##### Limitation Due to some technical constraints, the response payload size is limited to max. 6MB - this is equivalent to ca. 30000 lightning events. If there are more than 30000 results in storage which comply to the search criteria, they can be retrieved using pagination. In such case the response payload contains [HAL](http://stateless.co/hal_specification.html)-compatible `_link` object which contains links to the next page and the response type is application/hal+json. If locationWithin is worldwide [-180, 90][180, -90] and occurrence ~3 days ### Observed lightning for a given boundingBox and time period This resource provides data from existing lightning observation providers. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, + occurredFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurredUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + provider: `ENGLN,NOWCAST` (string, required) - lightning providers. + startPosition: `60000` (not negative integer, optional) - Is used for pagination. It is recommnded to set it as multiple of 30 000. + Response 200 (application/hal+json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "lightnings":[ { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"NOWCAST", "lightningType":"CLOUD_TO_GROUND", "elevationInKilometers":0, "currentInAmpere":4500, "location":[ 9.6345, 19.3064 ] }, { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"ENGLN", "lightningType":"CLOUD_TO_GROUND", "elevationInKilometers":0, "currentInAmpere":4700, "location":[ 8.6345, 20.3064 ] }, { "provider": "NOWCAST", "occurredAt": "2017-01-05T12:20:14.974Z", "elevationInKilometers": 0, "lightningType": "CLOUD_TO_GROUND", "currentInAmpere": -3500, "location": [ 9.3345, 19.7064 ] } ], "lightningsTotal": 164256, "lightningsInResponse": 30000, "_links": { "self": { "href": "https://lightning.weather.mg/search?provider=ENGLN&startPosition=60000&locationWithin=[-180,90],[180,-90]" }, "next": { "href": "https://lightning.weather.mg/search?provider=ENGLN&startPosition=90000&locationWithin=[-180,90],[180,-90]" } } } # # Weighted Lightning ## Retrieve weighted lightning observation [?temporalResolution={temporalResolution}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}&occurredUntil={endTime}] ## Retrieve weighted lightning observation [?temporalResolution={temporalResolution}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}] #### Example https://lightning.weather.mg/weighted?&temporalResolution=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:19:14Z&occurredUntil=2017-01-05T12:21:15Z https://lightning.weather.mg/weighted?&temporalResolution=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:19:14Z https://lightning.weather.mg/weighted?&temporalResolution=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5] ### Observed weighted lightning for a given boundingBox, time period, weighted by time span and spatial resolution This resource provides data from existing lightning observation providers: NOWCAST and ENGLN. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + temporalResolution: 'PT15M, PT5M, PT1M' in minutes(string required) - time span interval in which lightning should be weighted + spatialResolution '0.5, 0.25, 0.05' degree(string required) - spatial resolution within which lightning should be weighted + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, + occurredFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurredUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + Response 200 (application/json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "weightedLightnings": [{ "occurredFrom": "2017-01-05T12:15:00.000Z", "occurredUntil": "2017-01-05T12:30:00.000Z", "totalCurrentInAmpere": 8000, "weightedLocation": [9.5033, 19.4814], "numberOfLightnings": 2, "temporalResolution": "PT15M", "region": [[9.25, 19.75], [9.75, 19.25]], "weightedOccurrence": "2017-01-05T12:20:47.000Z" }, { "occurredFrom": "2017-01-05T12:15:00.000Z", "occurredUntil": "2017-01-05T12:30:00.000Z", "totalCurrentInAmpere": 4700, "weightedLocation": [8.6345, 20.3064], "numberOfLightnings": 1, "temporalResolution": "PT15M", "region": [[8.25, 20.75], [8.75, 20.25]], "weightedOccurrence": "2017-01-05T12:21:14.000Z" } ] } #
FORMAT: 1A Weather API ============================= # General information This technical document was created for developers who are creating applications based on weather data provided by this API. This document is using [API blueprint format](https://apiblueprint.org/documentation/). ### 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 `lightning`. 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) #### Client Credentials Before getting an access to any endpoints, need to obtain **client id** and **client secret**. For achieving this, please use [request form](https://meteogroup.zendesk.com/hc/en-gb/requests/new?ticket_form_id=64951). #### Authorization Token Once you have your client credentials (Client-ID + Password), you can request a token on [Authorization server](https://auth.weather.mg/oauth/token?grant_type=client_credentials with http basic auth). The token will be in the return message, encrypted with a key from the authorization service. It will contain the client-ID, scopes and expiration date. The token is only a valid for a limited time, after this it will expired and you have to request a new token again. #### Using Authorization Token HTTP GET request to the endpoints needs to provide Authorization Token into **Authorization** HTTP Header. More information about JWT token might be found here: https://en.wikipedia.org/wiki/JSON_Web_Token. HTTP Header: **Authorization** : **Bearer {ENCRYPTED TOKEN HERE}** The Authorization token contains the Scopes which the client is allowed to have. **lightning** is the scope which allows to request Lightning Service. ### Backward compatibility Every endpoint may add one or more response parameters in the future. Clients should ignore unknown parameters, to avoid technical issues. # Group Lightning ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}&occurredUntil={endTime}&startPosition={startPosition}] ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}] #### Example https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:21:14Z&occurredUntil=2017-01-05T12:21:15Z&startPosition=30000 https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:21:14Z https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5] ##### Limitation Due to some technical constraints, the response payload size is limited to max. 6MB - this is equivalent to ca. 30000 lightning events. If there are more than 30000 results in storage which comply to the search criteria, they can be retrieved using pagination. In such case the response payload contains [HAL](http://stateless.co/hal_specification.html)-compatible `_link` object which contains links to the next page and the response type is application/hal+json. If locationWithin is worldwide [-180, 90][180, -90] and occurrence ~3 days ### Observed lightning for a given boundingBox and time period This resource provides data from existing lightning observation providers. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, + occurredFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurredUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + provider: `ENGLN,NOWCAST` (string, required) - lightning providers. + startPosition: `60000` (not negative integer, optional) - Is used for pagination. It is recommnded to set it as multiple of 30 000. + Response 200 (application/hal+json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "lightnings":[ { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"NOWCAST", "lightningType":"CLOUD_TO_GROUND", "elevationInKilometers":0, "currentInAmpere":4500, "location":[ 9.6345, 19.3064 ] }, { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"ENGLN", "lightningType":"CLOUD_TO_GROUND", "elevationInKilometers":0, "currentInAmpere":4700, "location":[ 8.6345, 20.3064 ] }, { "provider": "NOWCAST", "occurredAt": "2017-01-05T12:20:14.974Z", "elevationInKilometers": 0, "lightningType": "CLOUD_TO_GROUND", "currentInAmpere": -3500, "location": [ 9.3345, 19.7064 ] } ], "lightningsTotal": 164256, "lightningsInResponse": 30000, "_links": { "self": { "href": "https://lightning.weather.mg/search?provider=ENGLN&startPosition=60000&locationWithin=[-180,90],[180,-90]" }, "next": { "href": "https://lightning.weather.mg/search?provider=ENGLN&startPosition=90000&locationWithin=[-180,90],[180,-90]" } } } # # Weighted Lightning ## Retrieve weighted lightning observation [?temporalResolution={temporalResolution}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}&occurredUntil={endTime}] ## Retrieve weighted lightning observation [?temporalResolution={temporalResolution}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}] #### Example https://lightning.weather.mg/weighted?&temporalResolution=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:19:14Z&occurredUntil=2017-01-05T12:21:15Z https://lightning.weather.mg/weighted?&temporalResolution=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurredFrom=2017-01-05T12:19:14Z https://lightning.weather.mg/weighted?&temporalResolution=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5] ### Observed weighted lightning for a given boundingBox, time period, weighted by time span and spatial resolution This resource provides data from existing lightning observation providers: NOWCAST and ENGLN. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. -##### Limitation - Due to thenchnical reasons, the maximum allowed response time is 30 seconds and it is possible to process lightning events in a batch of 200 000 lightnings only. + Parameters + temporalResolution: 'PT15M, PT5M, PT1M' in minutes(string required) - time span interval in which lightning should be weighted + spatialResolution '0.5, 0.25, 0.05' degree(string required) - spatial resolution within which lightning should be weighted + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, + occurredFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurredUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + Response 200 (application/json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "weightedLightnings": [{ "occurredFrom": "2017-01-05T12:15:00.000Z", "occurredUntil": "2017-01-05T12:30:00.000Z", "totalCurrentInAmpere": 8000, "weightedLocation": [9.5033, 19.4814], "numberOfLightnings": 2, "temporalResolution": "PT15M", "region": [[9.25, 19.75], [9.75, 19.25]], "weightedOccurrence": "2017-01-05T12:20:47.000Z" }, { "occurredFrom": "2017-01-05T12:15:00.000Z", "occurredUntil": "2017-01-05T12:30:00.000Z", "totalCurrentInAmpere": 4700, "weightedLocation": [8.6345, 20.3064], "numberOfLightnings": 1, "temporalResolution": "PT15M", "region": [[8.25, 20.75], [8.75, 20.25]], "weightedOccurrence": "2017-01-05T12:21:14.000Z" } ] } #
Update LIGHTNING-API-BLUEPRINT.apib
Update LIGHTNING-API-BLUEPRINT.apib Re-phrased sentence about AWS limitation
API Blueprint
apache-2.0
MeteoGroup/weather-api,MeteoGroup/weather-api
1ef97d7ad0e068acdd85533345d187287f611d30
doc/api.apib
doc/api.apib
# Styx Api specification This document is written using [api-blueprint] ## usage 1. install [dredd]: `npm install -g dredd` 1. package project: `mvn package` 1. run tests: `styx-api-service/bin/api-test.sh` To generate an html version of this spec, use [aglio] ``` aglio -i doc/api.apib -o api.html --theme-template triple --theme-variables streak ``` [api-blueprint]: https://apiblueprint.org/ [dredd]: https://github.com/apiaryio/dredd [aglio]: https://github.com/danielgtaylor/aglio # Group Workflows ## Workflow [/v1/workflows/{component}/{workflow_id}] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID ### Get Workflow [GET] + Response 200 (application/json) { "component_id": "styx-canary", "workflow_id": "LuigiCanary", "component_uri": "file:///etc/styx/schedule.yaml", "schedule": { "schedule": "hourly", "docker_args": [ "luigi", "--module", "canary_job", "CanaryJob", "--local-scheduler" ] } } ## Workflow Instances [/v1/workflows/{component}/{workflow_id}/instances] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID ### Get Workflow Instances [GET] + Response 200 (application/json) [{ "workflow_instance": { "workflow": { "component_id": "styx-canary", "workflow_id": "LuigiCanary" }, "parameter": "2016-07-13T08" }, "triggers": [{ "trigger_id": "UNKNOWN", "timestamp": "2016-07-13T09:00:23.941Z", "complete": true, "executions": [{ "execution_id": "styx-run-qcp3r", "docker_image": "UNKNOWN", "statuses": [ { "timestamp": "2016-07-13T09:00:45.882Z", "status": "SUBMITTED" }, { "timestamp": "2016-07-13T09:00:49.076Z", "status": "STARTED" }, { "timestamp": "2016-07-13T09:00:49.313Z", "status": "SUCCESS" } ] }] }] }] ## Workflow Instance [/v1/workflows/{component}/{workflow_id}/instances/{instance}] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID + instance: `2016-07-13T08` (string) - Worfklow Instance parameter ### Get Workflow Instance [GET] + Response 200 (application/json) { "workflow_instance": { "workflow": { "component_id": "styx-canary", "workflow_id": "LuigiCanary" }, "parameter": "2016-07-13T08" }, "triggers": [{ "trigger_id": "UNKNOWN", "timestamp": "2016-07-13T09:00:23.941Z", "complete": true, "executions": [{ "execution_id": "styx-run-qcp3r", "docker_image": "UNKNOWN", "statuses": [ { "timestamp": "2016-07-13T09:00:45.882Z", "status": "SUBMITTED" }, { "timestamp": "2016-07-13T09:00:49.076Z", "status": "STARTED" }, { "timestamp": "2016-07-13T09:00:49.313Z", "status": "SUCCESS" } ] }] }] } ## Workflow state [/v1/workflows/{component}/{workflow_id}/state] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID ### Get Workflow state [GET] + Response 200 (application/json) { "enabled": "true", "docker_image": "busybox:latest" } ### Set Workflow state [PATCH] + Request (application/json) { "enabled": "false", "docker_image": "busybox:latest" } + Response 200 (application/json) { "enabled": "false", "docker_image": "busybox:latest" } ## Component state [/v1/workflows/{component}/state] + Parameters + component: `styx-canary` (string) - Workflow Component ### Set Component state [PATCH] + Request (application/json) { "docker_image": "busybox:latest" } + Response 200 (application/json) { "docker_image": "busybox:latest" }
# Styx Api specification This document is written using [api-blueprint] ## Usage 1. install [dredd]: `npm install -g dredd` 1. package project: `mvn package` 1. run tests: `styx-api-service/bin/api-test.sh` To generate an html version of this spec, use [aglio] ``` aglio -i doc/api.apib -o api.html --theme-template triple --theme-variables streak ``` [api-blueprint]: https://apiblueprint.org/ [dredd]: https://github.com/apiaryio/dredd [aglio]: https://github.com/danielgtaylor/aglio # Group Workflows ## Workflow [/v2/workflows/{component}/{workflow_id}] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID ### Get Workflow [GET] + Response 200 (application/json) { "component_id": "styx-canary", "workflow_id": "LuigiCanary", "component_uri": "file:///etc/styx/schedule.yaml", "schedule": { "schedule": "hours", "docker_args": [ "luigi", "--module", "canary_job", "CanaryJob", "--local-scheduler" ] }, "docker_termination_logging": false, "secret": null, "resources": [ ] } ## Workflow Instances [/v2/workflows/{component}/{workflow_id}/instances] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID ### Get Workflow Instances [GET] + Response 200 (application/json) [{ "workflow_instance": { "workflow": { "component_id": "styx-canary", "workflow_id": "LuigiCanary" }, "parameter": "2016-07-13T08" }, "triggers": [{ "trigger_id": "UNKNOWN", "timestamp": "2016-07-13T09:00:23.941Z", "complete": true, "executions": [{ "execution_id": "styx-run-qcp3r", "docker_image": "UNKNOWN", "statuses": [ { "timestamp": "2016-07-13T09:00:45.882Z", "status": "SUBMITTED" }, { "timestamp": "2016-07-13T09:00:49.076Z", "status": "STARTED" }, { "timestamp": "2016-07-13T09:00:49.313Z", "status": "SUCCESS" } ] }] }] }] ## Workflow Instance [/v2/workflows/{component}/{workflow_id}/instances/{instance}] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID + instance: `2016-07-13T08` (string) - Worfklow Instance parameter ### Get Workflow Instance [GET] + Response 200 (application/json) { "workflow_instance": { "workflow": { "component_id": "styx-canary", "workflow_id": "LuigiCanary" }, "parameter": "2016-07-13T08" }, "triggers": [{ "trigger_id": "UNKNOWN", "timestamp": "2016-07-13T09:00:23.941Z", "complete": true, "executions": [{ "execution_id": "styx-run-qcp3r", "docker_image": "UNKNOWN", "statuses": [ { "timestamp": "2016-07-13T09:00:45.882Z", "status": "SUBMITTED" }, { "timestamp": "2016-07-13T09:00:49.076Z", "status": "STARTED" }, { "timestamp": "2016-07-13T09:00:49.313Z", "status": "SUCCESS" } ] }] }] } ## Workflow state [/v2/workflows/{component}/{workflow_id}/state] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID ### Get Workflow state [GET] + Response 200 (application/json) { "enabled": "true", "docker_image": "luigi-canary-dummy:dummy", "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", "next_natural_trigger": "2017-01-01T01:00:00Z" } ### Set Workflow state [PATCH] + Request (application/json) { "enabled": "false", "docker_image": "luigi-canary-dummy:dummy", "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", "next_natural_trigger": "2017-01-01T01:00:00Z" } + Response 200 (application/json) { "enabled": "false", "docker_image": "luigi-canary-dummy:dummy", "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", "next_natural_trigger": "2017-01-01T01:00:00Z" } ## Component state [/v2/workflows/{component}/state] + Parameters + component: `styx-canary` (string) - Workflow Component ### Set Component state [PATCH] + Request (application/json) { "docker_image": "luigi-canary-dummy:dummy", "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", } + Response 200 (application/json) { "enabled": null , "docker_image": "luigi-canary-dummy:dummy", "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", "next_natural_trigger": null } # Group Resources ## Resources [/v2/resources] ### Get Resources [GET] + Response 200 (application/json) { "resources": [{ "concurrency": 20, "id": "luigi-canary-resource" }] } ### Create Resource [POST] + Request (application/json) { "concurrency": "20", "id": "luigi-canary-resource" } + Response 200 (application/json) { "concurrency": 20, "id": "luigi-canary-resource" } ## Resource [/v2/resources/{resource}] + Parameters + resource: `luigi-canary-resource` (string) - Resource ID ### Get Resource [GET] + Response 200 (application/json) { "resources": [{ "concurrency": 20, "id": "luigi-canary-resource" }] } ### Delete Resource [DELETE] + Response 204 ### Modify Resource [PUT] + Request (application/json) { "concurrency": "30", "id": "luigi-canary-resource" } + Response 200 (application/json) { "concurrency": 30, "id": "luigi-canary-resource" } # Group Backfills ## Backfills [/v2/backfills{?component,workflow,status,showAll}] ### Get Backfills [GET] + Parameters + component: `styx-canary` (optional, string) - Workflow Component to filter with + workflow: `LuigiCanary` (optional, string) - Workflow ID to filter with + status: `true` (optional, boolean) - If to return the status list per backfill + Default: false + showAll: `true` (optional, boolean) - If to return also halted backfills and backfills whose instances have been all triggered + Default: false + Response 200 (application/json) { "backfills": [{ "backfill": { "all_triggered": true, "concurrency": 10, "end": "2017-01-01T01:00:00Z", "halted": false, "id": "backfill-1489054446085-53384", "next_trigger": "2017-01-01T01:00:00Z", "schedule": "hours", "start": "2017-01-01T00:00:00Z", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } }, "statuses": { "active_states": [{ "state": "DONE", "workflow_instance": { "parameter": "2017-01-01T00", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } }, "state_data": { "consecutive_failures": 0, "execution_description": { "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", "docker_args": [ "luigi", "--module", "canary_job", "CanaryJob", "--local-scheduler" ], "docker_image": "luigi-canary-dummy:dummy", "docker_termination_logging": false, "secret": null }, "execution_id": "styx-run-6b1962c6-23ba-4245-a13b-ec3baa4b2133", "last_exit": 0, "messages": [ { "level": "INFO", "line": "Exit code: 0" } ], "retry_cost": 0.0, "retry_delay_millis": null, "tries": 1, "trigger": { "@type": "backfill", "trigger_id": "backfill-1489054446085-53384" }, "trigger_id": "backfill-1489054446085-53384" } }] } }] } ### Create Backfill [POST] + Request (application/json) { "start": "2017-01-01T00:00:00Z", "end": "2017-01-02T00:00:00Z", "component": "styx-canary", "workflow": "LuigiCanary", "concurrency": "10", } + Response 200 (application/json) { "all_triggered": false, "concurrency": 10, "end": "2017-02-00T00:00:00Z", "halted": false, "id": "backfill-1489054446085-52684", "next_trigger": "2017-01-01T00:00:00Z", "schedule": "hours", "start": "2017-01-01T00:00:00Z", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } } ## Backfill [/v2/backfills/{backfill_id}] + Parameters + backfill_id: `backfill-1489054446085-52684` (string) - Backfill ID ### Modify Backfill [PUT] + Request (application/json) { "all_triggered": false, "concurrency": 20, "end": "2017-02-00T00:00:00Z", "halted": false, "id": "backfill-1489054446085-52684", "next_trigger": "2017-01-01T00:00:00Z", "schedule": "hours", "start": "2017-01-01T00:00:00Z", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } } + Response 200 (application/json) { "all_triggered": false, "concurrency": 20, "end": "2017-02-00T00:00:00Z", "halted": false, "id": "backfill-1489054446085-52684", "next_trigger": "2017-01-01T00:00:00Z", "schedule": "hours", "start": "2017-01-01T00:00:00Z", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } } ### Delete Backfill [DELETE] + Response 200 # Group Status ## Active States [/v2/status/activeStates] ### Get Active States [GET] + Response 200 (application/json) { "active_states": [{ "state": "RUNNING", "workflow_instance": { "parameter": "2017-01-01T01", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } }, "state_data": { "consecutive_failures": 0, "execution_description": { "commit_sha": "f043333085fa87738ac24f04d64fb58ecc845111", "docker_args": [ "luigi", "--module", "canary_job", "CanaryJob", "--local-scheduler" ], "docker_image": "luigi-canary-dummy:dummy", "docker_termination_logging": false, "secret": null }, "execution_id": "styx-run-6b1962c6-23ba-4245-a13b-ec3baa4b21d5", "last_exit": 20, "messages": [ { "level": "WARNING", "line": "Exit code: 20" } ], "retry_cost": 0.2, "retry_delay_millis": 600000, "tries": 2, "trigger": { "@type": "natural" }, "trigger_id": "natural-trigger" } }] } ## Events [/v2/status/events/{component}/{workflow_id}/{instance}] + Parameters + component: `styx-canary` (string) - Workflow Component + workflow_id: `LuigiCanary` (string) - Workflow ID + instance: `2017-01-01T01` (string) - Worfklow Instance parameter ### Get Workflow Instance events [GET] + Response 200 (application/json) { "events": [{ "event": { "@type": "triggerExecution", "trigger": { "@type": "natural" }, "workflow_instance": "styx-canary/LuigiCanary/2017-01-01T01" }, "timestamp": 1483228800000 }, { "event": { "@type": "dequeue", "workflow_instance": "styx-canary/LuigiCanary/2017-01-01T01" }, "timestamp": 1483228800005 }] } # Group Scheduler ## Events [/v2/scheduler/events] ### Inject Event [POST] + Request (application/json) { "@type": "dequeue", "workflow_instance": "styx-canary/LuigiCanary/2017-01-01T01" } + Response 200 (application/json) { "@type": "dequeue", "workflow_instance": "styx-canary/LuigiCanary/2017-01-01T01" } ## Trigger [/v2/scheduler/trigger] ### Trigger Workflow Instance [POST] + Request (application/json) { "parameter": "2017-01-01T01", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } } + Response 200 (application/json) { "parameter": "2017-01-01T01", "workflow_id": { "component_id": "styx-canary", "id": "LuigiCanary" } } # Group Global Config ## Global Enabled [/v2/config{?enabled}] ### Get Global Enabled [GET] + Response 200 (application/json) { "enabled": "true" } ### Set Global Enabled [POST] + Parameters + enabled: `true` (required, boolean) - Global enabled value + Response 200 (application/json) { "enabled": "true" }
Update API blueprints
Update API blueprints
API Blueprint
apache-2.0
spotify/styx,spotify/styx,spotify/styx
387188d40d82ec8286fa2958229b11aaf043a9a3
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 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), and device is even not able to be autoprovisioned. The default is `true`. This field is optional, so if it omitted then the global IoTAgent appendModel configuration is used.| 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. - `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
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
ba935d799743b1a85220e71cb3f59904dc2612c5
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 # 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] + Request + Attributes + 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/{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) 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] + Attributes + 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/{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) image successfully removed
fix API
fix API
API Blueprint
mit
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
3b5ebfdba68881a606c5db2f403a8489992a85c9
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # Extremo Extremo is an API for fetching research related content (notes, commentaries, essays, etc) produced by a researcher probably in the humanities. # Extremo API Root [/] This resource does not have any attributes. Instead it offers the initial API affordances. ## Retrieve the Entry Point [GET] + Response 200 (application/hal+json) { "_links": { "questions": { "href": "/notes" } } } ## Notes collection [/notes{?page}] + Parameters + page (optional, number, `1`) ... The page of questions to return ### List All Notes [GET] + Response 200 (application/hal+json) { "_links": { "self": { "href": "/notes" }, "next": { "href": "/notes?page=2" } }, "_embedded": { "notes": [ { name: 'test.md', sha: '559430b6bc52ab25846c528fbff56032162e2216', rawsize: 95, blob: '### This is a note\n\nIt doesn\'t have much in it yet. \nNow it has a bit more.\nAnd now even more.\n', updated_at: 2016-12-05T16:04:25.000Z, created_at: 2016-12-03T14:21:27.000Z, history: [ { sha: '69c7df3ed6a50359d0c19df97b8c8ebe21dd2399', date: 2016-12-05T16:04:25.000Z }, { sha: '188c1161743983a0199760385a55c6a7450dc6ba', date: 2016-12-04T17:43:45.000Z }, { sha: 'd909ade91aae7970a34ba91e800493f9bac7d473', date: 2016-12-03T14:21:27.000Z } ] }, { name: 'test2.md', sha: '72fa01795e79e8c64bd1719cb2dcebd7f88a5082', rawsize: 53, blob: '### This is a note\n\nIt doesn\'t have much in it yet. \n', updated_at: 2016-12-03T19:02:46.000Z, created_at: 2016-12-03T19:02:46.000Z, history: [ { sha: '01113285f7f7f36394473f6820cd6ce6fd28dd13', date: 2016-12-03T19:02:46.000Z } ] } ] } }
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # Extremo Extremo is an API for fetching research related content (notes, commentaries, essays, etc) produced by a researcher probably in the humanities. # Extremo API Root [/] This resource does not have any attributes. Instead it offers the initial API affordances. ## Retrieve the Entry Point [GET] + Response 200 (application/hal+json) { "_links": { "questions": { "href": "/notes" } } } ## Notes collection [/notes{?page}] + Parameters + page (optional, number, `1`) ... The page of questions to return ### List All Notes [GET] + Response 200 (application/hal+json) { "_links": { "self": { "href": "/notes" }, "next": { "href": "/notes?page=2" } }, "_embedded": { "notes": [ { "_links": { "self": '/note/559430b6bc52ab25846c528fbff56032162e2216' } "name": 'test.md', "sha": '559430b6bc52ab25846c528fbff56032162e2216', "rawsize": 95, "blob": '### This is a note\n\nIt doesn\'t have much in it yet. \nNow it has a bit more.\nAnd now even more.\n', "updated_at": 2016-12-05T16:04:25.000Z, "created_at": 2016-12-03T14:21:27.000Z, "history": [ { "sha": '69c7df3ed6a50359d0c19df97b8c8ebe21dd2399', "date": 2016-12-05T16:04:25.000Z }, { "sha": '188c1161743983a0199760385a55c6a7450dc6ba', "date": 2016-12-04T17:43:45.000Z }, { "sha": 'd909ade91aae7970a34ba91e800493f9bac7d473', "date": 2016-12-03T14:21:27.000Z } ] }, { "_links": { "self": '/note/72fa01795e79e8c64bd1719cb2dcebd7f88a5082' } "name": 'test2.md', "sha": '72fa01795e79e8c64bd1719cb2dcebd7f88a5082', "rawsize": 53, "blob": '### This is a note\n\nIt doesn\'t have much in it yet. \n', "updated_at": 2016-12-03T19:02:46.000Z, "created_at": 2016-12-03T19:02:46.000Z, "history": [ { "sha": '01113285f7f7f36394473f6820cd6ce6fd28dd13', "date": 2016-12-03T19:02:46.000Z } ] } ] } }
Add _links to individual notes in notes response
Add _links to individual notes in notes response
API Blueprint
epl-1.0
ezmiller/extremo
e4ccbcec01b5e46900b5b7efa63214ffcbca865d
api.apib
api.apib
# Pathwar API Official Pathwar REST Api ## Authentication To be defined ## Media Types Where applicable this API uses the [HAL+JSON](https://github.com/mikekelly/hal_specification/blob/master/hal_specification.md) media-type to represent resources states and affordances. Requests with a message-body are using plain JSON to set or update resource states. ## Error States The common [HTTP Response Status Codes](https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md) are used. # Group People This section describes about the People ## Person [/people/{id}] This resource represents one particular person identified by its *id*. + Model (application/json) { "name": "m1ch3l", "birthdate": "04-02-1942", "organization_id": "xxxx-xxxxxx-xxxxxx-xxxx" } ### Retrieve Person [GET] Return the information for the Person + Request (application/json) + Response 200 (application/json) [Person][] ## Organization [/organization/{id}] This resource represents one particular organization identified by its *id*. + Model (application/json) { "name": "ulteam", "members": [ "xxxx-xxxxxx-xxxxxx-xxxx", "xxxx-xxxxxx-xxxxxx-xxxx", ] } ### Retrieve Organization [GET] Return the information for the Organization + Request (application/json) + Response 200 (application/json) [Organization][] # Group Level This section describes about the Level ## Level [/level/{id}] This resource represents one particular level identified by its *id*. + Model (application/json) { "name": "pwnland", "description": "pwnland is cool", "author": "Pathwar Team (@pathwar_net)" } ### Retrieve Level [GET] Return the information for the Level + Request (application/json) + Response 200 (application/json) [Level][]
# Pathwar API Official Pathwar REST Api ## Authentication To be defined ## Media Types This API uses the json media-type to represent resources states and affordances. Requests with a message-body are using plain JSON to set or update resource states. ## Error States The common [HTTP Response Status Codes](https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md) are used. # Group People This section describes about the People ## Person [/people/{id}] This resource represents one particular person identified by its *id*. + Model (application/json) { "name": "m1ch3l", "birthdate": "04-02-1942", "organization_id": "xxxx-xxxxxx-xxxxxx-xxxx" } ### Retrieve Person [GET] Return the information for the Person + Request (application/json) + Response 200 (application/json) [Person][] ## Organization [/organization/{id}] This resource represents one particular organization identified by its *id*. + Model (application/json) { "name": "ulteam", "members": [ "xxxx-xxxxxx-xxxxxx-xxxx", "xxxx-xxxxxx-xxxxxx-xxxx", ] } ### Retrieve Organization [GET] Return the information for the Organization + Request (application/json) + Response 200 (application/json) [Organization][] # Group Level This section describes about the Level ## Level [/level/{id}] This resource represents one particular level identified by its *id*. + Model (application/json) { "name": "pwnland", "description": "pwnland is cool", "author": "Pathwar Team (@pathwar_net)" } ### Retrieve Level [GET] Return the information for the Level + Request (application/json) + Response 200 (application/json) [Level][]
Switch to standard json media type (#1)
Switch to standard json media type (#1)
API Blueprint
mit
pathwar/api.pathwar.net
9a8b44c840ef398b964401dfdbdcb77e3d98d657
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 using a username and password ### Create a new account [POST] + 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 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] 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) + 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 bucketlist details 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, to get items only just pass the *bucketlist_id* parameter and leave the *item_id* parameter blank + 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 bucketlist items, to get items only just pass the *bucketlist_id* parameter and leave the *item_id* parameter blank + 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 + 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 using a username and password. ### Create a new account [POST] + 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" }
Fix grammatical errors in apiary documentation
[FIX] Fix grammatical errors in apiary documentation
API Blueprint
mit
brayoh/bucket-list-api
5292800083cc997e72fb03e7d4afcf806ac27982
blueprint/authentication.apib
blueprint/authentication.apib
FORMAT: 1A HOST: https://thegrid.io/ # Authentication The Grid operates an OAuth2 provider that is utilized for all authentication purposes. ### Identity Providers The Grid's authentication system supports multiple identity providers including: * GitHub (github) * Twitter (twitter) More identity providers are likely to be added later when they are needed. Check back to this document to see the current list. ### Registering an application The Grid authentication is always granted to the combination of a user and an application. To register an application, log into your The Grid account at https://passport.thegrid.io/account Go to the Developer Section of your profile page, and you'll be able to add new OAuth2 client applications. You need the following information: * Application name: name of the application shown to users in the confirmation page * Callback URL: the URL in your application users should be redirected to once they complete their login Once you have registered an application you will get two values from the system: * Application ID: Unique identifier for your application * Application secret: Passphrase your application can use to convert authentication grants to tokens **Note:** never let others see your client secret. Otherwise they will be able to impersonate your The Grid application! ### The OAuth dance When you want to authenticate a user with your The Grid application, you need to first send them to The Grid's login system. For this you need to construct a login URL with the following parts: * Protocol: https * Host: passport.thegrid.io * Path: `/login/authorize/<identity provider (optional, otherwise will show UI to choose provider)>` * Query: * `client_id`: the unique identifier of your application * `response_type`: code * `redirect_url`: your callback URL Example: <https://passport.thegrid.io/login/authorize/github?client_id=XXXX&response_type=code&redirect_uri=http://my.app.url> #### Authentication scopes The default authentication scope will grant you permissions to perform simple operations on behalf of the user. If needed, you can also request additional access to The Grid APIs via OAuth2 scopes. The scopes are added to the authentication request URL with the scope query key. The currently supported scopes include: * `content_management`: manage user's content items on The Grid * `website_management`: manage user's The Grid sites and publish to them * `share`: share new content to The Grid * `update_profile`: update the user's profile information * `github`: get access to the user's GitHub access token, if any. This will allow you to use the GitHub API on behalf of the user * `github_private`: get access to the user's GitHub access token authorized to access private repositories, if any. This will allow you to use the GitHub API on behalf of the user * `payment`: make a payment on behalf of the user * `balance`: see user's account balance and transaction history * `cta_management`: manage user's Calls to Action #### Getting a token Once the user completes the authentication process and grants your application access to their account, they will be redirected to the redirect_url. The redirection will contain an additional query parameter code which contains a one-time access grant. To convert this access grant to an access token you have to make a HTTP POST request with the following URL: * Protocol: https * Host: passport.thegrid.io * Path: /login/authorize/token The payload should be a URL-encoded string containing the following key-value pairs: * `client_id`: the unique identifier of your application * `client_secret`: your application's passphrase * `code`: the access grant you received in the query parameter of your callback URL * `grant_type`: `authorization_code` On a successful code conversion you will receive a JSON-encoded response with an object that will contain the user's access token in the `access_token` key. ### Making authenticated API requests The Grid API calls require authentication unless stated otherwise. This is done using the user's access token via HTTP Bearer Authentication. Bearer authentication works by adding the Authorization header to your HTTP requests with the value `Bearer <access token>`. For example: ``` req.setRequestHeader('Authorization', 'Bearer ' + token); ```
FORMAT: 1A HOST: https://thegrid.io/ # Authentication The Grid operates an OAuth2 provider that is utilized for all authentication purposes. ### Identity Providers The Grid's authentication system supports multiple identity providers including: * GitHub (github) * Twitter (twitter) More identity providers are likely to be added later when they are needed. Check back to this document to see the current list. ### Registering an application The Grid authentication is always granted to the combination of a user and an application. To register an application, log into your The Grid account at https://passport.thegrid.io/account Go to the Developer Section of your profile page, and you'll be able to add new OAuth2 client applications. You need the following information: * Application name: name of the application shown to users in the confirmation page * Callback URL: the URL in your application users should be redirected to once they complete their login Once you have registered an application you will get two values from the system: * Application ID: Unique identifier for your application * Application secret: Passphrase your application can use to convert authentication grants to tokens **Note:** never let others see your client secret. Otherwise they will be able to impersonate your The Grid application! ### The OAuth dance When you want to authenticate a user with your The Grid application, you need to first send them to The Grid's login system. For this you need to construct a login URL with the following parts: * Protocol: https * Host: passport.thegrid.io * Path: `/login/authorize/<identity provider (optional, otherwise will show UI to choose provider)>` * Query: * `client_id`: the unique identifier of your application * `response_type`: code * `scope`: comma-separated list of requested scopes * `redirect_url`: your callback URL Example: <https://passport.thegrid.io/login/authorize/github?client_id=XXXX&response_type=code&scope=share&redirect_uri=http://my.app.url> #### Authentication scopes The default authentication scope will grant you permissions to perform simple operations on behalf of the user. If needed, you can also request additional access to The Grid APIs via OAuth2 scopes. The scopes are added to the authentication request URL with the scope query key. The currently supported scopes include: * `content_management`: manage user's content items on The Grid * `website_management`: manage user's The Grid sites and publish to them * `share`: share new content to The Grid * `update_profile`: update the user's profile information * `github`: get access to the user's GitHub access token, if any. This will allow you to use the GitHub API on behalf of the user * `github_private`: get access to the user's GitHub access token authorized to access private repositories, if any. This will allow you to use the GitHub API on behalf of the user * `payment`: make a payment on behalf of the user * `balance`: see user's account balance and transaction history * `cta_management`: manage user's Calls to Action #### Getting a token Once the user completes the authentication process and grants your application access to their account, they will be redirected to the redirect_url. The redirection will contain an additional query parameter code which contains a one-time access grant. To convert this access grant to an access token you have to make a HTTP POST request with the following URL: * Protocol: https * Host: passport.thegrid.io * Path: /login/authorize/token The payload should be a URL-encoded string containing the following key-value pairs: * `client_id`: the unique identifier of your application * `client_secret`: your application's passphrase * `code`: the access grant you received in the query parameter of your callback URL * `grant_type`: `authorization_code` On a successful code conversion you will receive a JSON-encoded response with an object that will contain the user's access token in the `access_token` key. ### Making authenticated API requests The Grid API calls require authentication unless stated otherwise. This is done using the user's access token via HTTP Bearer Authentication. Bearer authentication works by adding the Authorization header to your HTTP requests with the value `Bearer <access token>`. For example: ``` req.setRequestHeader('Authorization', 'Bearer ' + token); ```
Add scope to example URL
Add scope to example URL
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
eef4ffa4f40d4291c41382101112c2b404a1662e
apiary.apib
apiary.apib
FORMAT: 1A HOST: https://bath-climate.herokuapp.com/bathclimate # bathclimate bathclimate is a simple API allowing consumers to change bath climate. ## Test [/bathclimate] ### Test Request [GET] + Response 200 (application/json) { "test": "bathclimate" }
FORMAT: 1A HOST: https://bath-climate.herokuapp.com/bathclimate # bathclimate bathclimate is a simple API allowing consumers to change bath climate. ## Test [/] ### Test Request [GET] + Response 200 (application/json) { "test": "bathclimate" }
change test API
change test API
API Blueprint
mit
Rshalika/iot-bath-climate,Rshalika/iot-bath-climate,Rshalika/iot-bath-climate
f6be9ffc1cf1d25e35d6759a29e2f49d739a77a1
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 ### 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.
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" } ### Delete a pass [DELETE /passes/{id}] Deletes a pass. + Request + Header Authorization: Bearer JWT + Response 202 ### 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 an endpoint to delete passes
Update API doc with an endpoint to delete passes This is a step towards fixing #5.
API Blueprint
mit
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
cceb4f5f04d4482c19a6788fcafae28f319033f7
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://api.afraidTO.do # Afraid TODO API An API for tasks/todos # Group Tasks Tasks ## Task Collection [/tasks] ### List all Tasks [GET] + Request (application/json) + Headers X-Token: TokenID + Body {} + Response 200 (application/json) { "tasks": [{ "id": 1, "text": "Hold a venomous snake by its tail", "created_at": "1408289000", "updated_at": "1408289000", "done": "false", "href": "https://api.afraidTO.do/tasks/1" }, { "id": 2, "text": "dance in public", "created_at": "1408289000", "updated_at": "1408289000", "done": "false", "href": "https://api.afraidTO.do/tasks/2" }] } ### Create a Task [POST] + Request (application/json) + Headers X-Token: TokenID + Body { "tasks": [{ "text": "rappel down a waterfall" }] } + Response 201 (application/json) { "tasks": [{ "id": 3, "text": "rappel down a waterfall", "created_at": "*", "updated_at": "*", "href": "https://api.afraidTO.do/tasks/1" }, } ## Task [/tasks/{id}] A single Task object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Task to perform action with. Has example value. ### Retrieve a Task [GET] + Response 200 (application/json) + Body { "tasks": [ { "id": 1, "done": "false", "text": "Hold a venomous snake by its tail", "created_at": "1408289000", "updated_at": "1408289000", "href": "https://api.afraidTO.do/tasks/1" }, ] } ### Update a Task [PUT] + Request (application/json) + Headers X-Token: TokenID + Body { "tasks": [ { "done": "true" }}] } + Response 200 (application/json) + Body { "tasks": [ { "id": 1, "done": "true", "text": "Hold a venomous snake by its tail", "created_at": "1408289000", "updated_at": "1408289000", "href": "https://api.afraidTO.do/tasks/1" }, ] } ### Remove a Task [DELETE] + Response 204 # Group Authentication ## Users Collection [/users] ### Create a User [POST] + Request (application/json) + Body { "users": [{ "password": "", "email": "[email protected]", "name": "Bob of Wug", "username": "bobofwug" }] } + Response 201 (application/json) + Body { "links": { "users.tokens": { "href": "https://api.afraidTo.do/authentication/tokens", "type": "tokens" } }, "users": [{ "uid": "uidd", "provider": "basic", "email": "bob", "username": "b", "name": "Bob of Wug", "avatar": "", "links": { "tokens": [""] } }], "linked": { "tokens": [ {} ] } } ## User [/users/{id}] A single User object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the User to perform action with. Has example value. ### Retrieve a User [GET] + Request (application/json) + Headers X-Token: TokenID + Response 200 (application/json) + Body { "users": [{ "uid": "uidd", "provider": "basic", "email": "bob", "username": "bob", "name": "Bob of Wug", "avatar": "", "links": { "tokens": [""] } }] } ### Update a User [PUT] + Request (application/json) + Headers X-Token: TokenID + Body { "users": [ "name": "Bob" }] } + Response 200 (application/json) + Body { "users": [{ "uid": "uidd", "provider": "basic", "email": "bob", "username": "b", "name": "Bob", "avatar": "", "links": { "tokens": [""] } }], } ### Remove a User [DELETE] + Response 204 ## Access Tokens [/authorization/tokens] ### List all Tokens [GET] + Request (application/json) + Headers X-Token: TokenID + Body {} + Response 200 (application/json) + Body { "tokens": [ { "access_token": "", "expires_at": "", "active": "true", "application": "" } ] } ### Create an Access Token [POST] + Request (application/json) + Headers X-Token: TokenID + Body {} + Response 201 (application/json) + Body { "tokens": [ { "access_token": "", "expires_at": "", "active": "true", "application": "" } ] }
FORMAT: 1A HOST: http://api.afraidTO.do # Afraid TODO API An API for tasks/todos # Group Tasks Tasks ## Task Collection [/tasks] ### List all Tasks [GET] + Request (application/json) + Headers X-Token: TestKey + Body {} + Response 200 (application/json) { "tasks": [{ "id": 1, "text": "Hold a venomous snake by its tail", "created_at": "1408289000", "updated_at": "1408289000", "done": "false", "href": "https://api.afraidTO.do/tasks/1" }, { "id": 2, "text": "dance in public", "created_at": "1408289000", "updated_at": "1408289000", "done": "false", "href": "https://api.afraidTO.do/tasks/2" }] } ### Create a Task [POST] + Request (application/json) + Headers X-Token: TestKey + Body { "tasks": [{ "text": "rappel down a waterfall" }] } + Response 201 (application/json) { "tasks": [{ "id": "*", "text": "rappel down a waterfall", "created_at": "*", "updated_at": "*", "done": "false", "href": "https://api.afraidTO.do/tasks/3" }] } ## Task [/tasks/{id}] A single Task object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Task to perform action with. Has example value. ### Retrieve a Task [GET] + Request (application/json) + Headers X-Token: TestKey + Response 200 (application/json) { "tasks": [ { "id": 1, "done": "false", "text": "Hold a venomous snake by its tail", "created_at": "1408289000", "updated_at": "1408289000", "href": "https://api.afraidTO.do/tasks/1" } ] } ### Update a Task [PUT] + Request (application/json) + Headers X-Token: TokenID + Body { "tasks": [{ "done": "true" }] } + Response 200 (application/json) + Body { "tasks": [ { "id": 1, "done": "true", "text": "Hold a venomous snake by its tail", "created_at": "1408289000", "updated_at": "1408289000", "href": "https://api.afraidTO.do/tasks/1" } ] } ### Remove a Task [DELETE] + Response 204 # Group Authentication ## Sessions [/auth/sessions] ### Create a session [POST] Creates a session + Request (application/json) + Response 201 (application/json) + Body { "users": [ { "links": { "self": { "href": "https://api.afraidTO.do/users/541ce18edf465e054b000001" }, "tokens": [ "541ce18edf465e054b000002", "541ce18edf465e054b000003" ] }, "name": "bob", "email": "[email protected]" } ], "linked": { "tokens": [ { "href": "https://api.afraidTO.do/token/541ce18edf465e054b000002", "id": "541ce18edf465e054b000002", "access_token": "4845d193e3dc9914ed306db62d055bc8", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:08:14.199Z", "updated_at": "2014-09-20T02:08:14.199Z" }, { "href": "https://api.afraidTO.do/token/541ce18edf465e054b000003", "id": "541ce18edf465e054b000003", "access_token": "TestKey", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:08:14.201Z", "updated_at": "2014-09-20T02:08:14.201Z" } ] } } ## Twitter Access Token [/auth/twitter_access_token/callback?{?token,token_secret,access_token}] A twitter authentication endpoint. Only utilized internally. + Parameters + token (required, string, `qwerty`) ... OAuth Token + token_secret (required, string, `qwerty`) ... OAuth Token Secret + access_token (required, string, `qwerty`) ... OAuth Access Token ### Create a user or authorize via twitter [POST] + Request (application/json) + Body + Response 201 (application/json) + Body { "links": { "users.tokens": { "href": "https://api.afraidTo.do/authentication/tokens", "type": "tokens" } }, "users": [{ "uid": "uidd", "email": "bob", "username": "b", "name": "Bob of Wug", "avatar": "", "links": { "tokens": [""] } }], "linked": { "tokens": [ {} ] } } ## OAuthIO endpoint [/auth/oauthio/{provider}/callback{?code,state}] An OAuth.io authentication point + Parameters + provider (required, string, `github`) ... The OAuth.io Provider to use. Obviously must have been enabled on OAuth.io + code (required, string, `qwerty`) ... OAuth.io Token Code + state (require, string, `qwerty`) ... OAuth.io State string ### Create or authorize a user via OAuthIO [POST] + Request (application/json) + Body + Response 201 (application/json) + Body { "links": { "users.tokens": { "href": "https://api.afraidTo.do/authentication/tokens", "type": "tokens" } }, "users": [{ "uid": "uidd", "provider": "basic", "email": "bob", "username": "b", "name": "Bob of Wug", "avatar": "", "links": { "tokens": [""] } }], "linked": { "tokens": [ {} ] } } ## Users Collection [/users] ### Create a User [POST] + Request (application/json) + Body { "users": [{ "password": "lengthypassword", "email": "[email protected]", "name": "Bob of Wug", "username": "bobofwug" }] } + Response 201 (application/json) + Body { "users": [ { "links": { "self": { "href": "https://api.afraidTO.do/users/541ceb1edf465e1b95000002" }, "tokens": [ "541ceb1edf465e1b95000003" ] }, "name": "Bob of Wug", "email": "[email protected]", "avatar": "http://www.gravatar.com/avatar/bd0261dd040c14db68c8e8b9ce1dbb23?s=4" } ], "linked": { "tokens": [ { "href": "https://api.afraidTO.do/token/541ceb1edf465e1b95000003", "id": "541ceb1edf465e1b95000003", "access_token": "53b345503e5e1bccf7d0d8d15480a2f1", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:49:02.430Z", "updated_at": "2014-09-20T02:49:02.430Z" } ] } } ## User [/users/{id}] A single User object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the User to perform action with. Has example value. ### Retrieve a User [GET] + Request (application/json) + Headers X-Token: TokenID + Response 200 (application/json) + Body { "users": [ { "links": { "self": { "href": "https://api.afraidTO.do/users/541ceb1edf465e1b95000002" }, "tokens": [ "541ceb1edf465e1b95000003" ] }, "name": "Bob of Wug", "email": "[email protected]", "avatar": "http://www.gravatar.com/avatar/bd0261dd040c14db68c8e8b9ce1dbb23?s=4" } ], "linked": { "tokens": [ { "href": "https://api.afraidTO.do/token/541ceb1edf465e1b95000003", "id": "541ceb1edf465e1b95000003", "access_token": "53b345503e5e1bccf7d0d8d15480a2f1", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:49:02.430Z", "updated_at": "2014-09-20T02:49:02.430Z" } ] } } ### Update a User [PUT] + Request (application/json) + Headers X-Token: TokenID + Body { "users": [ { "name": "Bob" }] } + Response 200 (application/json) + Body { "users": [ { "links": { "self": { "href": "https://api.afraidTO.do/users/541ceb1edf465e1b95000002" }, "tokens": [ "541ceb1edf465e1b95000003" ] }, "name": "Bob", "email": "[email protected]", "avatar": "http://www.gravatar.com/avatar/bd0261dd040c14db68c8e8b9ce1dbb23?s=4" } ], "linked": { "tokens": [ { "href": "https://api.afraidTO.do/token/541ceb1edf465e1b95000003", "id": "541ceb1edf465e1b95000003", "access_token": "53b345503e5e1bccf7d0d8d15480a2f1", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:49:02.430Z", "updated_at": "2014-09-20T02:49:02.430Z" } ] } } ### Remove a User [DELETE] + Response 204 ## Access Tokens [/auth/tokens] ### List all Tokens [GET] + Request (application/json) + Headers X-Token: TokenID + Body {} + Response 200 (application/json) + Body { "tokens": [ { "href": "https://api.afraidTO.do/token/541cedabdf465e226f000002", "id": "541cedabdf465e226f000002", "access_token": "27ba5da7b7b9f8638a8e6e5758106791", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:59:55.113Z", "updated_at": "2014-09-20T02:59:55.113Z" }, { "href": "https://api.afraidTO.do/token/541cedabdf465e226f000003", "id": "541cedabdf465e226f000003", "access_token": "TestKey", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:59:55.114Z", "updated_at": "2014-09-20T02:59:55.114Z" } ] } ### Create an Access Token [POST] + Request (application/json) + Headers X-Token: TokenID + Body {} + Response 201 (application/json) + Body { "tokens": [ { "href": "https://api.afraidTO.do/token/541cedabdf465e226f000002", "id": "541cedabdf465e226f000002", "access_token": "27ba5da7b7b9f8638a8e6e5758106791", "expires_at": "2014-10-19", "created_at": "2014-09-20T02:59:55.113Z", "updated_at": "2014-09-20T02:59:55.113Z" } ] } ## Token [/tokens/{id}] A single Token object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Token to perform action with. Has example value. ### Remove a Token [DELETE] + Response 204
update api docs
update api docs
API Blueprint
mit
k2052/afraidTODO.api
99df6a372f0f286abdee3b5d98c63593df842414
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://rails5-api-base.herokuapp.com # API BASE Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. ## Users Collection [/api/v1/users] ### Sign Up [POST] + Request (application/json) + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Current user's profile [/api/v1/user/profile] ### Get current user profile [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ### Update current user profile [PUT] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) ## Get current user info [/api/v1/user] ### Get user [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (User, required) + Response 401 ## Login [/api/v1/users/sign_in] ### Login [POST] + Request (application/json) + Body { "user": { "email": "[email protected]", "password": "password" } } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Logout [/api/v1/users/sign_out] ### Logout [DELETE] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Response 200 (application/json) ## Reset password [/api/v1/users/password] More information of how reset password works: https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow ### Reset password [POST] Use this route to send a password reset confirmation email + Request (application/json) + Body { "email": "[email protected]", "redirect_url": "http://www.example.com" } + Response 200 (application/json) + Body { "success": true, "message": "An email has been sent to '[email protected]' containing instructions for resetting your password." } ### Reset password [PUT] Use this route to change user's passwords + Request (application/json) + Parameters + reset_password_token (string, required) + Body { "password": "12345678", "password_confirmation": "12345678" } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes (Profile Response) ## Edit reset password [/api/v1/users/password/edit] ### Edit reset password [GET] This route is the destination URL for password reset confirmation + Request (application/json) + Parameters + reset_password_token (string, required) + redirect_url (string) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] # Data Structures ## Profile Response (object) + id: 100 (number) + email: [email protected] (string) + provider: email, facebook, twitter (enum[string]) - it's way the user logins + uid: [email protected] (string) - the provider identifier + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) + created_at: 2017-02-23T13:54:33.283Z (string) ## Profile Edition (object) + email: [email protected] (string) + password: 12345678 (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) ## User (object) + email: [email protected] (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string)
FORMAT: 1A HOST: http://rails5-api-base.herokuapp.com # API BASE Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. ## Users Collection [/api/v1/users] ### Sign Up [POST] + Request (application/json) + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Current user's profile [/api/v1/user/show] ### Get current user profile [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ### Update current user profile [PUT] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) ## Login [/api/v1/users/sign_in] ### Login [POST] + Request (application/json) + Body { "user": { "email": "[email protected]", "password": "password" } } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Logout [/api/v1/users/sign_out] ### Logout [DELETE] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Response 200 (application/json) ## Reset password [/api/v1/users/password] More information of how reset password works: https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow ### Reset password [POST] Use this route to send a password reset confirmation email + Request (application/json) + Body { "email": "[email protected]", "redirect_url": "http://www.example.com" } + Response 200 (application/json) + Body { "success": true, "message": "An email has been sent to '[email protected]' containing instructions for resetting your password." } ### Reset password [PUT] Use this route to change user's passwords + Request (application/json) + Parameters + reset_password_token (string, required) + Body { "password": "12345678", "password_confirmation": "12345678" } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes (Profile Response) ## Edit reset password [/api/v1/users/password/edit] ### Edit reset password [GET] This route is the destination URL for password reset confirmation + Request (application/json) + Parameters + reset_password_token (string, required) + redirect_url (string) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] # Data Structures ## Profile Response (object) + id: 100 (number) + email: [email protected] (string) + provider: email, facebook, twitter (enum[string]) - it's way the user logins + uid: [email protected] (string) - the provider identifier + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) + created_at: 2017-02-23T13:54:33.283Z (string) ## Profile Edition (object) + email: [email protected] (string) + password: 12345678 (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) ## User (object) + email: [email protected] (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string)
Update apiary.apib
Update apiary.apib
API Blueprint
mit
rootstrap/rails_api_base,rootstrap/rails_api_base,rootstrap/rails_api_base,rootstrap/rails_api_base
55a927f7705d20cb6b878c48e73723079860a30f
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 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: ``` { "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 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. `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
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
ff81b1324881ab71dbe97160eec683f2f2320697
blueprint/index.apib
blueprint/index.apib
FORMAT: 1A # The Grid API Want to get straight to the details? * [Authentication](authentication.html) * [Content Management](api.html) * [User Management](passport.html) * [Design Systems](designsystem.html) * [Notifications](notifications.html) * [Code examples](examplecode.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. <iframe width="560" height="315" src="https://www.youtube.com/embed/6WC51nDYgCw" frameborder="0" allowfullscreen></iframe> Functionality provided includes * Webpage auto-design and layout * Content import and analysis * Image processing * Website serving * Handling payments (TBD) What The Grid is not: Not a web-hosting platform to run arbitrary PHP/Python/Ruby or databases on. # Programming language support 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#. Unless otherwise noted, all API endpoints are [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) enabled. That means you can use the API in the browser on any website, also those who are not made with The Grid. # Access API access is available to all users on The Grid. If you wish to develop with The Grid, [get your plan](https://plans.thegrid.io/pro). 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 # The Grid API Want to get straight to the details? ## API Endpoints * [Authentication](authentication.html) * [Content Management](api.html) * [User Management](passport.html) * [Design Systems](designsystem.html) * [Notifications](notifications.html) * [Code examples](examplecode.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. <iframe width="560" height="315" src="https://www.youtube.com/embed/6WC51nDYgCw" frameborder="0" allowfullscreen></iframe> Functionality provided includes * Webpage auto-design and layout * Content import and analysis * Image processing * Website serving * Handling payments (TBD) What The Grid is not: Not a web-hosting platform to run arbitrary PHP/Python/Ruby or databases on. # Programming language support 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#. Unless otherwise noted, all API endpoints are [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) enabled. That means you can use the API in the browser on any website, also those who are not made with The Grid. # Access API access is available to all users on The Grid. If you wish to develop with The Grid, [get your plan](https://plans.thegrid.io/pro). 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 header for endpoints quickref
index: Add header for endpoints quickref
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
bf21222c4847690565f2cc9fd2a5c86a999b328b
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://api.projectmosul.org/ # Project Mosul Project Mosul is a volunteer crowd-sourced initiative to digitally restore the heritage destroyed by the Islamic State in Northern Iraq. The API provides direct access to the images and artefacts and will be building blocks for future extensions to the site. # Project Mosul API Root [/] This resource does not have any attributes. Instead it offers the initial API affordances in the form of the links in the JSON body. ## Retrieve the Entry Point [GET] + Response 200 (application/json) { "images_url": "/images", "artefacts_url": "/artefacts" } ## Image [/images/{image_uuid}] An Image object has the following attributes: + uuid + created_at - An ISO8601 date when the image was published. + updated_at - An ISO8601 date when the image was last updated. + url + artefact - A hash for the assigned artefact, if any. + Parameters + image_uuid (required, uuid, `011fc522-d5ed-48d8-a754-0b1c6be4a099`) ... UUID of the Image in form of a string ### View an Image Detail [GET] + Response 200 (application/json) { "created_at": "2015-03-12T22:10:00.377Z", "updated_at": "2015-04-20T20:15:51.054Z", "uuid": "011fc522-d5ed-48d8-a754-0b1c6be4a099", "url": "http://projectmosul.org/system/images/images/000/000/008/original/MCM_Qais_Rashid_Visit_DS_May08_%28136%29.JPG?1426798649", "artefact": { "id": 15, "uuid": "eddfa2ae-7cfe-441a-ac7b-eda912e3d867", "name": "Lion Statue", "uri": "http://api.projectmosul.org/artefacts/eddfa2ae-7cfe-441a-ac7b-eda912e3d867" } } ## Artefact [/artefacts/{artefact_uuid}] An Image object has the following attributes: + uuid + created_at - An ISO8601 date when the image was published. + updated_at - An ISO8601 date when the image was last updated. + url + images - An array of assigned images, if any. + Parameters + artefact_uuid (required, uuid, `eddfa2ae-7cfe-441a-ac7b-eda912e3d867`) ... UUID of the Image in form of a string ### View an Artefact Detail [GET] + Response 200 (application/json) { "uuid": "eddfa2ae-7cfe-441a-ac7b-eda912e3d867", "id": 15, "created_at": "2015-03-12T22:09:59.172Z", "updated_at": "2015-03-18T00:05:18.428Z", "name": "Lion Statue", "url": "http://api.projectmosul.org/artefacts/15", "images": [ { "created_at": "2015-03-12T22:10:00.377Z", "updated_at": "2015-04-20T20:15:51.054Z", "uuid": "011fc522-d5ed-48d8-a754-0b1c6be4a099", "url": "http://projectmosul.org/system/images/images/000/000/008/original/MCM_Qais_Rashid_Visit_DS_May08_%28136%29.JPG?1426798649" }, { "created_at": "2015-03-12T22:10:01.363Z", "updated_at": "2015-04-20T20:15:51.057Z", "uuid": "a4e50a89-93eb-40fa-a65b-431c72e4ef92", "url": "http://projectmosul.org/system/images/images/000/000/009/original/MCM_Qais_Rashid_Visit_DS_May08_%28151%29.JPG?1426798650" } ] }
FORMAT: 1A HOST: http://api.projectmosul.org/ # Project Mosul Project Mosul is a volunteer crowd-sourced initiative to digitally restore the heritage destroyed by the Islamic State in Northern Iraq. The API provides direct access to the images and artefacts and will be building blocks for future extensions to the site. # Project Mosul API Root [/] This resource does not have any attributes. Instead it offers the initial API affordances in the form of the links in the JSON body. ## Retrieve the Entry Point [GET] + Response 200 (application/json) { "images_url": "/images", "artefacts_url": "/artefacts" } ## Artefacts [/artefacts/] Returns a list of all the artefacts available ## Images [/images/] Returns a list of all the images available ## Image [/images/{image_uuid}] An Image object has the following attributes: + uuid + created_at - An ISO8601 date when the image was published. + updated_at - An ISO8601 date when the image was last updated. + url + artefact - A hash for the assigned artefact, if any. + Parameters + image_uuid (required, uuid, `011fc522-d5ed-48d8-a754-0b1c6be4a099`) ... UUID of the Image in form of a string ### View an Image Detail [GET] + Response 200 (application/json) { "created_at": "2015-03-12T22:10:00.377Z", "updated_at": "2015-04-20T20:15:51.054Z", "uuid": "011fc522-d5ed-48d8-a754-0b1c6be4a099", "url": "http://projectmosul.org/system/images/images/000/000/008/original/MCM_Qais_Rashid_Visit_DS_May08_%28136%29.JPG?1426798649", "artefact": { "id": 15, "uuid": "eddfa2ae-7cfe-441a-ac7b-eda912e3d867", "name": "Lion Statue", "uri": "http://api.projectmosul.org/artefacts/eddfa2ae-7cfe-441a-ac7b-eda912e3d867" } } ## Artefact [/artefacts/{artefact_uuid}] An Image object has the following attributes: + uuid + created_at - An ISO8601 date when the image was published. + updated_at - An ISO8601 date when the image was last updated. + url + images - An array of assigned images, if any. + Parameters + artefact_uuid (required, uuid, `eddfa2ae-7cfe-441a-ac7b-eda912e3d867`) ... UUID of the Image in form of a string ### View an Artefact Detail [GET] + Response 200 (application/json) { "uuid": "eddfa2ae-7cfe-441a-ac7b-eda912e3d867", "id": 15, "created_at": "2015-03-12T22:09:59.172Z", "updated_at": "2015-03-18T00:05:18.428Z", "name": "Lion Statue", "url": "http://api.projectmosul.org/artefacts/15", "images": [ { "created_at": "2015-03-12T22:10:00.377Z", "updated_at": "2015-04-20T20:15:51.054Z", "uuid": "011fc522-d5ed-48d8-a754-0b1c6be4a099", "url": "http://projectmosul.org/system/images/images/000/000/008/original/MCM_Qais_Rashid_Visit_DS_May08_%28136%29.JPG?1426798649" }, { "created_at": "2015-03-12T22:10:01.363Z", "updated_at": "2015-04-20T20:15:51.057Z", "uuid": "a4e50a89-93eb-40fa-a65b-431c72e4ef92", "url": "http://projectmosul.org/system/images/images/000/000/009/original/MCM_Qais_Rashid_Visit_DS_May08_%28151%29.JPG?1426798650" } ] }
tweak to apiary file
tweak to apiary file
API Blueprint
mit
neshmi/projectmosul,neshmi/projectmosul,neshmi/projectmosul,neshmi/projectmosul,neshmi/projectmosul
e20093df255cf9d7c503a6789322c583a0fce747
blueprint/authentication.apib
blueprint/authentication.apib
FORMAT: 1A HOST: https://thegrid.io/ # Authentication The Grid operates an OAuth2 provider that is utilized for all authentication purposes. ### Identity Providers The Grid's authentication system supports multiple identity providers including: * GitHub (github) * Twitter (twitter) More identity providers are likely to be added later when they are needed. Check back to this document to see the current list. ### Registering an application The Grid authentication is always granted to the combination of a user and an application. To register an application, log into your The Grid account at https://passport.thegrid.io/account Go to the Developer Section of your profile page, and you'll be able to add new OAuth2 client applications. You need the following information: * Application name: name of the application shown to users in the confirmation page * Callback URL: the URL in your application users should be redirected to once they complete their login Once you have registered an application you will get two values from the system: * Application ID: Unique identifier for your application * Application secret: Passphrase your application can use to convert authentication grants to tokens **Note:** never let others see your client secret. Otherwise they will be able to impersonate your The Grid application! ### The OAuth dance When you want to authenticate a user with your The Grid application, you need to first send them to The Grid's login system. For this you need to construct a login URL with the following parts: * Protocol: https * Host: passport.thegrid.io * Path: `/login/authorize/<identity provider (optional, otherwise will show UI to choose provider)>` * Query: * `client_id`: the unique identifier of your application * `response_type`: code * `scope`: comma-separated list of requested scopes * `redirect_url`: your callback URL Example: <https://passport.thegrid.io/login/authorize/github?client_id=XXXX&response_type=code&scope=share&redirect_uri=http://my.app.url> #### Authentication scopes The default authentication scope will grant you permissions to perform simple operations on behalf of the user. If needed, you can also request additional access to The Grid APIs via OAuth2 scopes. The scopes are added to the authentication request URL with the scope query key. The currently supported scopes include: * `content_management`: manage user's content items on The Grid * `website_management`: manage user's The Grid sites and publish to them * `share`: share new content to The Grid. Also provided by the `content_management` scope * `update_profile`: update the user's profile information * `github`: get access to the user's GitHub access token, if any. This will allow you to use the GitHub API on behalf of the user * `github_private`: get access to the user's GitHub access token authorized to access private repositories, if any. This will allow you to use the GitHub API on behalf of the user * `payment`: make a payment on behalf of the user * `balance`: see user's account balance and transaction history * `cta_management`: manage user's Calls to Action #### Getting a token Once the user completes the authentication process and grants your application access to their account, they will be redirected to the redirect_url. The redirection will contain an additional query parameter code which contains a one-time access grant. To convert this access grant to an access token you have to make a HTTP POST request with the following URL: * Protocol: https * Host: passport.thegrid.io * Path: /login/authorize/token The payload should be a URL-encoded string containing the following key-value pairs: * `client_id`: the unique identifier of your application * `client_secret`: your application's passphrase * `code`: the access grant you received in the query parameter of your callback URL * `grant_type`: `authorization_code` On a successful code conversion you will receive a JSON-encoded response with an object that will contain the user's access token in the `access_token` key. ### Making authenticated API requests The Grid API calls require authentication unless stated otherwise. This is done using the user's access token via HTTP Bearer Authentication. Bearer authentication works by adding the Authorization header to your HTTP requests with the value `Bearer <access token>`. For example: ``` req.setRequestHeader('Authorization', 'Bearer ' + token); ``` ### The Grid authentication on Node.js The [passport-thegrid](https://www.npmjs.com/package/passport-thegrid) module provides The Grid authentication for [Passport](http://passportjs.org/) enabled Node.js applications.
FORMAT: 1A HOST: https://thegrid.io/ # Authentication The Grid operates an OAuth2 provider that is utilized for all authentication purposes. ### Identity Providers The Grid's authentication system supports multiple identity providers including: * GitHub (github) * Twitter (twitter) More identity providers are likely to be added later when they are needed. Check back to this document to see the current list. ### Registering an application The Grid authentication is always granted to the combination of a user and an application. To register an application, log into your The Grid account at https://passport.thegrid.io/account Go to the Developer Section of your profile page, and you'll be able to add new OAuth2 client applications. You need the following information: * Application name: name of the application shown to users in the confirmation page * Callback URL: the URL in your application users should be redirected to once they complete their login Once you have registered an application you will get two values from the system: * Application ID: Unique identifier for your application * Application secret: Passphrase your application can use to convert authentication grants to tokens **Note:** never let others see your client secret. Otherwise they will be able to impersonate your The Grid application! ### The OAuth dance When you want to authenticate a user with your The Grid application, you need to first send them to The Grid's login system. For this you need to construct a login URL with the following parts: * Protocol: https * Host: passport.thegrid.io * Path: `/login/authorize/<identity provider (optional, otherwise will show UI to choose provider)>` * Query: * `client_id`: the unique identifier of your application * `response_type`: code * `scope`: comma-separated list of requested scopes * `redirect_uri`: your callback URL Example: <https://passport.thegrid.io/login/authorize/github?client_id=XXXX&response_type=code&scope=share&redirect_uri=http://my.app.url> #### Authentication scopes The default authentication scope will grant you permissions to perform simple operations on behalf of the user. If needed, you can also request additional access to The Grid APIs via OAuth2 scopes. The scopes are added to the authentication request URL with the scope query key. The currently supported scopes include: * `content_management`: manage user's content items on The Grid * `website_management`: manage user's The Grid sites and publish to them * `share`: share new content to The Grid. Also provided by the `content_management` scope * `update_profile`: update the user's profile information * `github`: get access to the user's GitHub access token, if any. This will allow you to use the GitHub API on behalf of the user * `github_private`: get access to the user's GitHub access token authorized to access private repositories, if any. This will allow you to use the GitHub API on behalf of the user * `payment`: make a payment on behalf of the user * `balance`: see user's account balance and transaction history * `cta_management`: manage user's Calls to Action #### Getting a token Once the user completes the authentication process and grants your application access to their account, they will be redirected to the redirect_url. The redirection will contain an additional query parameter code which contains a one-time access grant. To convert this access grant to an access token you have to make a HTTP POST request with the following URL: * Protocol: https * Host: passport.thegrid.io * Path: /login/authorize/token The payload should be a URL-encoded string containing the following key-value pairs: * `client_id`: the unique identifier of your application * `client_secret`: your application's passphrase * `code`: the access grant you received in the query parameter of your callback URL * `grant_type`: `authorization_code` On a successful code conversion you will receive a JSON-encoded response with an object that will contain the user's access token in the `access_token` key. ### Making authenticated API requests The Grid API calls require authentication unless stated otherwise. This is done using the user's access token via HTTP Bearer Authentication. Bearer authentication works by adding the Authorization header to your HTTP requests with the value `Bearer <access token>`. For example: ``` req.setRequestHeader('Authorization', 'Bearer ' + token); ``` ### The Grid authentication on Node.js The [passport-thegrid](https://www.npmjs.com/package/passport-thegrid) module provides The Grid authentication for [Passport](http://passportjs.org/) enabled Node.js applications.
Correct redirect_uri param
Correct redirect_uri param
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
262bbaf6ce904108e476438876852d48b3fe7d85
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 pushes his `sessionId` and `username` to the **Server**. 2. After that, the **Server** save the **User** information and response `userId` to **User**. 3. When he pushes a message. The **Server** will receive it and broadcasts to the others. 4. 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}] + 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] ### 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 1. When a **User** connects to **Server**. He will input his `username` and pushes his `sessionId` and `username` to the **Server**. 2. After that, the **Server** save the **User** information and response `userId` to **User**. 3. When he pushes a message. The **Server** will receive it and broadcasts to the others. 4. 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}] + 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] ### 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)
Fix API blueprint
Fix API blueprint
API Blueprint
mit
hckhanh/demo-faye,hckhanh/demo-faye,hckhanh/demo-faye,hckhanh/demo-faye
b318b7ec0cdd12934697857f2206aaad15ad87f0
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. # Admiral 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." }
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." }
Add info about configuration
Add info about configuration
API Blueprint
mit
andrewmunsell/admiral
3c7110ec7c00caca46ba95a827ad7f68adf184a2
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # scifgif Polls is a simple API allowing consumers to view polls and vote in them. ## 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: http://polls.apiblueprint.org/ # 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
update api docs
update api docs
API Blueprint
mit
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
806c40f00765398c8daef73ef1a07d36f7e03c15
apiary.apib
apiary.apib
FORMAT: 1A HOST: https://owner-api.teslamotors.com # Tesla Model S JSON API This is unofficial documentation of the Tesla Model S JSON API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely. # Group Authentication ## Tokens [/oauth/token] ### Get an Access Token [POST] Performs the login. Takes in an plain text email and password, matching the owner's login information for [https://my.teslamotors.com/user/login](https://my.teslamotors.com/user/login). Returns a `access_token` which is passed along as a header with all future requests to authenticate the user. You must provide the "Authorization: Bearer {access_token}" + Parameters + grant_type: `password` (string) - The type of oAuth grant. Always "password" + client_id: `abc` (string) - The oAuth client ID + client_secret: `123` (string) - The oAuth client secret + email: `[email protected]` (string) - The email for my.teslamotors.com + password: `edisonsux` (string) - The password for my.teslamotors.com + Response 200 (application/json) + Body { "access_token": "abc123", "token_type": "bearer", "expires_in": 7776000 } # Group Vehicles A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them. ## Vehicle Collection [/api/1/vehicles] ### List all Vehicles [GET] Retrieve a list of your owned vehicles (includes vehicles not yet shipped!) + Response 200 (application/json) + Body [{ "color": null, "display_name": null, "id": 321, "option_codes": "MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013", "user_id": 123, "vehicle_id": 1234567890, "vin": "5YJSA1CN5CFP01657", "tokens": ["x", "x"], "state": "online" }] ## State and Settings [/api/1/vehicles/{vehicle_id}] These resources are read-only and determine the state of the vehicle's various sub-systems. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. ## Mobile Access [GET /api/1/vehicles/{vehicle_id}/mobile_enabled] Determines if mobile access to the vehicle is enabled. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "reason":"", "result":true } ## Charge State [GET /api/1/vehicles/{vehicle_id}/command/charge_state] Returns the state of charge in the battery. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "charging_state": "Complete", // "Charging", ?? "charge_to_max_range": false, // current std/max-range setting "max_range_charge_counter": 0, "fast_charger_present": false, // connected to Supercharger? "battery_range": 239.02, // rated miles "est_battery_range": 155.79, // range estimated from recent driving "ideal_battery_range": 275.09, // ideal miles "battery_level": 91, // integer charge percentage "battery_current": -0.6, // current flowing into battery "charge_starting_range": null, "charge_starting_soc": null, "charger_voltage": 0, // only has value while charging "charger_pilot_current": 40, // max current allowed by charger & adapter "charger_actual_current": 0, // current actually being drawn "charger_power": 0, // kW (rounded down) of charger "time_to_full_charge": null, // valid only while charging "charge_rate": -1.0, // float mi/hr charging or -1 if not charging "charge_port_door_open": true } ## Climate Settings [GET /api/1/vehicles/{vehicle_id}/command/climate_state] Returns the current temperature and climate control state. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "inside_temp": 17.0, // degC inside car "outside_temp": 9.5, // degC outside car or null "driver_temp_setting": 22.6, // degC of driver temperature setpoint "passenger_temp_setting": 22.6, // degC of passenger temperature setpoint "is_auto_conditioning_on": false, // apparently even if on "is_front_defroster_on": null, // null or boolean as integer? "is_rear_defroster_on": false, "fan_status": 0 // fan speed 0-6 or null } ## Driving and Position [GET /api/1/vehicles/{vehicle_id}/command/drive_state] Returns the driving and position state of the vehicle. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "shift_state": null, // "speed": null, // "latitude": 33.794839, // degrees N of equator "longitude": -84.401593, // degrees W of the prime meridian "heading": 4, // integer compass heading, 0-359 "gps_as_of": 1359863204 // Unix timestamp of GPS fix } ## GUI Settings [GET /api/1/vehicles/{vehicle_id}/command/gui_settings] Returns various information about the GUI settings of the car, such as unit format and range display. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "gui_distance_units": "mi/hr", "gui_temperature_units": "F", "gui_charge_rate_units": "mi/hr", "gui_24_hour_time": false, "gui_range_display": "Rated" } ## Vehicle State [GET /api/1/vehicles/{vehicle_id}/command/vehicle_state] Returns the vehicle's physical state, such as which doors are open. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "df": false, // driver's side front door open "dr": false, // driver's side rear door open "pf": false, // passenger's side front door open "pr": false, // passenger's side rear door open "ft": false, // front trunk is open "rt": false, // rear trunk is open "car_verson": "1.19.42", // car firmware version "locked": true, // car is locked "sun_roof_installed": false, // panoramic roof is installed "sun_roof_state": "unknown", "sun_roof_percent_open": 0, // null if not installed "dark_rims": false, // gray rims installed "wheel_type": "Base19", // wheel type installed "has_spoiler": false, // spoiler is installed "roof_color": "Colored", // "None" for panoramic roof "perf_config": "Base" } # Group Vehicle Commands These commands alter the vehicles state, and return result (true/false) to indicate success, and if failure reason contains the cause of failure. ## GET /api/1/vehicles/{vehicle_id}/command/charge_port_door_open Open the charge port. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/charge_standard Set the charge mode to standard (~90% under the new percentage system introduced in 4.5). + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/charge_max_range Set the charge mode to max range (100% under the new percentage system introduced in 4.5). + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/set_charge_limit?percent={limit_value} Set the charge limit to a custom percentage. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + limit_value (number) ... The percentage value + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/charge_start Start charging. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" // "already started" if a charge is in progress } ## GET /api/1/vehicles/{vehicle_id}/command/charge_stop Stop charging. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" // "not_charging" if a charge was not in progress } ## GET /api/1/vehicles/{vehicle_id}/command/flash_lights Flash the lights once. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/honk_horn Honk the horn once. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/door_unlock Unlock the car's doors. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/door_lock Lock the car's doors. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/set_temps?driver_temp={driver_degC}&passenger_temp={pass_degC} Set the temperature target for the HVAC system. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + driver_degC (number) ... The desired temperature on the driver's side in celcius. + pass_degC (number) ... The desired temperature on the passenger's side in celcius. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/auto_conditioning_start Start the HVAC system. Will cool or heat automatically, depending on set temperature. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/auto_conditioning_stop Stop the HVAC system. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" } ## GET /api/1/vehicles/{vehicle_id}/command/sun_roof_control?state={state} Controls the car's panoramic roof, if installed. + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + state (string) The desired state of the panoramic roof. The approximate percent open values for each state are `open` = 100%, `close` = 0%, `comfort` = 80%, and `vent` = ~15% + Values + `open` + `close` + `comfort` + `vent` + Response 200 (application/json) + Body { "result": false, "reason": "failure reason" }
FORMAT: 1A HOST: https://owner-api.teslamotors.com # Tesla Model S JSON API This is unofficial documentation of the Tesla Model S JSON API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely. # Group Authentication ## Tokens [/oauth/token] ### Get an Access Token [POST] Performs the login. Takes in an plain text email and password, matching the owner's login information for [https://my.teslamotors.com/user/login](https://my.teslamotors.com/user/login). Returns a `access_token` which is passed along as a header with all future requests to authenticate the user. You must provide the "Authorization: Bearer {access_token}" + Parameters + grant_type: `password` (string) - The type of oAuth grant. Always "password" + client_id: `abc` (string) - The oAuth client ID + client_secret: `123` (string) - The oAuth client secret + email: `[email protected]` (string) - The email for my.teslamotors.com + password: `edisonsux` (string) - The password for my.teslamotors.com + Response 200 (application/json) + Body { "access_token": "abc123", "token_type": "bearer", "expires_in": 7776000 } # Group Vehicles A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them. ## Vehicle Collection [/api/1/vehicles] ### List all Vehicles [GET] Retrieve a list of your owned vehicles (includes vehicles not yet shipped!) + Request + Headers Authorization: Bearer {access_token} + Response 200 (application/json) + Body { "response": [{ "color": null, "display_name": null, "id": 321, "option_codes": "MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013", "user_id": 123, "vehicle_id": 1234567890, "vin": "5YJSA1CN5CFP01657", "tokens": ["x", "x"], "state": "online" }], "count":1 } ## State and Settings [/api/1/vehicles/{vehicle_id}] These resources are read-only and determine the state of the vehicle's various sub-systems. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. ## Mobile Access [GET /api/1/vehicles/{vehicle_id}/mobile_enabled] Determines if mobile access to the vehicle is enabled. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": true } ## Charge State [GET /api/1/vehicles/{vehicle_id}/command/charge_state] Returns the state of charge in the battery. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "charging_state": "Complete", // "Charging", ?? "charge_to_max_range": false, // current std/max-range setting "max_range_charge_counter": 0, "fast_charger_present": false, // connected to Supercharger? "battery_range": 239.02, // rated miles "est_battery_range": 155.79, // range estimated from recent driving "ideal_battery_range": 275.09, // ideal miles "battery_level": 91, // integer charge percentage "battery_current": -0.6, // current flowing into battery "charge_starting_range": null, "charge_starting_soc": null, "charger_voltage": 0, // only has value while charging "charger_pilot_current": 40, // max current allowed by charger & adapter "charger_actual_current": 0, // current actually being drawn "charger_power": 0, // kW (rounded down) of charger "time_to_full_charge": null, // valid only while charging "charge_rate": -1.0, // float mi/hr charging or -1 if not charging "charge_port_door_open": true } } ## Climate Settings [GET /api/1/vehicles/{vehicle_id}/command/climate_state] Returns the current temperature and climate control state. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "inside_temp": 17.0, // degC inside car "outside_temp": 9.5, // degC outside car or null "driver_temp_setting": 22.6, // degC of driver temperature setpoint "passenger_temp_setting": 22.6, // degC of passenger temperature setpoint "is_auto_conditioning_on": false, // apparently even if on "is_front_defroster_on": null, // null or boolean as integer? "is_rear_defroster_on": false, "fan_status": 0 // fan speed 0-6 or null } } ## Driving and Position [GET /api/1/vehicles/{vehicle_id}/command/drive_state] Returns the driving and position state of the vehicle. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "shift_state": null, // "speed": null, // "latitude": 33.794839, // degrees N of equator "longitude": -84.401593, // degrees W of the prime meridian "heading": 4, // integer compass heading, 0-359 "gps_as_of": 1359863204 // Unix timestamp of GPS fix } } ## GUI Settings [GET /api/1/vehicles/{vehicle_id}/command/gui_settings] Returns various information about the GUI settings of the car, such as unit format and range display. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "gui_distance_units": "mi/hr", "gui_temperature_units": "F", "gui_charge_rate_units": "mi/hr", "gui_24_hour_time": false, "gui_range_display": "Rated" } } ## Vehicle State [GET /api/1/vehicles/{vehicle_id}/command/vehicle_state] Returns the vehicle's physical state, such as which doors are open. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "df": false, // driver's side front door open "dr": false, // driver's side rear door open "pf": false, // passenger's side front door open "pr": false, // passenger's side rear door open "ft": false, // front trunk is open "rt": false, // rear trunk is open "car_verson": "1.19.42", // car firmware version "locked": true, // car is locked "sun_roof_installed": false, // panoramic roof is installed "sun_roof_state": "unknown", "sun_roof_percent_open": 0, // null if not installed "dark_rims": false, // gray rims installed "wheel_type": "Base19", // wheel type installed "has_spoiler": false, // spoiler is installed "roof_color": "Colored", // "None" for panoramic roof "perf_config": "Base" } } # Group Vehicle Commands These commands alter the vehicles state, and return result (true/false) to indicate success, and if failure reason contains the cause of failure. ## Wake Up Car [POST /api/1/vehicles/{vehicle_id}/wake_up] Wakes up the car from the sleep state. Necessary to get some data from the car. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Open Charge Port [POST /api/1/vehicles/{vehicle_id}/command/charge_port_door_open] Opens the charge port. Does not close the charge port (for now...) + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Set Charge Limit to Standard [POST /api/1/vehicles/{vehicle_id}/command/charge_standard] Set the charge mode to standard (90% under the new percentage system introduced in 4.5). + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": false, "reason": "already_standard" } } ## Set Charge Limit to Max Range [POST /api/1/vehicles/{vehicle_id}/command/charge_max_range] Set the charge mode to max range (100% under the new percentage system introduced in 4.5). Use sparingly! + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": false, "reason": "already_max_range" } } ## Set Charge Limit [POST /api/1/vehicles/{vehicle_id}/command/set_charge_limit?percent={limit_value}] Set the charge limit to a custom percentage. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + limit_value: `75` (number) - The percentage value + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Start Charging [POST /api/1/vehicles/{vehicle_id}/command/charge_start] Start charging. Must be plugged in, have power available, and not have reached your charge limit. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" // "already_started" if a charge is in progress } } ## Stop Charging [POST /api/1/vehicles/{vehicle_id}/command/charge_stop] Stop charging. Must already be charging. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" // "not_charging" if a charge was not in progress } } ## Flash Lights [POST /api/1/vehicles/{vehicle_id}/command/flash_lights] Flash the lights once. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Honk Horn [POST /api/1/vehicles/{vehicle_id}/command/honk_horn] Honk the horn once. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Unlock Doors [POST /api/1/vehicles/{vehicle_id}/command/door_unlock] Unlock the car's doors. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Lock Doors [POST /api/1/vehicles/{vehicle_id}/command/door_lock] Lock the car's doors. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Set Temperature [POST /api/1/vehicles/{vehicle_id}/command/set_temps?driver_temp={driver_degC}&passenger_temp={pass_degC}] Set the temperature target for the HVAC system. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + driver_degC: `23.7` (number) - The desired temperature on the driver's side in celcius. + pass_degC: `18.1` (number) - The desired temperature on the passenger's side in celcius. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Start Air Condition [POST /api/1/vehicles/{vehicle_id}/command/auto_conditioning_start] Start the HVAC system. Will cool or heat automatically, depending on set temperature. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Stop Air Condition [POST /api/1/vehicles/{vehicle_id}/command/auto_conditioning_stop] Stop the HVAC system. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } } ## Move Pano Roof [POST /api/1/vehicles/{vehicle_id}/command/sun_roof_control?state={state}&percent={percent}] Controls the car's panoramic roof, if installed. + Request + Headers Authorization: Bearer {access_token} + Parameters + vehicle_id: `1` (number) - The id of the Vehicle. + state: (enum[string]) The desired state of the panoramic roof. The approximate percent open values for each state are `open` = 100%, `close` = 0%, `comfort` = 80%, and `vent` = ~15% + Members + `open` - Open the roof fully + `close` - Close the roof completely + `comfort` - Open to the comfort (80%) setting + `vent` - Open the roof to the vent (~15%) setting + `move` - Indicates you will provide a percentage to move the roof. + percent: `50` (number, optional) - The percentage to move the roof to. + Response 200 (application/json) + Body { "response": { "result": true, "reason": "" } }
Update all the command endpoints and all responses.
Update all the command endpoints and all responses.
API Blueprint
mit
myappleguy/model-s-api,jakubsuchybio/model-s-api,timdorr/model-s-api
19f5668d4115fe7790b26fe4d375e12da214b2e2
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://lore.mit.edu/ # LORE Simple API on top of MIT LORE application # URL URL Structure is `https://{domain}/api/v1/{resource}/{resourceId}` | Code | Description | | --- | --- | |`{domain}` | The domain of the LORE service. `private-b0103d-lore.apiary-mock.com/` is the Apiary mock server. | |`/api/v1/` | The service endpoint includes the current version (v1) | |`{resource}` | The resource endpoint for a specific set of objects in the system. Supported endpoints include repositories, vocabularies, learningresources, members| |`{resource_idd}` |The `resource_id` sets the ID for a specific object to reference | *Example: `http://lore.mit.edu/api/v1/repos` will return a json representation of all repositories.* *Example: `http://lore.mit.edu/api/v1/repos/123` will return a json representation of the repository with id=123.* # Operations LORE API uses the following HTTP verbs | Verb | Description | | --- | --- | |`GET` |Select one or more items. Success returns 200 status code with json result item(s) in body.| |`POST` |Create a new item. Success returns 201 status code with newly created json item in body.| |`PUT` |Update an item. Success returns 200 status code with updated json item in body.| |`DELETE`|Delete an item. Success returns 204 status code with no body.| # Status Codes The API responds with one of the following status codes. | Code| Description | | --- | --- | |`200`| Success. Request completed. | |`201`| Success. New resource created. | |`204`| Success. No content to return. Only the status code returns. | |`400`| Bad Request - The request could not be parsed. | |`401`| Unauthorized - user is not logged in, cannot access resource. | |`404`| Not Found - resource doesn't exist. | |`422`| Unprocessable Entity - The request could not be parsed due to validation errors. | |`500`| Server error. | # Authentication tbd. # Pagination Requests that return multiple items all accept a `?page` parameter Example: `http://lore.mit.edu/api/v1/repos?page=2` Page numbering is 1-based. Omitting the ?page parameter will return the first page. # LORE API Root [/] ## Retrieve the Entry Point [GET] + Response 200 (application/json) { "repositories_url": "/repos" } ## Group Repositories Repository resource ## Repositories [/repos/{repo_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository ### Retrieve a repository [GET] + Response 200 (application/json) { "tbd": "tbd", } ### Delete a repository [DELETE] Delete the repository and all its associated resources (learning resources, vocabularies etc.) + Response 204 ### Create a New Repository [POST] Create a repository by providing its JSON representation + Request (application/json) { "name": "Physics 1", "description": "All intro-to-physics courses" } + Response 201 (application/json) + Headers Location: /repos/123 + Body { "name": "Physics 1", "description": "All intro-to-physics courses" } ## Repository Collection [/repos] ### List All Repositories [GET] + Response 200 (application/json) + Headers Link: </repos?page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ## Group Learningobjects Learning Object resource ## Learningobjects [/repos/{repo_id}/learningobjects/{learningobject_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + learningobject_id: `1007` (number, required) - ID of the learning object ### View a Learning resource [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Learningobjects Collection [/repos/{repo_id}/learningobjects{?learning_resource_type%5b%5d,course_id,xa_nr_views,page}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + learning_resource_type: `7` (number,optional) - types of learning resources + course_id: (string,optional) ### List learning resources [GET] + Response 200 (application/json) + Headers Link: </repos/17/learningobjects?learning_resource_type[]=3&learning_resource_type[]=4&page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ## Group Vocabularies Resources related to Vocabularies in the API. ## Vocabulary [/repos/{repo_id}/vocabs/{vocab_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + vocab_id: `7` (number, required) - ID of the Vocabulary ### View a Vocabulary [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Vocabularies Collection [/repos/{repo_id}/vocabs] + Parameters + repo_id: `17` (number, required) - ID of the Repository ### List All Vocabularies [GET] + Response 200 (application/json) + Headers Link: </repos/17/vocabs?page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ### Create a New Vocabulary [POST] Create your own vocabulary by providing its JSON representation + Request (application/json) { "name": "learning objectives", "description": "learning objectives description", "vocabulary_type": "m" "weight": 1 "learning_resource_types": [ "Problem", "Vertical" ] } + Response 201 (application/json) + Headers Location: /repos/17/vocabularies/2 + Body { "name": "learning objectives", "description": "learning objectives description", "vocabulary_type": "m" "weight": 1 "learning_resource_types": [ "Problem", "Vertical" ] } ## Term [/repos/{repo_id}/vocabs/{vocab_id}/term/{term_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + vocab_id: 1 (required, String) - ID of the Vocabulary + term_id: 1 (required, String) - ID of the Taxonomy term ### View a Term [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Terms Collection [/repos/{repo_id}/vocabs/{vocab_id}/terms{?learning_resource_type%5b%5d}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + vocab_id: `7` (number, required) - ID of the Vocabulary + learning_resource_type: `1` (number, optional) - types of learning resources ### List All Terms [GET] + Response 200 (application/json) + Headers Link: </repos/17/vocabs/7/terms?page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ## Group Members Represents users / members of the repository ## Member [/repos/{repo_id}/members/{member_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + member_id: `107` (number, required) - ID of the user in the system ### View a Member [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Members Collection [/repos/{repo_id}/members{?role_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + role_id: ID of the role this member belongs to ### List All Members [GET] + Response 200 (application/json) + Headers Link: </repos/1/members?page=2&role=3>; rel="next" + Body [ { "tbd": "tbd", } ]
FORMAT: 1A HOST: http://lore.mit.edu/ # LORE Simple API on top of MIT LORE application # URL URL Structure is `https://{domain}/api/v1/{resource}/{resourceId}` | Code | Description | | --- | --- | |`{domain}` | The domain of the LORE service. `private-b0103d-lore.apiary-mock.com/` is the Apiary mock server. | |`/api/v1/` | The service endpoint includes the current version (v1) | |`{resource}` | The resource endpoint for a specific set of objects in the system. Supported endpoints include repositories, vocabularies, learningresources, members| |`{resource_idd}` |The `resource_id` sets the ID for a specific object to reference | *Example: `http://lore.mit.edu/api/v1/repos` will return a json representation of all repositories.* *Example: `http://lore.mit.edu/api/v1/repos/123` will return a json representation of the repository with id=123.* # Operations LORE API uses the following HTTP verbs | Verb | Description | | --- | --- | |`GET` |Select one or more items. Success returns 200 status code with json result item(s) in body.| |`POST` |Create a new item. Success returns 201 status code with newly created json item in body.| |`PUT` |Update an item. Success returns 200 status code with updated json item in body.| |`DELETE`|Delete an item. Success returns 204 status code with no body.| # Status Codes The API responds with one of the following status codes. | Code| Description | | --- | --- | |`200`| Success. Request completed. | |`201`| Success. New resource created. | |`204`| Success. No content to return. Only the status code returns. | |`400`| Bad Request - The request could not be parsed. | |`401`| Unauthorized - user is not logged in, cannot access resource. | |`404`| Not Found - resource doesn't exist. | |`422`| Unprocessable Entity - The request could not be parsed due to validation errors. | |`500`| Server error. | # Authentication tbd. # Pagination Requests that return multiple items all accept a `?page` parameter Example: `http://lore.mit.edu/api/v1/repos?page=2` Page numbering is 1-based. Omitting the ?page parameter will return the first page. # LORE API Root [/] ## Retrieve the Entry Point [GET] + Response 200 (application/json) { "repositories_url": "/repos" } ## Group Repositories Repository resource ## Repositories [/repos/{repo_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository ### Retrieve a repository [GET] + Response 200 (application/json) { "tbd": "tbd", } ### Delete a repository [DELETE] Delete the repository and all its associated resources (learning resources, vocabularies etc.) + Response 204 ### Create a New Repository [POST] Create a repository by providing its JSON representation + Request (application/json) { "name": "Physics 1", "description": "All intro-to-physics courses" } + Response 201 (application/json) + Headers Location: /repos/123 + Body { "name": "Physics 1", "description": "All intro-to-physics courses" } ## Repository Collection [/repos] ### List All Repositories [GET] + Response 200 (application/json) + Headers Link: </repos?page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ## Group Learningobjects Learning Object resource ## Learningobjects [/repos/{repo_id}/learningobjects/{learningobject_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + learningobject_id: `1007` (number, required) - ID of the learning object ### View a Learning resource [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Learningobjects Collection [/repos/{repo_id}/learningobjects{?learning_resource_type%5b%5d,course_id,xa_nr_views,page}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + learning_resource_type: `7` (number,optional) - types of learning resources + course_id: (string,optional) ### List learning resources [GET] + Response 200 (application/json) + Headers Link: </repos/17/learningobjects?learning_resource_type[]=3&learning_resource_type[]=4&page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ## Group Vocabularies Resources related to Vocabularies in the API. ## Vocabulary [/repos/{repo_id}/vocabs/{vocab_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + vocab_id: `7` (number, required) - ID of the Vocabulary ### View a Vocabulary [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Vocabularies Collection [/repos/{repo_id}/vocabs] + Parameters + repo_id: `17` (number, required) - ID of the Repository ### List All Vocabularies [GET] + Response 200 (application/json) + Headers Link: </repos/17/vocabs?page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ### Create a New Vocabulary [POST] Create your own vocabulary by providing its JSON representation + Request (application/json) { "name": "learning objectives", "description": "learning objectives description", "vocabulary_type": "m" "weight": 1 "learning_resource_types": [ "Problem", "Vertical" ] } + Response 201 (application/json) + Headers Location: /repos/17/vocabularies/2 + Body { "name": "learning objectives", "description": "learning objectives description", "vocabulary_type": "m" "weight": 1 "learning_resource_types": [ "Problem", "Vertical" ] } ## Term [/repos/{repo_id}/vocabs/{vocab_id}/term/{term_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + vocab_id: 1 (required, String) - ID of the Vocabulary + term_id: 1 (required, String) - ID of the Taxonomy term ### View a Term [GET] + Response 200 (application/json) { "tbd": "tbd", } ## Terms Collection [/repos/{repo_id}/vocabs/{vocab_id}/terms{?learning_resource_type%5b%5d}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + vocab_id: `7` (number, required) - ID of the Vocabulary + learning_resource_type: `1` (number, optional) - types of learning resources ### List All Terms [GET] + Response 200 (application/json) + Headers Link: </repos/17/vocabs/7/terms?page=2>; rel="next" + Body [ { "tbd": "tbd", } ] ## Group Members Represents users / members of the repository ## Member [/repos/{repo_id}/members/{member_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + member_id: `107` (number, required) - ID of the user in the system ### View a Member [GET] + Response 200 (application/json) { "tbd": "tbd" } ## Members Collection [/repos/{repo_id}/members{?role_id}] + Parameters + repo_id: `17` (number, required) - ID of the Repository + role_id: ID of the role this member belongs to ### List All Members [GET] + Response 200 (application/json) + Headers Link: </repos/1/members?page=2&role=3>; rel="next" + Body [ { "tbd": "tbd" } ]
test commit
test commit
API Blueprint
agpl-3.0
mitodl/lore,mitodl/lore,mitodl/lore,amir-qayyum-khan/lore,amir-qayyum-khan/lore,amir-qayyum-khan/lore,amir-qayyum-khan/lore,mitodl/lore,amir-qayyum-khan/lore,mitodl/lore
87fd898edba335697b9950ca0950b130fc87d40c
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", "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." } ]
Fix typos in apiary
Fix typos in apiary
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
6aac5d5b37ccf642afaac681f2c024150de607fe
apiary.apib
apiary.apib
FORMAT: 1A HOST: https://sandbox-api01.clanofthecloud.com # ClanOfthecloud APIs [ClanOfTheCloud](http://www.clanofthecloud.com) is a Mobile Gaming Backend as a Service (Baas) Company. You can create an account on our website, and try us with your next social game! We're multiplateform and offer a full API. ## Authentication Once you've created an account, you can provision a Game in the FrontOffice application. We're using a classic APIKEY / APISECRET couple to authenticate all requests. Every request should have two headers set with your game credentials : |Header | | |--- |--- | |x-apikey |Your API key | |x-apisecret|Your API secret| # Gamers routes In addition to the Authentication above, gamers are authenticated too. Before playing, the gamer needs an identity... Login provides such an identity. ## Login [/v1/gamer/login] The login route is used for authenticate a gamer HTTP Basic Authentication is used to authenticate all other requests, using the token returned by the request. The response contains a `gamer_token`. Its an opaque value and will be used to authenticate the gamer (with HTTP Basic Authentication). It is your responsibility to store the gamer_token to help the user log in later. Login for authenticated gamers will one of theese components: * Facebook identity: use the `ID` and the `oauth token` from Facebook * Google+ identity: use the `ID` and the `oauth token` from Google+ ###### body description |Field|Description|Value| |---|---|---| |network|string, required|can be one of ["email", "facebook", "googleplus"] |facebookid|string, required when {network=facebook}| the ID returned by facebook sdk |facebooktoken|string, required when {network=facebook}| the token returned by facebook sdk |googleplusid|string, required when {network=googleplus}| the ID returned by google sdk |googleplustoken|string, required when {network=googleplus}| the token returned by google sdk ###### response description |Field|Description|Value| |---|---|---| |gamertoken|string| token used in basic authentication for gamer authenticate requests |profile|json| gamer's profile, including "name", "email", "nickname", ... |vfs|json| list of key/value associated to the app/game |gamervfs|json| list of key/value associated to the gamer |matches|json| array of match currently in open state of the gamer ### Login [POST] + Request (application/json) + Headers x-apikey : test_api_key x-apisecret : test_api_secret + Body { "network": "facebook", "facebookid" : "1000001010", "facebooktoken" : "CAAIoRjU6xxYBAAy5Ymu...7XAehrcVQBUOG7oBVNatEUZD" } + Response 200 (application/json) { "gamer_token" : "dfg54g2dfg54sqdf32wfds54fqdf", "profile" : {}, "vfs" : {}, "gamervfs" : {} } + Response 401 (application/json) { "code" : "Unauthorized", "message" : "Invalid App Credentials" } ### logout [DELETE] logout a gamer ### implementation * the gamer token has to be deleted on client-side! ###### header description |Header Field|Description|Value| |---|---|---| |Authentication|string, require| Authentication : Basic **gamertoken** + Request + Headers Authentication : Basic gamertoken + Response 200 ## Gamer VFS [/gamer/vfs/{key}] ### retieve gamer's data [GET] ###### header description |Header Field|Description|Value| |---|---|---| |Authentication|string, require| Authentication : Basic **gamertoken** ###### response description |Field|Description|Value| |---|---|---| |gamervfs|json| list of key/value associated to the gamer + Parameters + key (required, string) ... the desired key + Request + Headers Authentication : Basic gamertoken + Response 200 (application/json) { "gamervfs" : { "key" :"value" } } + Response 401 (application/json) { "code" : "Unauthorized", "message" : "the gamer token is no longer available, call signin!", "data" : "optional error data" }
FORMAT: 1A HOST: https://sandbox-api01.clanofthecloud.com # ClanOfthecloud APIs [ClanOfTheCloud](http://www.clanofthecloud.com) is a Mobile Gaming Backend as a Service (Baas) Company. You can create an account on our website, and try us with your next social game! We're multiplateform and offer a full API. ## Authentication Once you've created an account, you can provision a Game in the FrontOffice application. We're using a classic APIKEY / APISECRET couple to authenticate all requests. Every request should have two headers set with your game credentials : |Header | | |--- |--- | |x-apikey |Your API key | |x-apisecret|Your API secret| # Gamers routes In addition to the Authentication above, gamers are authenticated too. Before playing, the gamer needs an identity... Login provides such an identity. ## Login [/v1/gamer/login] The login route is used for authenticate a gamer HTTP Basic Authentication is used to authenticate all other requests, using the token returned by the request. The response contains a `gamer_token`. Its an opaque value and will be used to authenticate the gamer (with HTTP Basic Authentication). It is your responsibility to store the gamer_token to help the user log in later. Login for authenticated gamers will one of theese components: * Facebook identity: use the `ID` and the `oauth token` from Facebook * Google+ identity: use the `ID` and the `oauth token` from Google+ ###### body description |Field|Description|Value| |---|---|---| |network|string, required|can be one of ["email", "facebook", "googleplus"] |facebookid|string, required when {network=facebook}| the ID returned by facebook sdk |facebooktoken|string, required when {network=facebook}| the token returned by facebook sdk |googleplusid|string, required when {network=googleplus}| the ID returned by google sdk |googleplustoken|string, required when {network=googleplus}| the token returned by google sdk ###### response description |Field|Description|Value| |---|---|---| |gamertoken|string| token used in basic authentication for gamer authenticate requests |profile|json| gamer's profile, including "name", "email", "nickname", ... |vfs|json| list of key/value associated to the app/game |gamervfs|json| list of key/value associated to the gamer |matches|json| array of match currently in open state of the gamer ### Login [POST] + Request (application/json) + Headers x-apikey : test_api_key x-apisecret : test_api_secret + Body { "network": "facebook", "facebookid" : "1000001010", "facebooktoken" : "CAAIoRjU6xxYBAAy5Ymu...7XAehrcVQBUOG7oBVNatEUZD" } + Response 200 (application/json) { "gamer_token" : "dfg54g2dfg54sqdf32wfds54fqdf", "profile" : {}, "vfs" : {}, "gamervfs" : {} } + Response 401 (application/json) { "code" : "Unauthorized", "message" : "Invalid App Credentials" } ### logout [DELETE] Logout a gamer ### implementation * the gamer token has to be deleted on client-side! ###### header description |Header Field|Description|Value| |---|---|---| |Authentication|string, require| Authentication : Basic **gamertoken** + Request + Headers Authentication : Basic gamertoken + Response 200 ## Gamer VFS [/gamer/vfs/{key}] ### retieve gamer's data [GET] ###### header description |Header Field|Description|Value| |---|---|---| |Authentication|string, require| Authentication : Basic **gamertoken** ###### response description |Field|Description|Value| |---|---|---| |gamervfs|json| list of key/value associated to the gamer + Parameters + key (required, string) ... the desired key + Request + Headers Authentication : Basic gamertoken + Response 200 (application/json) { "gamervfs" : { "key" :"value" } } + Response 401 (application/json) { "code" : "Unauthorized", "message" : "the gamer token is no longer available, call signin!", "data" : "optional error data" } ### set gamer's data [PUT] ###### header description |Header Field|Description|Value| |---|---|---| |Authentication|string, require| Authentication : Basic **gamertoken** + Parameters + key (required, string) ... the desired key + Request (application/json) + Headers Authentication : Basic gamertoken + Body { "value" : "data which could be a json" } + Response 200 + Response 401 (application/json) { "code" : "Unauthorized", "message" : "the gamer token is no longer available, call signin!", "data" : "optional error data" }
add set key
add set key
API Blueprint
apache-2.0
clanofthecloud/api
67f096efd13c69f251f2537c14fe4140d21a59e5
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**. ## 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, `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":[ { "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/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 related resources of the **Money Advice Service**. ## 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, `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/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", "content":[ { "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/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>" }
Correct link header for category blueprint
Correct link header for category blueprint
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
e20fbf9785f3b65b07e38d9cab616d19faa394fe
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://api.gtdtodoapi.com # GTD TODO API This is an example API, originally written as a companion to a [Quickly Prototype APIs with Apiary](http://sendgrid.com/blog/quickly-prototype-apis-apiary/) blog post at SendGrid.com. Extended by [@zdne](https://github.com/zdne) put emphasis on hyperlinks. ## GTD TODO API [/] The API entry point. Root of the API. Main node of the mind map. This entry point resource does not have any attributes, instead it offers root API affordances. ### Affordances + `show` (`self`) ... API entry point + `folders` ... Lists all folders ### Retrieve the API Root [GET] + Response 200 (application/hal+json) { "_links": { "self": { "href": "/" }, "folders": { "href": "/folders"} } } ## Folder [/folders/{id}] A single Folder object. ### Attributes + `id` ... Id of a folder. Automatically assigned + `name` ... Name of the folder + `description` ... Description of the folder + `parent` ... ID of folder that is the parent. Set to 0 if no parent + `meta` ... A catch-all attribute to add custom features ### Affordances + `show` (`self`) ... A single Folder + `edit` ... Update or delete the Folder + Parameters + id (required, int, `0`) ... Unique folder ID in the form of an integer + Model (application/hal+json) { "_links": { "self": { "href": "/folders/1" }, "edit": { "href": "/folders/1" } }, "id": 1, "name": "Health", "description": "This represents projects that are related to health", "parent": 0, "meta": "NULL" } ### Retrieve a single Folder [GET] + Response 200 [Folder][] ### Edit a Folder [PATCH] + Request (application/json) { "description": "A collection of health related projects" } + Response 200 [Folder][] ### Delete a Folder [DELETE] + Response 204 ## Folder Collection [/folders] Collections of all folders. ### Attributes + `folder_count` ... Total count of all folders ### Affordances + `show` (`self`) ... List of all Folders + `create` ... Create a new Folder + Model (application/hal+json) { "_links": { "self": { "href": "/folders" }, "create": { "href": "/folders" } }, "folder_count": 2, "_embedded": { "folders" : [ { "_links": { "self": { "href": "/folders/1" } }, "id": 1, "name": "Health", "description": "This represents projects that are related to health" }, { "_links": { "self": { "href": "/folders/2" } }, "id": 2, "name": "Diet", "description": "A collection of projects related to Diet" } ] } } ### List all Folders [GET] + Response 200 [Folder Collection][] ### Create a Folder [POST] + Request (application/json) Represents a folder to be created. At minimum it must contain the `name` and `description` attributes. Optionally it may contain `parent` and `meta` attributes of the Folder being created. + Body { "name": "Diet", "description": "A collection of projects related to Diet", "parent": 1 } + Response 201 [Folder][]
FORMAT: 1A HOST: http://api.gtdtodoapi.com # GTD TODO API This API source is synced on GitHub – see the <https://github.com/zdne/gistfox-api> repository. This is an example API, originally written as a companion to a [Quickly Prototype APIs with Apiary](http://sendgrid.com/blog/quickly-prototype-apis-apiary/) blog post at SendGrid.com. Extended by [@zdne](https://github.com/zdne) put emphasis on hyperlinks. ## GTD TODO API [/] The API entry point. Root of the API. Main node of the mind map. This entry point resource does not have any attributes, instead it offers root API affordances. ### Affordances + `show` (`self`) ... API entry point + `folders` ... Lists all folders ## Retrieve the API Root [GET] + Response 200 (application/hal+json) { "_links": { "self": { "href": "/" }, "folders": { "href": "/folders"} } } ## Folder [/folders/{id}] A single Folder object. ### Attributes + `id` ... Id of a folder. Automatically assigned + `name` ... Name of the folder + `description` ... Description of the folder + `parent` ... ID of folder that is the parent. Set to 0 if no parent + `meta` ... A catch-all attribute to add custom features ### Affordances + `show` (`self`) ... A single Folder + `edit` ... Update or delete the Folder + Parameters + id (required, int, `0`) ... Unique folder ID in the form of an integer + Model (application/hal+json) { "_links": { "self": { "href": "/folders/1" }, "edit": { "href": "/folders/1" } }, "id": 1, "name": "Health", "description": "This represents projects that are related to health", "parent": 0, "meta": "NULL" } ## Retrieve a single Folder [GET] + Response 200 [Folder][] ### Edit a Folder [PATCH] + Request (application/json) { "description": "A collection of health related projects" } + Response 200 [Folder][] ## Delete a Folder [DELETE] + Response 204 # Folder Collection [/folders] Collections of all folders. ### Attributes + `folder_count` ... Total count of all folders ### Affordances + `show` (`self`) ... List of all Folders + `create` ... Create a new Folder + Model (application/hal+json) { "_links": { "self": { "href": "/folders" }, "create": { "href": "/folders" } }, "folder_count": 2, "_embedded": { "folders" : [ { "_links": { "self": { "href": "/folders/1" } }, "id": 1, "name": "Health", "description": "This represents projects that are related to health" }, { "_links": { "self": { "href": "/folders/2" } }, "id": 2, "name": "Diet", "description": "A collection of projects related to Diet" } ] } } ## List all Folders [GET] + Response 200 [Folder Collection][] ## Create a Folder [POST] + Request (application/json) Represents a folder to be created. At minimum it must contain the `name` and `description` attributes. Optionally it may contain `parent` and `meta` attributes of the Folder being created. + Body { "name": "Diet", "description": "A collection of projects related to Diet", "parent": 1 } + Response 201 [Folder][]
Add link to GH
Add link to GH
API Blueprint
mit
zdne/todoapi
84012db49f3939122bdf264f9e938f8ec186cbb3
apiary.apib
apiary.apib
HOST: http://portal.vn.teslamotors.com --- Tesla Model S REST API --- --- This is unofficial documentation of the Tesla Model S REST API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely. --- -- Authentication Resources -- -- Vehicle Resource A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them. -- Retrieve a list of your owned vehicles (includes vehicles not yet shipped!) GET /vehicles < 200 < Content-Type: application/json { } -- Vehicle Status Resources These resources are read-only and determine the state of the vehicle's various sub-systems. -- Determines if mobile access to the vehicle is enabled. GET /vehicles/{id}/mobile_enabled < 200 < Content-Type: application/json { } Returns the state of charge in the battery. GET /vehicles/{id}/command/charge_state < 200 < Content-Type: application/json { } Returns the current temperature and climate control state. GET /vehicles/{id}/command/climate_state < 200 < Content-Type: application/json { } Returns the vehicle's physical state, such as which doors doors open. GET /vehicles/{id}/command/vehicle_state < 200 < Content-Type: application/json { } Returns the driving state of the vehicle. GET /vehicles/{id}/command/drive_state < 200 < Content-Type: application/json { } Returns various information about the car for the GUI of the smartphone application, such as vehicle color or wheel trim. GET /vehicles/{id}/command/gui_settings < 200 < Content-Type: application/json { }
HOST: http://portal.vn.teslamotors.com --- Tesla Model S REST API --- --- This is unofficial documentation of the Tesla Model S REST API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely. --- -- Authentication Flow These endpoints handle login and session management -- Returns the login form. Sets a *_s_portal_session* cookie for the session GET /login < 200 < Set-Cookie: _s_portal_session={cookie}; path=/; secure; HttpOnly { } Performs the login. Takes in an plain text email and password, matching the owner's login from http://teslamotors.com/mytesla. Sets a *user_credentials* cookie that expires in 3 months, which is passed along with all future requests to authenticate the user. 302 redirects back to a dummy welcome page. This page is ignored by the smartphone app and can be ignored by your API client. POST /login { "user_session[email]": "string", "user_session[password]": "string" } < 302 < Set-Cookie: _s_portal_session={cookie}; path=/; secure; HttpOnly < Set-Cookie: user_credentials=x; path=/; expires=Fri, 03-May-2013 03:01:54 GMT; secure; HttpOnly < Location: https://portal.vn.teslamotors.com/ { } -- Vehicle Resource A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Retrieve a list of your owned vehicles (includes vehicles not yet shipped!) GET /vehicles < 200 < Content-Type: application/json { } -- Vehicle Status Resources These resources are read-only and determine the state of the vehicle's various sub-systems. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Determines if mobile access to the vehicle is enabled. GET /vehicles/{id}/mobile_enabled < 200 < Content-Type: application/json { } Returns the state of charge in the battery. GET /vehicles/{id}/command/charge_state < 200 < Content-Type: application/json { } Returns the current temperature and climate control state. GET /vehicles/{id}/command/climate_state < 200 < Content-Type: application/json { } Returns the vehicle's physical state, such as which doors doors open. GET /vehicles/{id}/command/vehicle_state < 200 < Content-Type: application/json { } Returns the driving state of the vehicle. GET /vehicles/{id}/command/drive_state < 200 < Content-Type: application/json { } Returns various information about the car for the GUI of the smartphone application, such as vehicle color or wheel trim. GET /vehicles/{id}/command/gui_settings < 200 < Content-Type: application/json { }
Document authentication
Document authentication
API Blueprint
mit
myappleguy/model-s-api,timdorr/model-s-api,jakubsuchybio/model-s-api,Taurm/model-s-api
481bc372319f496c8a6ac338dcbdf81ebfb533e0
apiary.apib
apiary.apib
HOST: http://www.silex.me/api/v1.0/ --- Unifile API --- --- Welcome to the our sample API documentation. All comments can be written in (support [Markdown](http://daringfireball.net/projects/markdown/syntax) syntax) --- -- Services utilities Utilities to discover services -- List services GET /services/list < 200 < Content-Type: application/json [ { "name": "dropbox", "display_name": "Dropbox", "image_small": "unifile-assets/services/dropbox.png", "description": "Edit html files from your Dropbox.", "visible": true, "isLoggedIn": true, "isConnected": true, "isOAuth": true, "user": { "display_name": "Alex Hoyau", "quota_info": { "available": 5234491392, "used": 2899550907 } } }, { "name": "ftp", "display_name": "FTP", "image_small": "unifile-assets/services/ftp.png", "description": "Edit files on a web server.", "visible": true, "isLoggedIn": false, "isConnected": false, "isOAuth": false } ]
FORMAT: 1A HOST: http://www.silex.me/api/v1.0 # Unifile API This is the API to manage your users' cloud services from your application. ## Resources [Unifile, unified access to cloud storage services through a simple web API.](https://github.com/silexlabs/unifile) ## Services list [/services/list] ### List the available services [GET] + Response 200 (application/json; charset=utf-8) [ { "name": "dropbox", "display_name": "Dropbox", "image_small": "unifile-assets/services/dropbox.png", "description": "Edit html files from your Dropbox.", "visible": true, "isLoggedIn": true, "isConnected": true, "isOAuth": true, "user": { "display_name": "Alex Hoyau", "quota_info": { "available": 5234491392, "used": 2899550907 } } }, { "name": "ftp", "display_name": "FTP", "image_small": "unifile-assets/services/ftp.png", "description": "Edit files on a web server.", "visible": true, "isLoggedIn": false, "isConnected": false, "isOAuth": false } ] # Group Service authentication and user account ## User account [/*/account] ### List the available information concerning the authenticated user [GET] + Response 200 (application/json; charset=utf-8) + Response 401 (application/json; charset=utf-8) { "success": false, "message": "User not connected yet. You need to call the 'login' service first.", "code": 401 } ## Connect the user [/*/connect] ### Connect the user and start the oauth process [GET] After calling connect, you are expected to follow the "authorize_url" provided in the response. There the user will authorize your app to acces his/her data. And then you will want to call the login route. + Response 200 (application/json; charset=utf-8) { "success": true, "message": "Now connected. You probably want to <a href=\"/api/v1.0/www-auth\">authenticate</a> now.", "authorize_url": "..." } ## User login [/*/login] ### Login after connection through oauth mechanism [GET] + Response 200 (application/json; charset=utf-8) { "success": true } + Response 401 (application/json; charset=utf-8) { "success": false, "message": "User not authorized.", "code": 401 }
connect and login
connect and login
API Blueprint
mit
silexlabs/unifile,JbIPS/unifile
f0c406c2e77fa05680fca905322582de85db5a4d
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) - Resource ID. + createdAt: `2016-07-01T15:11:09.553Z` (string) - Date of user registration. + email: `[email protected]` (string) - Unique email address of the user. + Default: `false` + 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 ## 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`
Update User data structure
Update User data structure Remove default: false from email, add better fields description.
API Blueprint
mit
jsynowiec/api-blueprint-boilerplate,jsynowiec/api-blueprint-boilerplate
4371d7b37d7dd7736e30daec9ac1279d4f8ff209
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, `cy`) ... Locale of the Article. + 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. # 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. + 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>" }
Fix locale example for API Blueprint
Fix locale example for API Blueprint
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
c7ef38c2709beda905574f61d62ea58c31258785
apiary.apib
apiary.apib
FORMAT: 1A HOST: https://api.moneyadviceservice.org.uk # Money Advice Service API for the Money Advice Service's API. # Group Articles Article related resources of the **Money Advice Service** ## Articles Collection [/articles] ### List all Articles [GET] + Response 200 (application/json) [{ "id": 1, "content": "Jogging in park" }, { "id": 2, "content": "Pick-up posters from post-office" }] ## Article [/articles/{id}] A single Article object with all its details + Parameters + slug (required, string, `the-article`) ... String `id` of the Article to perform action with. Has example value. ### Retrieve a Article [GET] + Response 200 (application/json) + Header X-My-Header: The Value + Body { "slug": "the-article", "title": "Pick-up posters from post-office", content: "<p>La de da</p>" }
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 X-My-Header: The Value + Body { "id": "where-to-go-to-get-free-debt-advice", "title": "Where to go to get free debt advice" }
Remove articles collection from API blueprint
Remove articles collection from API blueprint
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
c72956c7a92cf324d5078602e508b53d03ef39f1
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] this is the same as calling `kdb get {path}` + 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] this is the same as calling `kdb set {path}` + 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] this is the same as calling `kdb rm {path}` + 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 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
remove obsolete descriptions
remove obsolete descriptions
API Blueprint
bsd-3-clause
petermax2/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,e1528532/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,mpranj/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,e1528532/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,petermax2/libelektra,petermax2/libelektra,petermax2/libelektra,mpranj/libelektra,e1528532/libelektra,e1528532/libelektra,BernhardDenner/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,e1528532/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra
e57f7c8f2352aa9c7b221fa781c6872bdfc5c538
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]" } + 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 ## Trust Token [/orc/service/{serviceId}/trust] ### Create Trust Token [POST] + 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", "TRUSTEE_USER_NAME":"user_nameX", "TRUSTEE_USER_ID":"asdfasdf", "TRUSTOR_USER_NAME":"user_nameX", "TRUSTOR_USER_ID":"asdfasdf", } + Response 201 (application/json) { "ID_TRUST": "147562fcd773448aac3dd53748a43b0c" }
add doc about trust token
add doc about trust token
API Blueprint
agpl-3.0
telefonicaid/orchestrator,telefonicaid/orchestrator
80fc2c6d682ebf80493f043fe4836525963f18ac
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 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 } ] } ## 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 + 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) ### Borrow a pass [POST /passes/borrow] Creates a request to borrow a pass on behalf of the authenticated user for every day in the date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### Stop borrowing a pass [POST /passes/unborrow] Removes a request to borrow a pass on behalf of the authenticated user in a given date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### 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) ## Borrow Data (Date Selection) + org_id: 2 (number) - The org to borrow or unborrow from. ## 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 } ] } ## 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 + 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 + owner_id: 2 (number, optional) - The pass will belong to this user. (Only mods can use this option). + 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) ### Borrow a pass [POST /passes/borrow] Creates a request to borrow a pass on behalf of the authenticated user for every day in the date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### Stop borrowing a pass [POST /passes/unborrow] Removes a request to borrow a pass on behalf of the authenticated user in a given date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### 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) ## Borrow Data (Date Selection) + org_id: 2 (number) - The org to borrow or unborrow from. ## 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.
Add optional owner id when creating a new pass
Add optional owner id when creating a new pass This will allow moderators to assign passes to users with one request. Regular participants should not be allowed to use this option.
API Blueprint
mit
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
67aa9ca0e78aa4f790f4b71e4fbef692d5f8f8f6
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://metrics.cocoapods.org # CocoaPods Metrics Metrics is an API to view metrics for Pods. ## Status [/api/v1/status] + Attributes + github (Service Status) + cocoadocs (Service Status) ### Retrieve the Status [GET] + Response 200 (application/json) + Attributes (Status) ## Metrics [/api/v1/pods/{name}] + Parameters + name: QueryKit (required) - The name of the Pod + Attributes + github (GitHub Metrics) + cocoadocs (CocoaDoc Metrics) ### Retrieve the Metrics for a Pod [GET] + Response 200 (application/json) + Attributes (Metrics) ## Data Structures ### Service Status + total: 8949 (number, required) + complete: 8949 (number) + not_found: 988 (number) ### GitHub Metrics + subscribers: 29 (number) + stargazers: 823 (number) + forks: 36 (number) + contributors: 5 (number) + open_issues: 1 (number) + open_pull_requests: 1 (number) + created_at: `2014-06-20 06:27:17 UTC` + updated_at: `2015-03-28 04:03:03 UTC` + language: `Objective-C` + closed_issues: 12 (number) + closed_pull_requests: 11 (number) ### CocoaDoc Metrics + download_size: 464 (number) + total_files: 11 (number) + total_comments: 292 (number) + total_lines_of_code: 828 (number) + doc_percent: 89 (number) + readme_complexity: 74 (number) + initial_commit_date: `2015-01-29 17:09:31 UTC` + rendered_readme_url: `http://cocoadocs.org/docsets/QueryKit/0.9.1/README.html` + created_at: `2015-01-13 09:20:05 UTC` + updated_at: `2015-03-21 01:55:01 UTC` + license_short_name: BSD + license_canonical_url: `https://en.wikipedia.org/wiki/BSD_licenses` + total_test_expectations: 105 (number) + notability: 0 (number) + dominant_language: Objective C + quality_estimate: 57 (number)
FORMAT: 1A HOST: http://metrics.cocoapods.org # CocoaPods Metrics Metrics is an API to view metrics for Pods. ## Status [/api/v1/status] + Attributes + github (Service Status) + cocoadocs (Service Status) ### Retrieve the Status [GET] + Relation: status + Response 200 (application/json) + Attributes (Status) ## Metrics [/api/v1/pods/{name}] + Parameters + name: QueryKit (required) - The name of the Pod + Attributes + github (GitHub Metrics) + cocoadocs (CocoaDoc Metrics) ### Retrieve the Metrics for a Pod [GET] + Relation: metrics + Response 200 (application/json) + Attributes (Metrics) ## Data Structures ### Service Status + total: 8949 (number, required) + complete: 8949 (number) + not_found: 988 (number) ### GitHub Metrics + subscribers: 29 (number) + stargazers: 823 (number) + forks: 36 (number) + contributors: 5 (number) + open_issues: 1 (number) + open_pull_requests: 1 (number) + created_at: `2014-06-20 06:27:17 UTC` + updated_at: `2015-03-28 04:03:03 UTC` + language: `Objective-C` + closed_issues: 12 (number) + closed_pull_requests: 11 (number) ### CocoaDoc Metrics + download_size: 464 (number) + total_files: 11 (number) + total_comments: 292 (number) + total_lines_of_code: 828 (number) + doc_percent: 89 (number) + readme_complexity: 74 (number) + initial_commit_date: `2015-01-29 17:09:31 UTC` + rendered_readme_url: `http://cocoadocs.org/docsets/QueryKit/0.9.1/README.html` + created_at: `2015-01-13 09:20:05 UTC` + updated_at: `2015-03-21 01:55:01 UTC` + license_short_name: BSD + license_canonical_url: `https://en.wikipedia.org/wiki/BSD_licenses` + total_test_expectations: 105 (number) + notability: 0 (number) + dominant_language: Objective C + quality_estimate: 57 (number)
Include relations
[Blueprint] Include relations
API Blueprint
mit
k0nserv/metrics.cocoapods.org,CocoaPods/metrics.cocoapods.org
37a680c452f1436bbd95fbc197358eaff5e6d112
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] 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**
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** ## Classifiers Collection [/classifiers] ### Create a Classifier [POST] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "specification-url": "http://s3.com/mnist_classifier.prototxt", "model-url": "http://s3.com/mnist.caffemodel", } + Response 201 (application/json) { "id": "classifier-uuid" } ## Classify an input [/classifiers/{id}/classify] Classify an input image + Parameters + id (required, string, `classifier-uuid`) ... The id of the classifier ### Classify [GET] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "input-url": "http://s3.com/image.png" } + Response 201 (application/json) { "label": "3" }
update api with classifier stuff
update api with classifier stuff
API Blueprint
apache-2.0
tleyden/elastic-thought,tleyden/elastic-thought,aaam/elastic-thought,tleyden/elastic-thought,aaam/elastic-thought,aaam/elastic-thought
c0c8ea59a2e8ded336599fb2bbb8075b6322f96e
blueprint/designsystem.apib
blueprint/designsystem.apib
FORMAT: 1A # Design systems The Design System is the piece of The Grid that builds a webpage from page content. A set of design systems are provided by The Grid. These use techiques like finite-domain constraint solvers, decision trees, content analysis, and polyrythmic pagination in order to produce a page which: * Is *content driven*, reflects the particular items on the page * Is *visually pleasing*, respecting the users site preferences * Is *effective* at achieving the purpose set by the user In the future, we intent to support "plugins" which can hook into and extend existing design systems. Such plugins could build sections for particular types of data, extend content analysis or heruristics, add or modify rhythms (scoring functions). In the meantime the *daring and ambitious* may implement an full design system using the mechanism below. # API A design system is deployed as a `.js` file, and runs sandboxed in a browser. On the server-side this is PhantomJS (with function.bind polyfill), on client-side it runs in a WebWorker (no access to DOM). The design system must expose a `polySolvePage` function as an entry point. window.polySolvePage = function (page, options, callback) { var html = ""; var err = null; return callback(err, html, details); }; The function will be called with a [Page object](https://github.com/the-grid/apidocs/blob/master/schemata/page.yaml) containing the data to be put on the page. The `page` also includes the [Site config](https://github.com/the-grid/apidocs/blob/master/schemata/siteconfig.yaml) for the particular page. The `callback` should be called with the HTML page produced by the design system, or an `Error` object in case of failure. `details` may be an object with design-system specific information about the produced page or failure, for use in debugging and/or machine learning. Assets in the produced HTML page must either be inlined in the HTML (recommended for CSS, GSS), or refer to a *stable* URL on a HTTPS enabled CDN (recommended for fonts, images). <!-- TODO: - give example code of the simplest possible system - describe article versus feed pages - describe ordered versus non-ordered mode - describe/show how to run a page build locally --> # Use custom design system You can configure a site to use a custom design system, by setting the `style` property to be a URL to .JS file implementing the API above. `style: https://example.net/path/mydesignsystem-0.1.0.js` It is heavily recommended that the JS is served over https. Also, we recommend that the path is strictly versioned, each new code change gets a new URL, and the configuration is updated to activate the new version. Use `config` object of the `PUT /site/$id` API to change site configuration from an app. For example, using the [configure-site example](https://github.com/the-grid/apidocs/tree/master/code-examples/coffeescript) to enable a [trivial design system](https://developer.thegrid.io/designsystems/original-html.js). thegrid-site-configure https://thegrid.ai/mysite style https://developer.thegrid.io/designsystems/original-html.js Note: This will override the default design system completely! To reset back to the default design system, remove the `style` key/value. # Custom settings If your design system has settings, they should be persisted in the site config. You can use the API in order to build a web app with custom user interface to let users configuring settings. For compatibility, it is recommended that all configuration keys are prefixed with your application/design-system name. For instance, if you have an option for 'density', use something like `mysystem_density: 3.3` or use `mysystem: { density: 3.3 }`. All changes to site configuration will trigger a rebuild of the pages on the site. # Debugging There are currently no tools to run a page build job locally. There is currently no way to get the output/errors from a failed page build job. # Tools Designs systems are complex beasts. In order to create them we have built a set of libraries, services and tools. Several of these are already open source: - [Grid Style Sheets](gridstylesheets.org) (GSS), constraint-based layout system - [imgflo](http://imgflo.org), on-demand server-side image processing. Helpers: [RIG](https://github.com/the-grid/rig) and [imgflo-url](https://github.com/the-grid/imgflo-url) - [Grid Object Model](https://github.com/the-grid/gom) (GOM), HTML templating and transformations - [Flowerflip](https://github.com/the-grid/Flowerflip), Promise-based finite-domain constraint solver - [Regimen](https://github.com/the-grid/regimen), Chai.js-based expectations for item/block consumption More to be released soon!
FORMAT: 1A HOST: https://api.thegrid.io/ # Design systems The Design System is the piece of The Grid that builds a webpage from page content. A set of design systems are provided by The Grid. These use techiques like finite-domain constraint solvers, decision trees, content analysis, and polyrythmic pagination in order to produce a page which: * Is *content driven*, reflects the particular items on the page * Is *visually pleasing*, respecting the users site preferences * Is *effective* at achieving the purpose set by the user In the future, we intent to support "plugins" which can hook into and extend existing design systems. Such plugins could build sections for particular types of data, extend content analysis or heruristics, add or modify rhythms (scoring functions). In the meantime the *daring and ambitious* may implement an full design system using the mechanism below. # API A design system is deployed as a `.js` file, and runs sandboxed in a browser. On the server-side this is PhantomJS (with function.bind polyfill), on client-side it runs in a WebWorker (no access to DOM). The design system must expose a `polySolvePage` function as an entry point. window.polySolvePage = function (page, options, callback) { var html = ""; var err = null; return callback(err, html, details); }; The function will be called with a [Page object](https://github.com/the-grid/apidocs/blob/master/schemata/page.yaml) containing the data to be put on the page. The `page` also includes the [Site config](https://github.com/the-grid/apidocs/blob/master/schemata/siteconfig.yaml) for the particular page. The `callback` should be called with the HTML page produced by the design system, or an `Error` object in case of failure. `details` may be an object with design-system specific information about the produced page or failure, for use in debugging and/or machine learning. Assets in the produced HTML page must either be inlined in the HTML (recommended for CSS, GSS), or refer to a *stable* URL on a HTTPS enabled CDN (recommended for fonts, images). <!-- TODO: - describe article versus feed pages - describe ordered versus non-ordered mode - describe/show how to run a page build locally --> # Use custom design system You can configure a site to use a custom design system, by setting the `style` property to be a URL to .JS file implementing the API above. `style: https://example.net/path/mydesignsystem-0.1.0.js` It is heavily recommended that the JS is served over https. Also, we recommend that the path is strictly versioned, each new code change gets a new URL, and the configuration is updated to activate the new version. Use `config` object of the `PUT /site/$id` API to change site configuration from an app. For example, using the [configure-site example](https://github.com/the-grid/apidocs/tree/master/code-examples/coffeescript) to enable a [trivial design system](https://developer.thegrid.io/designsystems/original-html.js). thegrid-site-configure https://thegrid.ai/mysite style https://developer.thegrid.io/designsystems/original-html.js Note: This will override the default design system completely! To reset back to the default design system, remove the `style` key/value. # Custom settings If your design system has settings, they should be persisted in the site config. You can use the API in order to build a web app with custom user interface to let users configuring settings. For compatibility, it is recommended that all configuration keys are prefixed with your application/design-system name. For instance, if you have an option for 'density', use something like `mysystem_density: 3.3` or use `mysystem: { density: 3.3 }`. All changes to site configuration will trigger a rebuild of the pages on the site. # Debugging There are currently no tools to run a page build job locally. There is currently no way to get the output/errors from a failed page build job. # Tools Designs systems are complex beasts. In order to create them we have built a set of libraries, services and tools. Several of these are already open source: - [Grid Style Sheets](gridstylesheets.org) (GSS), constraint-based layout system - [imgflo](http://imgflo.org), on-demand server-side image processing. Helpers: [RIG](https://github.com/the-grid/rig) and [imgflo-url](https://github.com/the-grid/imgflo-url) - [Grid Object Model](https://github.com/the-grid/gom) (GOM), HTML templating and transformations - [Flowerflip](https://github.com/the-grid/Flowerflip), Promise-based finite-domain constraint solver - [Regimen](https://github.com/the-grid/regimen), Chai.js-based expectations for item/block consumption More to be released soon! # HTTP APIs # Group Registered design systems A registered designsystem can be used across many sites by referring to it by name (istead of URL). Such a designsystem can have many versions, and new versions will first be pushed into staging, where pages are solved without influencing the live site. One can look at and analyze these page *solutions*, and once one is confident of the quality of the new version, trigger rollout to all sites with that designsystem. If you want access to this functionality, you need an access token (secret) associated with your design system. Contact [email protected] and mark the request with 'designsystem development', and include your TheGrid user UUID. In the future, we may support self-service for registering new design systems. These APIs are [Webhooks](https://en.wikipedia.org/wiki/Webhook) signed as [JSON Web Token](http://jwt.io/). ## Designsystem events [/designsystem_event] For code examples, see [thegrid-designsystem-update](https://github.com/the-grid/apidocs/blob/master/tools/designsystem-update.coffee) and [thegrid-designsystem-collaborators](https://github.com/the-grid/apidocs/blob/master/tools/designsystem-collaborators.coffee) ### Registering new design system version [POST] + Request (application/json) + Response 202 ### Setting design system collaborators [POST] + Request (application/json) + Response 202 # Group Solutions A solution is the page output from a design system for a particular page-solving job, and associated metadata. These APIs are authenticated with standard OAuth2 Bearer-token. The application using them must request the `designsystem_review` scope. Permissions are granted per-designsystem, to users registered as a collaborators of the designsystem in question. ## Designsystems [/designsystem] ### List available designsystems [GET] Lists designsystems you are authorized to access. + Response 200 (application/json) ## Solutions [/designsystem/{system}/{?site,path,version,published,staged,limit,offset}] Note that since we create multiple solution variants for one solve job, and in future may ask user which one to publish, a solution can be `succeeded: true` but `published: false`. `staged: true` implies `published: false`, as user never sees or can publish staging results. + Parameters + site (optional, string) - Website to return results for. + path (optional, string) - Page path to return results for. Ex: "/index.html" for frontpage. + version (optional, string) - Designsystem version to return results for. Ex: "0.10.0" + published (optional, boolean) - If true, return only solutions which were made live on a site. + staged (optional, boolean) - If true, return only solutions produced in staging. If false, only from production. + limit (optional, number) - Pagination limit + offset (optional, number) - Pagination offset ### List solutions [GET] + Response 200 (application/json) ## Solution details [/designsystem/{system}/solutions/{id}] ### Get details about a solution [GET] + Response 200 (application/json) ## Solution output HTML [/designsystem/{system}/solutions/{id}/output] ### Get solution output [GET] Returns the HTML produced by design system for this solution. + Response 200 (text/html) ## Solution log [/designsystem/{system}/solutions/{id}/stdout] ### Get job stdout [GET] + Response 200 (text/plain) ## Solution error log [/designsystem/{system}/solutions/{id}/stderr] ### Get job stderr [GET] + Response 200 (text/plain) <!-- TODO: allow retrieving solution details and screenshots -->
Document HTTP APIs
designsystem: Document HTTP APIs
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
92c919ea5e48cfa61e13e05850b3ae7cff0b0be1
apiary.apib
apiary.apib
FORMAT: 1A # Room 101 Agent The Agent API controls the lifecycle of builds and jobs running on a worker. # Group Build A Build is an object that, when created, starts executing a build of the given source location, controlled by the Agent that accepted the request. ## Build [/builds/{guid}] + Parameters + guid (required, string, `abc123`) ... `guid` of the Build to view. + Model (application/json) + Body { // Unique identifier for this build. "guid": "abc123", // URL to notify upon completion. "callback": "http://example.com/builds/abc123", // Location to fetch the bits from. "source": { // The type of remote location. // // One of: git, hg, bzr, raw "type": "git", // The URI from which the source can be fetched. // // For `raw` type, this must be a URL to a `.zip` or `.tar.gz` file. "uri": "https://github.com/foo/bar.git", // The ref from the repository to build. // // This is only required for repositories. "ref": "deadbeef" } // Parameters to provide for the job. "parameters": { "FOO": "bar" }, // Parameters to provide and censor from the output. // // Not provided to jobs from pull-requests. "secure_parameters": { "SECRET": "12345" }, // State of the build. // // One of running, succeeded, failed, or errored. "state": "running" } ### Retrieve a Single Build [GET] A Build can be inspected as long as it's running. Once the build completes it will go away. Do not use [GET] to poll for the resulting `state` as you may miss the transition: instead set up a `callback` URL. + Response 200 [Build][] ### Remove a Build [DELETE] Deleting a Build cancels any running actions. If the build is not running on this agent, a `503` error will be returned. + Response 204 + Response 503 ## Builds Collection [/builds] Creating a build starts it immediately. When the build completes, the given callback will receive a `PUT` with the Build as the message body. The callback URL must be idempotent. ### Create a Build [POST] + Request (application/json) { "guid": "abc123", "callback": "http://example.com/builds/abc123", "source": { "type": "git", "uri": "https://github.com/foo/bar.git", "ref": "deadbeef" } "parameters": { "FOO": "bar" }, "secure_parameters": { "SECRET": "12345" } } + Response 201 (application/json) [Build][] + Response 503 [Build][] + Response 200
FORMAT: 1A # Room 101 Agent The Agent API controls the lifecycle of builds and jobs running on a worker. # Group Build A Build is an object that, when created, starts executing a build of the given source location, controlled by the Agent that accepted the request. ## Build [/builds/{guid}] + Parameters + guid (required, string, `abc123`) ... `guid` of the Build to view. + Model (application/json) + Body { // Unique identifier for this build. "guid": "abc123", // URL to notify upon completion. "callback": "http://example.com/builds/abc123", // Location to fetch the bits from. "source": { // The type of remote location. // // One of: git, hg, bzr, raw "type": "git", // The URI from which the source can be fetched. // // For `raw` type, this must be a URL to a `.zip` or `.tar.gz` file. "uri": "https://github.com/foo/bar.git", // The ref from the repository to build. // // This is only required for repositories. "ref": "deadbeef" } // Parameters to provide for the job. "parameters": { "FOO": "bar" }, // Parameters to provide and censor from the output. // // Not provided to jobs from pull-requests. "secure_parameters": { "SECRET": "12345" }, // State of the build. // // One of running, succeeded, failed, or errored. "state": "running" } ### Retrieve a Single Build [GET] A Build can be inspected as long as it's running. Once the build completes it will go away. Do not use [GET] to poll for the resulting `state` as you may miss the transition: instead set up a `callback` URL. + Response 200 [Build][] ### Remove a Build [DELETE] Deleting a Build cancels any running actions. If the build is not running on this agent, a `503` error will be returned. + Response 204 + Response 503 ## Builds Collection [/builds] Creating a build starts it immediately. When the build completes, the given callback will receive a `PUT` with the Build as the message body. The callback URL must be idempotent. ### Create a Build [POST] + Request (application/json) { "guid": "abc123", "callback": "http://example.com/builds/abc123", "source": { "type": "git", "uri": "https://github.com/foo/bar.git", "ref": "deadbeef" } "parameters": { "FOO": "bar" }, "secure_parameters": { "SECRET": "12345" } } + Response 201 (application/json) [Build][] + Response 503
remove bogus POST responses for 503 and 200
remove bogus POST responses for 503 and 200
API Blueprint
apache-2.0
concourse/turbine
3fe3c868ff6fe7decc522c968199dcf21f324f02
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", "timezone": "America/New_York" } + 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 + timezone: `America/New_York` (string) - The timezone string ## 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 } ] } ## 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 + 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 + owner_id: 2 (number, optional) - The pass will belong to this user. (Only mods can use this option). + 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 (or a new owner). 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 + owner_id (number, optional) - The new owner of the pass + Response 200 (application/json) + Attributes (Pass) ### Borrow a pass [POST /passes/borrow] Creates a request to borrow a pass on behalf of the authenticated user for every day in the date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### Stop borrowing a pass [POST /passes/unborrow] Removes a request to borrow a pass on behalf of the authenticated user in a given date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### 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) ## Borrow Data (Date Selection) + org_id: 2 (number) - The org to borrow or unborrow from. ## 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", "timezone": "America/New_York" } + 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 + timezone: `America/New_York` (string) - The timezone string ## 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 ### Get the sequence of daystates [GET /orgs/{org_id}/daystate_sequence] Every Org has a built-in list of states that and a curstate pointer which will continuously loop over the list depending on the rules associated with that Org. It is used to express any sort of looping set of daystates. Returns the daystate sequence as a JSON array (wrapped in an object). + Request + Header Authorization: Bearer JWT + Response 200 (application/json) + Attributes daystate_sequence: array[number] ### Modify the sequence of daystates [POST /orgs/{org_id}/daystate_sequence] + Request + Header Authorization: Bearer JWT + Attributes + daystate_sequence (array[number]) + Response 200 (application/json) ## 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 } ] } ## 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 + 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 + owner_id: 2 (number, optional) - The pass will belong to this user. (Only mods can use this option). + 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 (or a new owner). 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 + owner_id (number, optional) - The new owner of the pass + Response 200 (application/json) + Attributes (Pass) ### Borrow a pass [POST /passes/borrow] Creates a request to borrow a pass on behalf of the authenticated user for every day in the date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### Stop borrowing a pass [POST /passes/unborrow] Removes a request to borrow a pass on behalf of the authenticated user in a given date range. + Request (application/json) + Header Authentication: Bearer JWT + Attributes (Borrow Data) + Response 204 ### 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) ## Borrow Data (Date Selection) + org_id: 2 (number) - The org to borrow or unborrow from. ## 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.
Document the org daystate sequence endpoint
Document the org daystate sequence endpoint
API Blueprint
mit
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
9a74e8ad742650789caafc041a7fe8b8e80bc1bc
apiary.apib
apiary.apib
FORMAT: 1A TITLE: FIWARE-PaaS API v1 Specification DATE: 15 January 2016 VERSION: v1.0 APIARY_PROJECT: fiware-aiakos # FIWARE-Aiakos <!-- Copyright 2015 Telefónica I+D All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> Server with public API to manage ssh/gpg public keys for the support user of each FIWARE Lab node. ## Editors + Jesús Pérez González, Telefónica I+D ## Copyright Copyright (c) 2016 Telefónica Investigación y Desarrollo. This specification is licensed under the [FIWARE Open Specification License (implicit patents license)](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_(implicit_patents_license)). ## Status Final version aligned with FIWARE Release 5.2.1. # Group aiakos v1 ## Regions [/v1/support] Get the region list with keys ### Get list [GET] + Request (application/json) + Headers Accept: text/plain + Response 200 (text/plain) { "example2": { "gpgkey": "2016-02-01T13:09:24.000Z" }, "example": { "gpgkey": "2016-02-01T13:09:24.000Z", "sshkey": "2016-02-01T13:09:24.000Z" } } ## Query key [/v1/support/{region_name}/{key}] Get the key for region + Parameters + region_name (required, string, `region1`) ... region name. + key (sshkey | gpgkey) ### Get key [GET] + Request (application/json) + Headers Accept: text/plain + Response 200 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 200 (text/plain) ssh-rsa fBIqA5CALsR/gF6ITbjnSSc5pYTDZ/T0JwIb5Z [email protected] ## Add key [/v1/support] Upload the keys with ssh and gpg format. ### Post key [POST] + Request (text/plain) + Headers X-Auth-Token: token-id Accept: text/plain + Request (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 201 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK-----
FORMAT: 1A TITLE: FIWARE-PaaS API v1 Specification DATE: 15 January 2016 VERSION: v1.0 APIARY_PROJECT: fiware-aiakos # FIWARE-Aiakos <!-- Copyright 2015 Telefónica I+D All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> Server with public API to manage ssh/gpg public keys for the support user of each FIWARE Lab node. ## Editors + Jesús Pérez González, Telefónica I+D ## Copyright Copyright (c) 2016 Telefónica Investigación y Desarrollo. This specification is licensed under the [FIWARE Open Specification License (implicit patents license)](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_(implicit_patents_license)). ## Status Final version aligned with FIWARE Release 5.2.1. # Group aiakos v1 ## Regions [/v1/support] ### Get list [GET] Get the region list with keys + Request (application/json) + Headers Accept: text/plain + Response 200 (text/plain) { "example2": { "gpgkey": "2016-02-01T13:09:24.000Z" }, "example": { "gpgkey": "2016-02-01T13:09:24.000Z", "sshkey": "2016-02-01T13:09:24.000Z" } } ## Query key [/v1/support/{region_name}/{key}] Get the key for region + Parameters + region_name (required, string, `region1`) ... region name. + key (sshkey | gpgkey) ### Get key [GET] + Request (application/json) + Headers Accept: text/plain + Response 200 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 200 (text/plain) ssh-rsa fBIqA5CALsR/gF6ITbjnSSc5pYTDZ/T0JwIb5Z [email protected] ## Add key [/v1/support] Upload the keys with ssh and gpg format. ### Post key [POST] + Request (text/plain) + Headers X-Auth-Token: token-id Accept: text/plain + Request (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 201 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK-----
improve doc apiary
improve doc apiary
API Blueprint
apache-2.0
telefonicaid/fiware-aiakos,telefonicaid/fiware-aiakos,telefonicaid/fiware-aiakos,telefonicaid/fiware-aiakos
b0669dfcaf4ac9329a3eb1806531e2ad3f97c8ea
apiary.apib
apiary.apib
HOST: https://portal.vn.teslamotors.com --- Tesla Model S REST API --- --- This is unofficial documentation of the Tesla Model S REST API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely. --- -- Authentication Flow These endpoints handle login and session management -- Returns the login form. Sets a *_s_portal_session* cookie for the session GET /login < 200 < Set-Cookie: _s_portal_session={cookie}; path=/; secure; HttpOnly { } Performs the login. Takes in an plain text email and password, matching the owner's login from http://teslamotors.com/mytesla. Note that the JSON data here is just to fit in Apiary's format, but those should be POST variables. Sets a *user_credentials* cookie that expires in 3 months, which is passed along with all future requests to authenticate the user. 302 redirects back to a dummy welcome page. This page is ignored by the smartphone app and can be ignored by your API client. POST /login { "user_session[email]": "string", "user_session[password]": "string" } < 302 < Set-Cookie: _s_portal_session={cookie}; path=/; secure; HttpOnly < Set-Cookie: user_credentials=x; path=/; expires=Fri, 03-May-2013 03:01:54 GMT; secure; HttpOnly < Location: https://portal.vn.teslamotors.com/ { } -- Vehicle List A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Retrieve a list of your owned vehicles (includes vehicles not yet shipped!) GET /vehicles < 200 < Content-Type: application/json [{ "color": null, "display_name": null, "id": 321, "option_codes": "MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013", "user_id": 123, "vehicle_id": 1234567890, "vin": "5YJSA1CN5CFP01657", "tokens": ["x", "x"], "state": "online" }] -- Vehicle Status These resources are read-only and determine the state of the vehicle's various sub-systems. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Determines if mobile access to the vehicle is enabled. GET /vehicles/{id}/mobile_enabled < 200 < Content-Type: application/json { "reason":"", "result":true } Returns the state of charge in the battery. GET /vehicles/{id}/command/charge_state < 200 < Content-Type: application/json { "charging_state": "Complete", // "Charging", ?? "charge_to_max_range": false, // current std/max-range setting "max_range_charge_counter": 0, "fast_charger_present": false, // connected to Supercharger? "battery_range": 239.02, // rated miles "est_battery_range": 155.79, // range estimated from recent driving "ideal_battery_range": 275.09, // ideal miles "battery_level": 91, // integer charge percentage "battery_current": -0.6, // current flowing into battery "charge_starting_range": null, "charge_starting_soc": null, "charger_voltage": 0, // only has value while charging "charger_pilot_current": 40, // max current allowed by charger & adapter "charger_actual_current": 0, // current actually being drawn "charger_power": 0, // kW (rounded down) of charger "time_to_full_charge": null, // valid only while charging "charge_rate": -1.0, // float mi/hr charging or -1 if not charging "charge_port_door_open": true } Returns the current temperature and climate control state. GET /vehicles/{id}/command/climate_state < 200 < Content-Type: application/json { "inside_temp": 17.0, // degC inside car "outside_temp": 9.5, // degC outside car or null "driver_temp_setting": 22.6, // degC of driver temperature setpoint "passenger_temp_setting": 22.6, // degC of passenger temperature setpoint "is_auto_conditioning_on": false, // apparently even if on "is_front_defroster_on": null, // null or boolean as integer? "is_rear_defroster_on": false, "fan_status": 0 // fan speed 0-6 or null } Returns the driving and position state of the vehicle. GET /vehicles/{id}/command/drive_state < 200 < Content-Type: application/json { "shift_state": null, // "speed": null, // "latitude": 33.794839, // degrees N of equator "longitude": -84.401593, // degrees W of the prime meridian "heading": 4, // integer compass heading, 0-359 "gps_as_of": 1359863204 // Unix timestamp of GPS fix } Returns various information about the GUI settings of the car, such as unit format and range display. GET /vehicles/{id}/command/gui_settings < 200 < Content-Type: application/json { "gui_distance_units": "mi/hr", "gui_temperature_units": "F", "gui_charge_rate_units": "mi/hr", "gui_24_hour_time": false, "gui_range_display": "Rated" } Returns the vehicle's physical state, such as which doors are open. GET /vehicles/{id}/command/vehicle_state < 200 < Content-Type: application/json { "df": false, // driver's side front door open "dr": false, // driver's side rear door open "pf": false, // passenger's side front door open "pr": false, // passenger's side rear door open "ft": false, // front trunk is open "rt": false, // rear trunk is open "car_verson": "1.19.42", // car firmware version "locked": true, // car is locked "sun_roof_installed": false, // panoramic roof is installed "sun_roof_state": "unknown", "sun_roof_percent_open": 0, // null if not installed "dark_rims": false, // gray rims installed "wheel_type": "Base19", // wheel type installed "has_spoiler": false, // spoiler is installed "roof_color": "Colored", // "None" for panoramic roof "perf_config": "Base" } -- Vehicle Commands These commands alter the vehicles state, and return result (true/false) to indicate success, and if failure reason contains the cause of failure. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Open the charge port GET /vehicles/{id}/command/charge_port_door_open < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Set the charge mode to standard. GET /vehicles/{id}/command/charge_standard < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Set the charge mode to max-range. GET /vehicles/{id}/command/charge_max_range < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Start charging GET /vehicles/{id}/command/charge_start < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" // "already started" if a charge is in progress } Stop charging GET /vehicles/{id}/command/charge_stop < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" // "not_charging" if a charge was not in progress } Flash the lights once GET /vehicles/{id}/command/flash_lights < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Honk horn once GET /vehicles/{id}/command/honk_horn < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Unlock doors GET /vehicles/{id}/command/door_unlock < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Lock doors GET /vehicles/{id}/command/door_lock < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Set the temperature setpoints GET /vehicles/{id}/command/set_temps?driver_temp={driver_degC}&passenger_temp={pass_degC} < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Start HVAC GET /vehicles/{id}/command/auto_conditioning_start < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Stop HVAC GET /vehicles/{id}/command/auto_conditioning_stop < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Panoramic roof control GET /vehicles/{id}/command/sun_roof_control?state={state} State may be "open", "close", "comfort", or "vent" < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" }
HOST: https://portal.vn.teslamotors.com --- Tesla Model S REST API --- --- This is unofficial documentation of the Tesla Model S REST API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely. --- -- Authentication Flow These endpoints handle login and session management -- Returns the login form. Sets a *_s_portal_session* cookie for the session GET /login < 200 < Set-Cookie: _s_portal_session={cookie}; path=/; secure; HttpOnly { } Performs the login. Takes in an plain text email and password, matching the owner's login from http://teslamotors.com/mytesla. Sets a *user_credentials* cookie that expires in 3 months, which is passed along with all future requests to authenticate the user. 302 redirects back to a dummy welcome page. This page is ignored by the smartphone app and can be ignored by your API client. POST /login > Content-Type: application/x-www-form-urlencoded user_session%5Bemail%5D=string&user_session%5Bpassword%5D=string < 302 < Set-Cookie: _s_portal_session={cookie}; path=/; secure; HttpOnly < Set-Cookie: user_credentials=x; path=/; expires=Fri, 03-May-2013 03:01:54 GMT; secure; HttpOnly < Location: https://portal.vn.teslamotors.com/ { } -- Vehicle List A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Retrieve a list of your owned vehicles (includes vehicles not yet shipped!) GET /vehicles < 200 < Content-Type: application/json [{ "color": null, "display_name": null, "id": 321, "option_codes": "MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013", "user_id": 123, "vehicle_id": 1234567890, "vin": "5YJSA1CN5CFP01657", "tokens": ["x", "x"], "state": "online" }] -- Vehicle Status These resources are read-only and determine the state of the vehicle's various sub-systems. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Determines if mobile access to the vehicle is enabled. GET /vehicles/{id}/mobile_enabled < 200 < Content-Type: application/json { "reason":"", "result":true } Returns the state of charge in the battery. GET /vehicles/{id}/command/charge_state < 200 < Content-Type: application/json { "charging_state": "Complete", // "Charging", ?? "charge_to_max_range": false, // current std/max-range setting "max_range_charge_counter": 0, "fast_charger_present": false, // connected to Supercharger? "battery_range": 239.02, // rated miles "est_battery_range": 155.79, // range estimated from recent driving "ideal_battery_range": 275.09, // ideal miles "battery_level": 91, // integer charge percentage "battery_current": -0.6, // current flowing into battery "charge_starting_range": null, "charge_starting_soc": null, "charger_voltage": 0, // only has value while charging "charger_pilot_current": 40, // max current allowed by charger & adapter "charger_actual_current": 0, // current actually being drawn "charger_power": 0, // kW (rounded down) of charger "time_to_full_charge": null, // valid only while charging "charge_rate": -1.0, // float mi/hr charging or -1 if not charging "charge_port_door_open": true } Returns the current temperature and climate control state. GET /vehicles/{id}/command/climate_state < 200 < Content-Type: application/json { "inside_temp": 17.0, // degC inside car "outside_temp": 9.5, // degC outside car or null "driver_temp_setting": 22.6, // degC of driver temperature setpoint "passenger_temp_setting": 22.6, // degC of passenger temperature setpoint "is_auto_conditioning_on": false, // apparently even if on "is_front_defroster_on": null, // null or boolean as integer? "is_rear_defroster_on": false, "fan_status": 0 // fan speed 0-6 or null } Returns the driving and position state of the vehicle. GET /vehicles/{id}/command/drive_state < 200 < Content-Type: application/json { "shift_state": null, // "speed": null, // "latitude": 33.794839, // degrees N of equator "longitude": -84.401593, // degrees W of the prime meridian "heading": 4, // integer compass heading, 0-359 "gps_as_of": 1359863204 // Unix timestamp of GPS fix } Returns various information about the GUI settings of the car, such as unit format and range display. GET /vehicles/{id}/command/gui_settings < 200 < Content-Type: application/json { "gui_distance_units": "mi/hr", "gui_temperature_units": "F", "gui_charge_rate_units": "mi/hr", "gui_24_hour_time": false, "gui_range_display": "Rated" } Returns the vehicle's physical state, such as which doors are open. GET /vehicles/{id}/command/vehicle_state < 200 < Content-Type: application/json { "df": false, // driver's side front door open "dr": false, // driver's side rear door open "pf": false, // passenger's side front door open "pr": false, // passenger's side rear door open "ft": false, // front trunk is open "rt": false, // rear trunk is open "car_verson": "1.19.42", // car firmware version "locked": true, // car is locked "sun_roof_installed": false, // panoramic roof is installed "sun_roof_state": "unknown", "sun_roof_percent_open": 0, // null if not installed "dark_rims": false, // gray rims installed "wheel_type": "Base19", // wheel type installed "has_spoiler": false, // spoiler is installed "roof_color": "Colored", // "None" for panoramic roof "perf_config": "Base" } -- Vehicle Commands These commands alter the vehicles state, and return result (true/false) to indicate success, and if failure reason contains the cause of failure. Must have a *_s_portal_session* and *user_credentials* cookie set for all requests. -- Open the charge port GET /vehicles/{id}/command/charge_port_door_open < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Set the charge mode to standard. GET /vehicles/{id}/command/charge_standard < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Set the charge mode to max-range. GET /vehicles/{id}/command/charge_max_range < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Start charging GET /vehicles/{id}/command/charge_start < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" // "already started" if a charge is in progress } Stop charging GET /vehicles/{id}/command/charge_stop < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" // "not_charging" if a charge was not in progress } Flash the lights once GET /vehicles/{id}/command/flash_lights < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Honk horn once GET /vehicles/{id}/command/honk_horn < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Unlock doors GET /vehicles/{id}/command/door_unlock < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Lock doors GET /vehicles/{id}/command/door_lock < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Set the temperature setpoints GET /vehicles/{id}/command/set_temps?driver_temp={driver_degC}&passenger_temp={pass_degC} < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Start HVAC GET /vehicles/{id}/command/auto_conditioning_start < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Stop HVAC GET /vehicles/{id}/command/auto_conditioning_stop < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" } Panoramic roof control GET /vehicles/{id}/command/sun_roof_control?state={state} State may be "open", "close", "comfort", or "vent" < 200 < Content-Type: application/json { "result": false, "reason": "failure reason" }
Document POST variables
Document POST variables
API Blueprint
mit
myappleguy/model-s-api,Taurm/model-s-api,jakubsuchybio/model-s-api,timdorr/model-s-api
e230edcf6de929e471d38dc4db7ca4ca0479b9be
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://metrics.cocoapods.org # CocoaPods Metrics Metrics is an API to view metrics for Pods. ## Status [/api/v1/status] + Attributes + github (Service Status) + cocoadocs (Service Status) ### Retrieve the Status [GET] + Relation: status + Response 200 (application/json) + Attributes (Status) ## Metrics [/api/v1/pods/{name}] + Parameters + name: QueryKit (required) - The name of the Pod + Attributes + github (GitHub Metrics) + cocoadocs (CocoaDoc Metrics) + stats (CocoaPods Stats Metrics) ### Retrieve the Metrics for a Pod [GET] + Relation: metrics + Response 200 (application/json) + Attributes (Metrics) ## Data Structures ### Service Status + total: 8949 (number, required) + complete: 8949 (number) + not_found: 988 (number) ### GitHub Metrics + subscribers: 29 (number) + stargazers: 823 (number) + forks: 36 (number) + contributors: 5 (number) + open_issues: 1 (number) + open_pull_requests: 1 (number) + created_at: `2014-06-20 06:27:17 UTC` + updated_at: `2015-03-28 04:03:03 UTC` + language: `Objective-C` + closed_issues: 12 (number) + closed_pull_requests: 11 (number) ### CocoaDoc Metrics + install_size: 123 (number) + total_files: 130 (number) + total_comments: 10_297 (number) + total_lines_of_code: 27_637 (number) + doc_percent: 71 (number) + readme_complexity: 74 (number) + initial_commit_date: `2015-01-29 17:09:31 UTC` + rendered_readme_url: `http://cocoadocs.org/docsets/QueryKit/0.9.1/README.html` + created_at: `2015-01-13 09:20:05 UTC` + updated_at: `2015-03-21 01:55:01 UTC` + license_short_name: BSD + license_canonical_url: `https://en.wikipedia.org/wiki/BSD_licenses` + total_test_expectations: 105 (number) + dominant_language: "Objective C" + quality_estimate: 81 + builds_independently: true + is_vendored_framework: nil + rendered_changelog_url: "http://cocoadocs.org/docsets/Expecta/1.0.2/CHANGELOG.html", + rendered_summary: a string ### CocoaPods Stats Metrics + download_total: 17827 (number) + download_week: 5186 (number) + download_month: 17616 (number) + app_total: 28 (number) + app_week: 3 (number) + tests_total: 721 (number) + tests_week: 384 (number) + created_at: `2015-05-25 09:07:22 UTC` + updated_at: z2015-08-17 09:46:37 UTC` + extension_week: 0 (number) + extension_total: 0 (number) + watch_week: 0 (number) + watch_total: 0 (number) + pod_try_week: 0 (number) + pod_try_total: 0 (number) + is_active: true (bool)
FORMAT: 1A HOST: https://metrics.cocoapods.org # CocoaPods Metrics Metrics is an API to view metrics for Pods. ## Status [/api/v1/status] + Attributes + github (Service Status) + cocoadocs (Service Status) ### Retrieve the Status [GET] + Relation: status + Response 200 (application/json) + Attributes (Status) ## Metrics [/api/v1/pods/{name}] + Parameters + name: QueryKit (required) - The name of the Pod + Attributes + github (GitHub Metrics) + cocoadocs (CocoaDoc Metrics) + stats (CocoaPods Stats Metrics) ### Retrieve the Metrics for a Pod [GET] + Relation: metrics + Response 200 (application/json) + Attributes (Metrics) ## Data Structures ### Service Status + total: 8949 (number, required) + complete: 8949 (number) + not_found: 988 (number) ### GitHub Metrics + subscribers: 29 (number) + stargazers: 823 (number) + forks: 36 (number) + contributors: 5 (number) + open_issues: 1 (number) + open_pull_requests: 1 (number) + created_at: `2014-06-20 06:27:17 UTC` + updated_at: `2015-03-28 04:03:03 UTC` + language: `Objective-C` + closed_issues: 12 (number) + closed_pull_requests: 11 (number) ### CocoaDoc Metrics + install_size: 123 (number) + total_files: 130 (number) + total_comments: 10_297 (number) + total_lines_of_code: 27_637 (number) + doc_percent: 71 (number) + readme_complexity: 74 (number) + initial_commit_date: `2015-01-29 17:09:31 UTC` + rendered_readme_url: `http://cocoadocs.org/docsets/QueryKit/0.9.1/README.html` + created_at: `2015-01-13 09:20:05 UTC` + updated_at: `2015-03-21 01:55:01 UTC` + license_short_name: BSD + license_canonical_url: `https://en.wikipedia.org/wiki/BSD_licenses` + total_test_expectations: 105 (number) + dominant_language: "Objective C" + quality_estimate: 81 + builds_independently: true + is_vendored_framework: nil + rendered_changelog_url: "http://cocoadocs.org/docsets/Expecta/1.0.2/CHANGELOG.html", + rendered_summary: a string ### CocoaPods Stats Metrics + download_total: 17827 (number) + download_week: 5186 (number) + download_month: 17616 (number) + app_total: 28 (number) + app_week: 3 (number) + tests_total: 721 (number) + tests_week: 384 (number) + created_at: `2015-05-25 09:07:22 UTC` + updated_at: z2015-08-17 09:46:37 UTC` + extension_week: 0 (number) + extension_total: 0 (number) + watch_week: 0 (number) + watch_total: 0 (number) + pod_try_week: 0 (number) + pod_try_total: 0 (number) + is_active: true (bool)
Use HTTPS for the HOST
[Blueprint] Use HTTPS for the HOST
API Blueprint
mit
CocoaPods/metrics.cocoapods.org
c1721bd3d94a9c13dfff70ae5db4779695c07d5b
docs/api/drugs.apib
docs/api/drugs.apib
# Group Drugs With the drugs API you can retrieve information and reviews on individual drugs as well as list all drugs. ## Drugs [/drugs] + Model + Headers Content-Type: application/json + Body { "total": 150, "per_page": 15, "current_page": 2, "last_page": 10, "next_page_url": "https://antidote.symplicity-opensource.com/api/drugs?page=3", "prev_page_url": "https://antidote.symplicity-opensource.com/api/drugs?page=1", "from": 16, "to": 30, "data": [ { "id": "23", "label": "Tylenol" }, { "id": "31", "label": "Tylenol III" } ] } ### List [GET /drugs{?term,page,limit}] Returns a list of all drugs. The drugs are returned in alphabetically sorted order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/drugs?keywords=Tylenol ``` + Parameters + term: `a` (string, optional) - Search for a drug by label matching the term + page: `1` (integer, optional) - Page number of drugs + limit: `25` (integer, optional) - The maximum number of drugs to return, up to `500` + Default: `15` + Response 200 [Drugs][] ## Drug [/drugs/{id}] + Parameters + id: `1` (required, integer) - The drug ID + Model + Headers Content-Type: application/json + Body { "id": 1, "label": "Tylenol", "description": "Tylenol is used to treat pain.", "drug_forms": [ "Disintegrating Oral Tablet", "Oral Capsule" ], "side_effects": [ { "id": 1, "value": "Nausea" }, { "id": 2, "value": "Diarrhea" } ], "generic_id": 45, "indications": [ { "id": "1", "value": "pulmonary arterial hypertension" }, { "id": "2", "value": "plasma cell myeloma" } ], "prescription_types": [ { "id": "2", "value": "Over The Counter" }, { "id": "1", "value": "Prescription" } ], "recalls": [ { "number": "91201096", "date": "19880508", "recall": "Quidem iure eaque eveniet placeat odit architecto. Et pariatur cum ea hic consequatur iste quia. Sed voluptates aliquid voluptate saepe quae optio. Aut voluptas quia rerum. Quia unde vel hic quasi assumenda officia.", "lots": "Lot Number: 54014927, Exp 06 / 28 / 1983" } ], "effectiveness_percentage": 0.18, "insurance_coverage_percentage": 0.64, "total_reviews": 11 } ### Get Drug [GET] + Response 200 [Drug][] ## Drug Review [/drugs/{id}/reviews] + Parameters + id: `1` (required, integer) - The drug ID + Model + Headers Content-Type: application/json + Body { "total": 45, "per_page": 15, "current_page": 2, "last_page": 1, "next_page_url": "https://antidote.symplicity-opensource.com/api/drugs/5/reviews?page=3", "prev_page_url": "https://antidote.symplicity-opensource.com/api/drugs/5/reviews?page=1", "from": 16, "to": 30, "data": [ { "id": 1514, "rating": 3, "is_covered_by_insurance": 1, "comment": "Tylenol hurt my liver a lot", "created_at": "2015-06-23 02:57:19", "upvotes": 24, "downvotes": 26, "gender": "m", "side_effects": [ { "id": 1, "value": "nausea" }, { "id": 2, "value": "diarrhea" } ] }, { "id": 1514, "rating": 3, "is_covered_by_insurance": 1, "comment": "Makes you sleepy", "created_at": "2015-06-23 02:57:19", "upvotes": 400, "downvotes": 100, "gender": "m", "side_effects": [ { "id": 1, "value": "Nausea" } ] } ] } ### List All [GET /drugs/{id}/reviews{?page,limit,min_age,max_age,gender}] Returns a list of all reviews for a drug. The reviews are returned in created date descending order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/drugs/1/reviews ``` + Parameters + id: `1` (required, integer) - The drug ID + min_age: `18` (optional, integer) - The minimum age of the reviewer + max_age: `35` (optional, integer) - The maximum age of the reviewer + gender: `f` (optional, string) - The gender of the reviewer - either f or m + page: `1` (optional, integer) - Page number + limit: `25` (optional, integer) - The maximum number of drug reviews to return, up to `500` + Default: `15` + Response 200 [Drug Review][] ### Create New [POST /drugs/{id}/reviews] Create a new drug review using this action. It takes a JSON object containing the following fields: - rating: `3` (required, integer) - The rating the user gave the drug either 1, 2, 3 - 3 is best - is_covered_by_insurance: `1` (integer, required) - Was the drug covered by insurance? - comment: `My pain has subsided considerably since I started taking this.` (text, optional) - User comments - side_effects: `[1,2,3]` (array, optional) - Side effects experienced by the user + Authentication: bearer + Parameters + id: `1` (required, integer) - The drug ID + Request + Headers Content-Type: application/json + Body { "rating": "3", "is_covered_by_insurance": "1", "comment": "My pain has subsided considerably since I started taking this.", "side_effects": [1,2,3] } + Response 201 + Headers Content-Type: application/json + Body { "age": 82, "rating": "3", "comment": "My pain has subsided considerably since I started taking this.", "is_covered_by_insurance": "1", "created_at": "2015-06-29 16:01:00", "id": 503, "upvotes": 0, "downvotes": 0 } + Response 400 + Headers Content-Type: application/json + Body { "message": { "rating": [ "The rating field is required." ] } } ## Drug Alternative [/drugs/{id}/alternatives] ### List All [GET /drugs/{id}/alternatives{?page,limit}] Returns a list of all alternative drugs for a drug. The drugs are returned in alphabetically sorted order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/drugs/1/alternatives ``` + Parameters + id: `1` (required, integer) - The drug ID + page: `2` (integer, optional) - Page number + limit: `25` (integer, optional) - The maximum number of drug alternatives to return, up to `50` + Default: `15` + Response 200 [Drugs][] ## Voting [/drug-reviews/{id}/vote] ### Create New [POST /drug-reviews/{id}/vote] Vote on a drug review using this action. It takes a JSON object containing the following field: - vote: `1` (required, integer) - The user's vote - either 1 for upvote, or -1 for downvote + Authentication: bearer + Parameters + id: `1` (required, integer) - The drug review ID + Request + Headers Content-Type: application/json + Body { "vote": "1" } + Response 201 + Headers Content-Type: application/json + Body { "id": "2", "user_id": "1", "drug_review_id": "1", "vote": 1, "created_at": "2015-06-29 14:51:47", "updated_at": "2015-06-29 14:51:47" } + Response 400 + Body { "message": "You've already voted on this review!" } ## Autocomplete [/autocomplete/drugs] You can use the autocomplete API on various resources to get an optimized list of id and value pairs. ## Drugs [GET /autocomplete/drugs{?term,limit}] Returns an array of drugs whose label or generic name starts with the value specified in the term parameter. The drugs are returned in alphabetically sorted order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/autocomplete/drugs?term=Tyl ``` + Parameters + term: `Tyl` (string, optional) - Search for a drug by label or generic name matching the term + limit: `25` (integer, optional) - The maximum number of drugs to return, up to `500` + Default: `15` + Response 200 [ { "id": "3", "label": "Tylenol", "generic": "Acetaminophen" }, { "id": "16", "label": "Tylenol III", "generic": "Codeine" } ]
# Group Drugs With the drugs API you can retrieve information and reviews on individual drugs as well as list all drugs. ## Drugs [/drugs] + Model + Headers Content-Type: application/json + Body { "total": 150, "per_page": 15, "current_page": 2, "last_page": 10, "next_page_url": "https://antidote.symplicity-opensource.com/api/drugs?page=3", "prev_page_url": "https://antidote.symplicity-opensource.com/api/drugs?page=1", "from": 16, "to": 30, "data": [ { "id": "23", "label": "Tylenol" }, { "id": "31", "label": "Tylenol III" } ] } ### List [GET /drugs{?term,page,limit}] Returns a list of all drugs. The drugs are returned in alphabetically sorted order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/drugs?keywords=Tylenol ``` + Parameters + term: `a` (string, optional) - Search for a drug by label matching the term + page: `1` (integer, optional) - Page number of drugs + limit: `25` (integer, optional) - The maximum number of drugs to return, up to `500` + Default: `15` + Response 200 [Drugs][] ## Drug [/drugs/{id}] + Parameters + id: `1` (required, integer) - The drug ID + Model + Headers Content-Type: application/json + Body { "id": 1, "label": "Tylenol", "description": "Tylenol is used to treat pain.", "drug_forms": [ "Disintegrating Oral Tablet", "Oral Capsule" ], "side_effects": [ { "id": 1, "value": "Nausea" }, { "id": 2, "value": "Diarrhea" } ], "generic_id": 45, "indications": [ { "id": "1", "value": "pulmonary arterial hypertension" }, { "id": "2", "value": "plasma cell myeloma" } ], "prescription_types": [ { "id": "2", "value": "Over The Counter" }, { "id": "1", "value": "Prescription" } ], "recalls": [ { "number": "91201096", "date": "19880508", "recall": "Quidem iure eaque eveniet placeat odit architecto. Et pariatur cum ea hic consequatur iste quia. Sed voluptates aliquid voluptate saepe quae optio. Aut voluptas quia rerum. Quia unde vel hic quasi assumenda officia.", "lots": "Lot Number: 54014927, Exp 06 / 28 / 1983" } ], "effectiveness_percentage": 0.18, "insurance_coverage_percentage": 0.64, "total_reviews": 11 } ### Get Drug [GET] + Response 200 [Drug][] ## Drug Review [/drugs/{id}/reviews] + Parameters + id: `1` (required, integer) - The drug ID + Model + Headers Content-Type: application/json + Body { "total": 45, "per_page": 15, "current_page": 2, "last_page": 1, "next_page_url": "https://antidote.symplicity-opensource.com/api/drugs/5/reviews?page=3", "prev_page_url": "https://antidote.symplicity-opensource.com/api/drugs/5/reviews?page=1", "from": 16, "to": 30, "data": [ { "id": 1514, "rating": 3, "is_covered_by_insurance": 1, "comment": "Tylenol hurt my liver a lot", "created_at": "2015-06-23 02:57:19", "upvotes": 24, "downvotes": 26, "gender": "m", "side_effects": [ { "id": 1, "value": "nausea" }, { "id": 2, "value": "diarrhea" } ] }, { "id": 1514, "rating": 3, "is_covered_by_insurance": 1, "comment": "Makes you sleepy", "created_at": "2015-06-23 02:57:19", "upvotes": 400, "downvotes": 100, "gender": "m", "side_effects": [ { "id": 1, "value": "Nausea" } ] } ] } ### List All [GET /drugs/{id}/reviews{?page,limit,min_age,max_age,gender}] Returns a list of all reviews for a drug. The reviews are returned in created date descending order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/drugs/1/reviews ``` + Parameters + id: `1` (required, integer) - The drug ID + min_age: `18` (optional, integer) - The minimum age of the reviewer + max_age: `35` (optional, integer) - The maximum age of the reviewer + gender: `f` (optional, string) - The gender of the reviewer - either f or m + page: `1` (optional, integer) - Page number + limit: `25` (optional, integer) - The maximum number of drug reviews to return, up to `500` + Default: `15` + Response 200 [Drug Review][] ### Create New [POST /drugs/{id}/reviews] Create a new drug review using this action. It takes a JSON object containing the following fields: - rating: `3` (integer, required) - The rating the user gave the drug either 1, 2, 3 - 3 is best - is_covered_by_insurance: `1` (integer, required) - Was the drug covered by insurance? - comment: `My pain has subsided considerably since I started taking this.` (text, optional) - User comments - side_effects: `[1,2,3]` (array, optional) - Side effects experienced by the user + Authentication: bearer + Parameters + id: `1` (required, integer) - The drug ID + Request + Headers Content-Type: application/json + Body { "rating": "3", "is_covered_by_insurance": "1", "comment": "My pain has subsided considerably since I started taking this.", "side_effects": [1,2,3] } + Response 201 + Headers Content-Type: application/json + Body { "age": 82, "rating": "3", "comment": "My pain has subsided considerably since I started taking this.", "is_covered_by_insurance": "1", "created_at": "2015-06-29 16:01:00", "id": 503, "upvotes": 0, "downvotes": 0 } + Response 422 + Headers Content-Type: application/json + Body { "message": { "rating": [ "Effectiveness is required, Insurance coverage is required" ] } } ## Drug Alternative [/drugs/{id}/alternatives] ### List All [GET /drugs/{id}/alternatives{?page,limit}] Returns a list of all alternative drugs for a drug. The drugs are returned in alphabetically sorted order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/drugs/1/alternatives ``` + Parameters + id: `1` (required, integer) - The drug ID + page: `2` (integer, optional) - Page number + limit: `25` (integer, optional) - The maximum number of drug alternatives to return, up to `50` + Default: `15` + Response 200 [Drugs][] ## Voting [/drug-reviews/{id}/vote] ### Create New [POST /drug-reviews/{id}/vote] Vote on a drug review using this action. It takes a JSON object containing the following field: - vote: `1` (required, integer) - The user's vote - either 1 for upvote, or -1 for downvote + Authentication: bearer + Parameters + id: `1` (required, integer) - The drug review ID + Request + Headers Content-Type: application/json + Body { "vote": "1" } + Response 201 + Headers Content-Type: application/json + Body { "id": "2", "user_id": "1", "drug_review_id": "1", "vote": 1, "created_at": "2015-06-29 14:51:47", "updated_at": "2015-06-29 14:51:47" } + Response 400 + Body { "message": "You've already voted on this review!" } ## Autocomplete [/autocomplete/drugs] You can use the autocomplete API on various resources to get an optimized list of id and value pairs. ## Drugs [GET /autocomplete/drugs{?term,limit}] Returns an array of drugs whose label or generic name starts with the value specified in the term parameter. The drugs are returned in alphabetically sorted order. Example: ```no-highlight https://antidote.symplicity-opensource.com/api/autocomplete/drugs?term=Tyl ``` + Parameters + term: `Tyl` (string, optional) - Search for a drug by label or generic name matching the term + limit: `25` (integer, optional) - The maximum number of drugs to return, up to `500` + Default: `15` + Response 200 [ { "id": "3", "label": "Tylenol", "generic": "Acetaminophen" }, { "id": "16", "label": "Tylenol III", "generic": "Codeine" } ]
update api docs to use new 422 validation response code
update api docs to use new 422 validation response code
API Blueprint
mit
Symplicity/antidote,Symplicity/antidote,Symplicity/antidote,Symplicity/antidote
b5552b860f5652d803bebeef39d603822b588b60
xos/tests/api/apiary.apib
xos/tests/api/apiary.apib
FORMAT: 1A # XOS # Group Example ## Example Services Collection [/api/service/exampleservice/] ### List all Example Services [GET] + Response 200 (application/json) [ { "humanReadableName": "MyExample", "id": 1, "service_message": "This is the test message" } ] # Group ONOS Services ## ONOS Services Collection [/api/service/onos/] ### List all ONOS Services [GET] + Response 200 (application/json) [ { "humanReadableName": "service_ONOS_vBNG", "id": 5, "rest_hostname": "", "rest_port": "8181", "no_container": false, "node_key": "" } ] # Group vSG ## vSG Collection [/api/service/vsg/] ### List all vSGs [GET] + Response 200 (application/json) [ { "humanReadableName": "service_vsg", "id": 2, "wan_container_gateway_ip": "", "wan_container_gateway_mac": "", "dns_servers": "8.8.8.8", "url_filter_kind": null, "node_label": null } ] # Group Subscribers Resource related to the CORD Subscribers. ## Subscribers Collection [/api/tenant/cord/subscriber/] ### List All Subscribers [GET] + Response 200 (application/json) [ { "humanReadableName": "cordSubscriber-1", "id": 1, "features": { "cdn": false, "uplink_speed": 1000000000, "downlink_speed": 1000000000, "uverse": false, "status": "enabled" }, "identity": { "account_num": "123", "name": "My House" }, "related": { "instance_name": "mysite_vcpe", "vsg_id": 4, "compute_node_name": "node2.opencloud.us", "c_tag": "432", "instance_id": 1, "wan_container_ip": null, "volt_id": 3, "s_tag": "222" } } ] ## Subscriber Detail [/api/tenant/cord/subscriber/{subscriber_id}/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer ### View a Subscriber Detail [GET] + Response 200 (application/json) { "humanReadableName": "cordSubscriber-1", "id": 1, "features": { "cdn": false, "uplink_speed": 1000000000, "downlink_speed": 1000000000, "uverse": false, "status": "enabled" }, "identity": { "account_num": "123", "name": "My House" }, "related": { "instance_name": "mysite_vcpe", "vsg_id": 4, "compute_node_name": "node2.opencloud.us", "c_tag": "432", "instance_id": 1, "wan_container_ip": null, "volt_id": 3, "s_tag": "222" } } ### Delete a Subscriber [DELETE] + Response 204 ### Subscriber features [/api/tenant/cord/subscriber/{subscriber_id}/features/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer ### View a Subscriber Features Detail [GET] + Response 200 (application/json) { "cdn": false, "uplink_speed": 1000000000, "downlink_speed": 1000000000, "uverse": true, "status": "enabled" } #### Subscriber features uplink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/uplink_speed/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber uplink_speed [GET] + Response 200 (application/json) { "uplink_speed": 1000000000 } #### Update Subscriber uplink_speed [PUT] + Request 200 (application/json) { "uplink_speed": 1000000000 } + Response 200 (application/json) { "uplink_speed": 1000000000 } #### Subscriber features downlink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/downlink_speed/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber downlink_speed [GET] + Response 200 (application/json) { "downlink_speed": 1000000000 } #### Update Subscriber downlink_speed [PUT] + Request 200 (application/json) { "downlink_speed": 1000000000 } + Response 200 (application/json) { "downlink_speed": 1000000000 } #### Subscriber features cdn [/api/tenant/cord/subscriber/{subscriber_id}/features/cdn/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber cdn [GET] + Response 200 (application/json) { "cdn": false } #### Update Subscriber cdn [PUT] + Request 200 (application/json) { "cdn": false } + Response 200 (application/json) { "cdn": false } #### Subscriber features uverse [/api/tenant/cord/subscriber/{subscriber_id}/features/uverse/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber uverse [GET] + Response 200 (application/json) { "uverse": false } #### Update Subscriber uverse [PUT] + Request 200 (application/json) { "uverse": false } + Response 200 (application/json) { "uverse": false } #### Subscriber features status [/api/tenant/cord/subscriber/{subscriber_id}/features/status/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber status [GET] + Response 200 (application/json) { "status": "enabled" } #### Update Subscriber status [PUT] + Request 200 (application/json) { "status": "enabled" } + Response 200 (application/json) { "status": "enabled" } # Group Truckroll Virtual Truckroll, enable to perform basic test on user connectivity such as ping, traceroute and tcpdump. ## Truckroll Collection [/api/tenant/truckroll/] ### List all Truckroll [GET] + Response 200 (application/json) [ { "humanReadableName": "vTR-tenant-9", "id": 9, "provider_service": 6, "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8", "result": "", "result_code": "", "is_synced": false, "backend_status": "2 - Exception('Unreachable results in ansible recipe',)" } ] ### Create a Truckroll [POST] + Request (application/json) { "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8" } + Response 201 (application/json) { "humanReadableName": "vTR-tenant-1", "id": 1, "provider_service": 6, "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8", "result": null, "result_code": null, "is_synced": false, "backend_status": "0 - Provisioning in progress" } ## Truckroll Detail [/api/tenant/truckroll/{truckroll_id}/] A virtual truckroll is complete once is_synced equal true + Parameters + truckroll_id: 1 (number) - ID of the Truckroll in the form of an integer ### View a Truckroll Detail [GET] + Response 200 (application/json) { "humanReadableName": "vTR-tenant-10", "id": 10, "provider_service": 6, "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8", "result": null, "result_code": null, "is_synced": false, "backend_status": "0 - Provisioning in progress" } ### Delete a Truckroll Detail [DELETE] + Response 204 # Group vOLT OLT devices aggregate a set of subscriber connections ## vOLT Collection [/api/tenant/cord/volt/] ### List all vOLT [GET] + Response 200 (application/json) [ { "humanReadableName": "vOLT-tenant-1", "id": 1, "service_specific_id": "123", "s_tag": "222", "c_tag": "432", "subscriber": 1, "related": { "instance_id": 1, "instance_name": "mysite_vcpe", "vsg_id": 4, "wan_container_ip": null, "compute_node_name": "node2.opencloud.us" } } ] ### Create a vOLT [POST] + Request (application/json) { "s_tag": "222", "c_tag": "432", "subscriber": 1 } + Response 201 (application/json) { "humanReadableName": "vOLT-tenant-1", "id": 1, "service_specific_id": "123", "s_tag": "222", "c_tag": "432", "subscriber": 1, "related": { "instance_id": 1, "instance_name": "mysite_vcpe", "vsg_id": 4, "wan_container_ip": null, "compute_node_name": "node2.opencloud.us" } } ## vOLT Detail [/api/tenant/cord/volt/{volt_id}/] A virtual volt is complete once is_synced equal true + Parameters + volt_id: 1 (number) - ID of the vOLT in the form of an integer ### View a vOLT Detail [GET] + Response 200 (application/json) { "humanReadableName": "vOLT-tenant-1", "id": 1, "service_specific_id": "123", "s_tag": "222", "c_tag": "432", "subscriber": 1, "related": { "instance_id": 1, "instance_name": "mysite_vcpe", "vsg_id": 4, "wan_container_ip": null, "compute_node_name": "node2.opencloud.us" } } # Group ONOS Apps ## app Collection [/api/tenant/onos/app/] ### List all apps [GET] + Response 200 (application/json) [ { "humanReadableName": "onos-tenant-7", "id": 7, "name": "vBNG_ONOS_app", "dependencies": "org.onosproject.proxyarp, org.onosproject.virtualbng, org.onosproject.openflow, org.onosproject.fwd" } ]
FORMAT: 1A # XOS # Group Example ## Example Services Collection [/api/service/exampleservice/] ### List all Example Services [GET] + Response 200 (application/json) [ { "humanReadableName": "MyExample", "id": 1, "service_message": "This is the test message" } ] # Group ONOS Services ## ONOS Services Collection [/api/service/onos/] ### List all ONOS Services [GET] + Response 200 (application/json) [ { "humanReadableName": "service_ONOS_vBNG", "id": 5, "rest_hostname": "", "rest_port": "8181", "no_container": false, "node_key": "" } ] # Group vSG ## vSG Collection [/api/service/vsg/] ### List all vSGs [GET] + Response 200 (application/json) [ { "humanReadableName": "service_vsg", "id": 2, "dns_servers": "8.8.8.8", "url_filter_kind": null, "node_label": null } ] # Group Subscribers Resource related to the CORD Subscribers. ## Subscribers Collection [/api/tenant/cord/subscriber/] ### List All Subscribers [GET] + Response 200 (application/json) [ { "humanReadableName": "cordSubscriber-1", "id": 1, "features": { "cdn": false, "uplink_speed": 1000000000, "downlink_speed": 1000000000, "uverse": false, "status": "enabled" }, "identity": { "account_num": "123", "name": "My House" }, "related": { "instance_name": "mysite_vcpe", "vsg_id": 4, "compute_node_name": "node2.opencloud.us", "c_tag": "432", "instance_id": 1, "wan_container_ip": null, "volt_id": 3, "s_tag": "222" } } ] ## Subscriber Detail [/api/tenant/cord/subscriber/{subscriber_id}/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer ### View a Subscriber Detail [GET] + Response 200 (application/json) { "humanReadableName": "cordSubscriber-1", "id": 1, "features": { "cdn": false, "uplink_speed": 1000000000, "downlink_speed": 1000000000, "uverse": false, "status": "enabled" }, "identity": { "account_num": "123", "name": "My House" }, "related": { "instance_name": "mysite_vcpe", "vsg_id": 4, "compute_node_name": "node2.opencloud.us", "c_tag": "432", "instance_id": 1, "wan_container_ip": null, "volt_id": 3, "s_tag": "222" } } ### Delete a Subscriber [DELETE] + Response 204 ### Subscriber features [/api/tenant/cord/subscriber/{subscriber_id}/features/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer ### View a Subscriber Features Detail [GET] + Response 200 (application/json) { "cdn": false, "uplink_speed": 1000000000, "downlink_speed": 1000000000, "uverse": true, "status": "enabled" } #### Subscriber features uplink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/uplink_speed/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber uplink_speed [GET] + Response 200 (application/json) { "uplink_speed": 1000000000 } #### Update Subscriber uplink_speed [PUT] + Request 200 (application/json) { "uplink_speed": 1000000000 } + Response 200 (application/json) { "uplink_speed": 1000000000 } #### Subscriber features downlink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/downlink_speed/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber downlink_speed [GET] + Response 200 (application/json) { "downlink_speed": 1000000000 } #### Update Subscriber downlink_speed [PUT] + Request 200 (application/json) { "downlink_speed": 1000000000 } + Response 200 (application/json) { "downlink_speed": 1000000000 } #### Subscriber features cdn [/api/tenant/cord/subscriber/{subscriber_id}/features/cdn/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber cdn [GET] + Response 200 (application/json) { "cdn": false } #### Update Subscriber cdn [PUT] + Request 200 (application/json) { "cdn": false } + Response 200 (application/json) { "cdn": false } #### Subscriber features uverse [/api/tenant/cord/subscriber/{subscriber_id}/features/uverse/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber uverse [GET] + Response 200 (application/json) { "uverse": false } #### Update Subscriber uverse [PUT] + Request 200 (application/json) { "uverse": false } + Response 200 (application/json) { "uverse": false } #### Subscriber features status [/api/tenant/cord/subscriber/{subscriber_id}/features/status/] + Parameters + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer #### Read Subscriber status [GET] + Response 200 (application/json) { "status": "enabled" } #### Update Subscriber status [PUT] + Request 200 (application/json) { "status": "enabled" } + Response 200 (application/json) { "status": "enabled" } # Group Truckroll Virtual Truckroll, enable to perform basic test on user connectivity such as ping, traceroute and tcpdump. ## Truckroll Collection [/api/tenant/truckroll/] ### List all Truckroll [GET] + Response 200 (application/json) [ { "humanReadableName": "vTR-tenant-9", "id": 9, "provider_service": 6, "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8", "result": "", "result_code": "", "is_synced": false, "backend_status": "2 - Exception('Unreachable results in ansible recipe',)" } ] ### Create a Truckroll [POST] + Request (application/json) { "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8" } + Response 201 (application/json) { "humanReadableName": "vTR-tenant-1", "id": 1, "provider_service": 6, "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8", "result": null, "result_code": null, "is_synced": false, "backend_status": "0 - Provisioning in progress" } ## Truckroll Detail [/api/tenant/truckroll/{truckroll_id}/] A virtual truckroll is complete once is_synced equal true + Parameters + truckroll_id: 1 (number) - ID of the Truckroll in the form of an integer ### View a Truckroll Detail [GET] + Response 200 (application/json) { "humanReadableName": "vTR-tenant-10", "id": 10, "provider_service": 6, "target_id": 2, "scope": "container", "test": "ping", "argument": "8.8.8.8", "result": null, "result_code": null, "is_synced": false, "backend_status": "0 - Provisioning in progress" } ### Delete a Truckroll Detail [DELETE] + Response 204 # Group vOLT OLT devices aggregate a set of subscriber connections ## vOLT Collection [/api/tenant/cord/volt/] ### List all vOLT [GET] + Response 200 (application/json) [ { "humanReadableName": "vOLT-tenant-1", "id": 1, "service_specific_id": "123", "s_tag": "222", "c_tag": "432", "subscriber": 1, "related": { "instance_id": 1, "instance_name": "mysite_vcpe", "vsg_id": 4, "wan_container_ip": null, "compute_node_name": "node2.opencloud.us" } } ] ### Create a vOLT [POST] + Request (application/json) { "s_tag": "222", "c_tag": "432", "subscriber": 1 } + Response 201 (application/json) { "humanReadableName": "vOLT-tenant-1", "id": 1, "service_specific_id": "123", "s_tag": "222", "c_tag": "432", "subscriber": 1, "related": { "instance_id": 1, "instance_name": "mysite_vcpe", "vsg_id": 4, "wan_container_ip": null, "compute_node_name": "node2.opencloud.us" } } ## vOLT Detail [/api/tenant/cord/volt/{volt_id}/] A virtual volt is complete once is_synced equal true + Parameters + volt_id: 1 (number) - ID of the vOLT in the form of an integer ### View a vOLT Detail [GET] + Response 200 (application/json) { "humanReadableName": "vOLT-tenant-1", "id": 1, "service_specific_id": "123", "s_tag": "222", "c_tag": "432", "subscriber": 1, "related": { "instance_id": 1, "instance_name": "mysite_vcpe", "vsg_id": 4, "wan_container_ip": null, "compute_node_name": "node2.opencloud.us" } } # Group ONOS Apps ## app Collection [/api/tenant/onos/app/] ### List all apps [GET] + Response 200 (application/json) [ { "humanReadableName": "onos-tenant-7", "id": 7, "name": "vBNG_ONOS_app", "dependencies": "org.onosproject.proxyarp, org.onosproject.virtualbng, org.onosproject.openflow, org.onosproject.fwd" } ]
remove fields that are no longer present in vSG service
remove fields that are no longer present in vSG service
API Blueprint
apache-2.0
zdw/xos,opencord/xos,zdw/xos,opencord/xos,cboling/xos,opencord/xos,cboling/xos,cboling/xos,zdw/xos,cboling/xos,open-cloud/xos,cboling/xos,zdw/xos,open-cloud/xos,open-cloud/xos
7fa8693f1a27be77b7671a206b1c9d8c5e07055f
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 ``` 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/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**.
fix country code
fix country code
API Blueprint
apache-2.0
MeteoGroup/weather-api,MeteoGroup/weather-api
86315105d5ebf9ff7202b496383a39186c8dd712
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-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(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-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 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 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 ## Random content [/share/random{?category,number}] ### Retrieve some pre-populated random content [GET] + Parameters + category (string) - Content category, for example `technology` + number (number) - How many items to retrieve + Response 200 (application/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 ## 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-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(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-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 [POST] 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) --> ``` ## Random content [/share/random{?category,number}] ### Retrieve some pre-populated random content [GET] + Parameters + category (string) - Content category, for example `technology` + number (number) - How many items to retrieve + Response 200 (application/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 ## 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
Document share signing, fixes #60
Document share signing, fixes #60
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
65a485965466959491e80d698231d24b3ece85f2
blueprint/authentication.apib
blueprint/authentication.apib
FORMAT: 1A HOST: https://thegrid.io/ # Authentication The Grid operates an OAuth2 provider that is utilized for all authentication purposes. ### Identity Providers The Grid's authentication system supports multiple identity providers including: * Facebook (facebook) * GitHub (github) * Google (google) * Twitter (twitter) More identity providers are likely to be added later when they are needed. Check back to this document to see the current list. ### Registering an application The Grid authentication is always granted to the combination of a user and an application. To register an application, log into your The Grid account at https://passport.thegrid.io/account Go to the Developer Section of your profile page, and you'll be able to add new OAuth2 client applications. You need the following information: * Application name: name of the application shown to users in the confirmation page * Callback URL: the URL in your application users should be redirected to once they complete their login Once you have registered an application you will get two values from the system: * Application ID: Unique identifier for your application * Application secret: Passphrase your application can use to convert authentication grants to tokens **Note:** never let others see your client secret. Otherwise they will be able to impersonate your The Grid application! ### The OAuth dance When you want to authenticate a user with your The Grid application, you need to first send them to The Grid's login system. For this you need to construct a login URL with the following parts: * Protocol: https * Host: passport.thegrid.io * Path: `/login/authorize/<identity provider (optional, otherwise will show UI to choose provider)>` * Query: * `client_id`: the unique identifier of your application * `response_type`: code * `scope`: comma-separated list of requested scopes * `redirect_uri`: your callback URL Example: <https://passport.thegrid.io/login/authorize/github?client_id=XXXX&response_type=code&scope=share&redirect_uri=http://my.app.url> #### Authentication scopes The default authentication scope will grant you permissions to perform simple operations on behalf of the user. If needed, you can also request additional access to The Grid APIs via OAuth2 scopes. The scopes are added to the authentication request URL with the scope query key. The currently supported scopes include: * `content_management`: manage user's content items on The Grid * `website_management`: manage user's The Grid sites and publish to them * `share`: share new content to The Grid. Also provided by the `content_management` scope * `update_profile`: update the user's profile information * `github`: get access to the user's GitHub access token, if any. This will allow you to use the GitHub API on behalf of the user * `github_private`: get access to the user's GitHub access token authorized to access private repositories, if any. This will allow you to use the GitHub API on behalf of the user * `payment`: make a payment on behalf of the user * `balance`: see user's account balance and transaction history * `cta_management`: manage user's Calls to Action #### Getting a token Once the user completes the authentication process and grants your application access to their account, they will be redirected to the redirect_uri. The redirection will contain an additional query parameter code which contains a one-time access grant. To convert this access grant to an access token you have to make a HTTP POST request with the following URL: * Protocol: https * Host: passport.thegrid.io * Path: /login/authorize/token The payload should be a URL-encoded string containing the following key-value pairs: * `client_id`: the unique identifier of your application * `client_secret`: your application's passphrase * `code`: the access grant you received in the query parameter of your callback URL * `grant_type`: `authorization_code` On a successful code conversion you will receive a JSON-encoded response with an object that will contain the user's access token in the `access_token` key. ### Making authenticated API requests The Grid API calls require authentication unless stated otherwise. This is done using the user's access token via HTTP Bearer Authentication. Bearer authentication works by adding the Authorization header to your HTTP requests with the value `Bearer <access token>`. For example: ``` req.setRequestHeader('Authorization', 'Bearer ' + token); ``` ### The Grid authentication on Node.js The [passport-thegrid](https://www.npmjs.com/package/passport-thegrid) module provides The Grid authentication for [Passport](http://passportjs.org/) enabled Node.js applications.
FORMAT: 1A HOST: https://passport.thegrid.io/ # Authentication The Grid operates an OAuth2 provider that is utilized for all authentication purposes. ### Identity Providers The Grid's authentication system supports multiple identity providers including: * Facebook (facebook) * GitHub (github) * Google (google) * Twitter (twitter) More identity providers are likely to be added later when they are needed. Check back to this document to see the current list. ### Registering an application The Grid authentication is always granted to the combination of a user and an application. To register an application, log into your The Grid account at https://passport.thegrid.io/account Go to the Developer Section of your profile page, and you'll be able to add new OAuth2 client applications. You need the following information: * Application name: name of the application shown to users in the confirmation page * Callback URL: the URL in your application users should be redirected to once they complete their login Once you have registered an application you will get two values from the system: * Application ID: Unique identifier for your application * Application secret: Passphrase your application can use to convert authentication grants to tokens **Note:** never let others see your client secret. Otherwise they will be able to impersonate your The Grid application! ### The OAuth dance When you want to authenticate a user with your The Grid application, you need to first send them to The Grid's login system. For this you need to construct a login URL with the following parts: * Protocol: https * Host: passport.thegrid.io * Path: `/login/authorize/<identity provider (optional, otherwise will show UI to choose provider)>` * Query: * `client_id`: the unique identifier of your application * `response_type`: code * `scope`: comma-separated list of requested scopes * `redirect_uri`: your callback URL Example: <https://passport.thegrid.io/login/authorize/github?client_id=XXXX&response_type=code&scope=share&redirect_uri=http://my.app.url> #### Authentication scopes The default authentication scope will grant you permissions to perform simple operations on behalf of the user. If needed, you can also request additional access to The Grid APIs via OAuth2 scopes. The scopes are added to the authentication request URL with the scope query key. The currently supported scopes include: * `content_management`: manage user's content items on The Grid * `website_management`: manage user's The Grid sites and publish to them * `share`: share new content to The Grid. Also provided by the `content_management` scope * `update_profile`: update the user's profile information * `github`: get access to the user's GitHub access token, if any. This will allow you to use the GitHub API on behalf of the user * `github_private`: get access to the user's GitHub access token authorized to access private repositories, if any. This will allow you to use the GitHub API on behalf of the user * `payment`: make a payment on behalf of the user * `balance`: see user's account balance and transaction history * `cta_management`: manage user's Calls to Action #### Getting a token Once the user completes the authentication process and grants your application access to their account, they will be redirected to the redirect_uri. The redirection will contain an additional query parameter code which contains a one-time access grant. To convert this access grant to an access token you have to make a HTTP POST request with the following URL: * Protocol: https * Host: passport.thegrid.io * Path: /login/authorize/token The payload should be a URL-encoded string containing the following key-value pairs: * `client_id`: the unique identifier of your application * `client_secret`: your application's passphrase * `code`: the access grant you received in the query parameter of your callback URL * `grant_type`: `authorization_code` On a successful code conversion you will receive a JSON-encoded response with an object that will contain the user's access token in the `access_token` key. ### Making authenticated API requests The Grid API calls require authentication unless stated otherwise. This is done using the user's access token via HTTP Bearer Authentication. Bearer authentication works by adding the Authorization header to your HTTP requests with the value `Bearer <access token>`. For example: ``` req.setRequestHeader('Authorization', 'Bearer ' + token); ``` ### The Grid authentication on Node.js The [passport-thegrid](https://www.npmjs.com/package/passport-thegrid) module provides The Grid authentication for [Passport](http://passportjs.org/) enabled Node.js applications.
Fix authentication host.
Fix authentication host.
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
b15477cdcba28ec8e956df3370e66a10dbdbf5c4
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) { "message": "Content-Type \"undefined\" is not supported. Supported MIME types: text/vnd.apiblueprint, text/vnd.legacyblueprint, application/swagger" } + 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) { "message": "None of requested Content-Types \"application/vnd.apiblueprint.parseresult+json; version=2.2\" is supported. Supported MIME types: application/vnd.refract.parse-result, application/vnd.refract.parse-result; version=0.6, application/vnd.refract.parse-result; version=1.0, application/vnd.refract.parse-result+json, application/vnd.refract.parse-result+json; version=0.6, application/vnd.refract.parse-result+json; version=1.0, application/vnd.refract.parse-result+yaml, application/vnd.refract.parse-result+yaml; version=0.6, application/vnd.refract.parse-result+yaml; version=1.0" }
## 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) { "message": "Content-Type \"undefined\" is not supported. Supported MIME types: text/vnd.apiblueprint, text/vnd.legacyblueprint, application/swagger" } + 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) { "message": "None of requested Content-Types \"application/vnd.apiblueprint.parseresult+json; version=2.2\" is supported. Supported MIME types: application/vnd.refract.parse-result, application/vnd.refract.parse-result; version=0.6, application/vnd.refract.parse-result; version=1.0, application/vnd.refract.parse-result+json, application/vnd.refract.parse-result+json; version=0.6, application/vnd.refract.parse-result+json; version=1.0, application/vnd.refract.parse-result+yaml, application/vnd.refract.parse-result+yaml; version=0.6, application/vnd.refract.parse-result+yaml; version=1.0" }
Use Content-Type to demonstate invalid input type (#33)
Use Content-Type to demonstate invalid input type (#33) Use Content-Type to demonstate invalid input type
API Blueprint
mit
apiaryio/api.apiblueprint.org,apiaryio/api.apiblueprint.org
fadf160ed93f4507e713ce9b18b94cbc7617e83f
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**. ## 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/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", "content":[ { "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/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 related resources of the **Money Advice Service**. ## 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", "content":[ { "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>" }
Add canonical link headers to api blueprint
Add canonical link headers to api blueprint
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
cb429af81cc22ea4b79f7f4f7dcfad8de690db37
apiary.apib
apiary.apib
HOST: http://dash.fcolors.ru/api/v1/ --- Go python3 --- --- Public API of [GoPython3](http://gopython3.com) Currently it's alpha, so expect changes. --- -- Job Resources -- List all jobs, that we ever processed (or are processing) GET /jobs/ < 200 < Content-Type: application/json { "items": [ { "id": 1, "url": "/job/1/", "status": "completed", "created_at": "2013-09-28T02:15:15Z", "updated_at": "2013-09-28T02:15:15Z", "started_at": "2013-09-28T03:15:15Z", "finished_at": "2013-09-28T04:15:15Z" }, { "id": 2, "url": "/job/2/", "status": "running", "created_at": "2013-09-28T02:18:15Z", "updated_at": "2013-09-28T02:15:15Z", "started_at": "2013-09-28T03:18:15Z", "finished_at": null }, { "id": 3, "url": "/job/3/", "status": "pending", "created_at": "2013-09-28T02:15:15Z", "updated_at": "2013-09-28T02:15:15Z", "started_at": null, "finished_at": null } ]} Process your requirements to add new job POST /jobs/ > Content-Type: application/json { "requirements": "django==1.4.3\ndjango-storages\ndjango-compressor==1.1.2"} < 201 < Content-Type: application/json { "status": "created", "url": "http://127.0.0.1:8000/jobs/2/" } Job instance, listing containing packages python3 support. Values update while the job is running. GET /jobs/{id}/ < 200 < Content-Type: application/json { "url": "/job/2/", "status": "running", "gopy3": null, "created_at": "2013-09-28T02:15:15Z", "updated_at": "2013-09-28T03:15:15Z", "started_at": "2013-09-28T03:15:15Z", "finished_at": null, "packages": [ { "id": "django/1.4.3", "url": "http://127.0.0.1:8000/packages/django/1.4.3/", "name": "django", "version": "1.4.3", "status": "completed", "created_at": "2013-09-28T02:15:16Z", "updated_at": "2013-09-28T03:22:18Z", "finished_at": "2013-09-28T03:22:18Z" }, { "id": "django-storages", "url": "http://127.0.0.1:8000/packages/django-storages/", "name": "django-storages", "version": null, "status": "running", "created_at": "2013-09-28T02:15:16Z", "updated_at": "2013-09-28T03:22:35Z", "finished_at": null }, { "id": "django_compressor/1.1.2", "url": "http://127.0.0.1:8000/packages/django_compressor/1.1.2/", "name": "django-compressor", "version": "1.1.2", "status": "pending", "created_at": "2013-09-28T02:15:16Z", "updated_at": null, "finished_at": null } ] } -- Packages Resources -- Python 3 support status for single package. For now we'll check only latest version available on PyPI and in repo. List view is not avaliable yet. GET /packages/{id}/{version} < 200 < Content-Type: application/json { "id": "django_compressor/1.3", "url": "http://127.0.0.1:8000/packages/django_compressor/1.3/", "name": "django-compressor", "version": "1.3", "gopy3": "B", "status": "completed", "created_at": "2013-09-28T02:15:16Z", "updated_at": "2013-09-28T03:22:35Z", "pypi": { "current": { "url": "https://pypi.python.org/pypi/django_compressor/1.3/", "version": "1.3", "python3": ["3.3"], "release_date": "2013-09-22T01:56:12Z" }, "latest": { "url": "https://pypi.python.org/pypi/django_compressor/1.3/", "version": "1.3", "python3": ["3.3"], "release_date": "2013-09-22T01:56:12Z" } }, "repo": { "url": "https://github.com/jezdez/django_compressor", "last_commit_date": "2013-09-22T01:56:12Z" }, "issues": [{ "url": "https://github.com/jezdez/django_compressor/issues/360", "status": "closed" }], "forks": [], "ci": { "url": "https://travis-ci.org/jezdez/django_compressor", "status": "passing" }, "comments": { "count": 1, "most_voted": "Enlarge your python!" } }
HOST: http://dash.fcolors.ru/api/v1/ --- Go python3 --- --- Public API of [GoPython3](http://gopython3.com) Currently it's alpha, so expect changes. --- -- Job Resources -- List all jobs, that we ever processed (or are processing) GET /jobs/ < 200 < Content-Type: application/json { "items": [ { "id": 1, "url": "/job/1/", "status": "completed", "created_at": "2013-09-28T02:15:15Z", "updated_at": "2013-09-28T02:15:15Z", "started_at": "2013-09-28T03:15:15Z", "finished_at": "2013-09-28T04:15:15Z" }, { "id": 2, "url": "/job/2/", "status": "running", "created_at": "2013-09-28T02:18:15Z", "updated_at": "2013-09-28T02:15:15Z", "started_at": "2013-09-28T03:18:15Z", "finished_at": null }, { "id": 3, "url": "/job/3/", "status": "pending", "created_at": "2013-09-28T02:15:15Z", "updated_at": "2013-09-28T02:15:15Z", "started_at": null, "finished_at": null } ]} Process your requirements to add new job POST /jobs/ > Content-Type: application/json { "requirements": "django==1.4.3\ndjango-storages\ndjango-compressor==1.1.2"} < 201 < Content-Type: application/json { "status": "created", "url": "http://127.0.0.1:8000/jobs/2/" } Job instance, listing containing packages python3 support. Values update while the job is running. GET /jobs/{id}/ < 200 < Content-Type: application/json { "url": "/job/2/", "status": "running", "gopy3": null, "created_at": "2013-09-28T02:15:15Z", "updated_at": "2013-09-28T03:15:15Z", "started_at": "2013-09-28T03:15:15Z", "finished_at": null, "packages": [ { "id": "django/1.4.3", "url": "http://127.0.0.1:8000/packages/django/1.4.3/", "name": "django", "version": "1.4.3", "status": "completed", "created_at": "2013-09-28T02:15:16Z", "updated_at": "2013-09-28T03:22:18Z", "finished_at": "2013-09-28T03:22:18Z" }, { "id": "django-storages", "url": "http://127.0.0.1:8000/packages/django-storages/", "name": "django-storages", "version": null, "status": "running", "created_at": "2013-09-28T02:15:16Z", "updated_at": "2013-09-28T03:22:35Z", "finished_at": null }, { "id": "django_compressor/1.1.2", "url": "http://127.0.0.1:8000/packages/django_compressor/1.1.2/", "name": "django-compressor", "version": "1.1.2", "status": "pending", "created_at": "2013-09-28T02:15:16Z", "updated_at": null, "finished_at": null } ] } -- Packages Resources -- Python 3 support status for single package. For now we'll check only latest version available on PyPI and in repo. List view is not avaliable yet. GET /packages/{id}/{version}/ < 200 < Content-Type: application/json { "id": "django_compressor/1.3", "url": "http://127.0.0.1:8000/packages/django_compressor/1.3/", "name": "django-compressor", "version": "1.3", "gopy3": "B", "status": "completed", "created_at": "2013-09-28T02:15:16Z", "updated_at": "2013-09-28T03:22:35Z", "pypi": { "current": { "url": "https://pypi.python.org/pypi/django_compressor/1.3/", "version": "1.3", "python3": ["3.3"], "release_date": "2013-09-22T01:56:12Z" }, "latest": { "url": "https://pypi.python.org/pypi/django_compressor/1.3/", "version": "1.3", "python3": ["3.3"], "release_date": "2013-09-22T01:56:12Z" } }, "repo": { "url": "https://github.com/jezdez/django_compressor", "last_commit_date": "2013-09-22T01:56:12Z" }, "issues": [{ "url": "https://github.com/jezdez/django_compressor/issues/360", "status": "closed" }], "forks": [], "ci": { "url": "https://travis-ci.org/jezdez/django_compressor", "status": "passing" }, "comments": { "count": 1, "most_voted": "Enlarge your python!" } }
Change package API
Change package API
API Blueprint
mit
futurecolors/gopython3,futurecolors/gopython3,futurecolors/gopython3
3bf5e6fb3ec18cb40d6185f7456135847718f281
apiary.apib
apiary.apib
FORMAT: 1A HOST: https://api-galaxy.dev.mozaws.net # Galaxy API ## Current Version By default, all requests receive the __v1__ version of the API. We encourage you to explicitly request this version via the `Accept` header. Accept: application/vnd.galaxy.v1+json # Group Game Game related resources of the **Galaxy API** ## Game [/games/{game_slug}] ### Get details of a game [GET] + Parameter + game_slug (required, string, `pokemon`) ... `game_slug` of the game to fetch detail of. + Response 200 (application/json) { "app_url": "http://www.fullscreenpokemon.com/", "slug": "pokemon", "description": "Full Screen Pokemon is an open source HTML5 remake of the original Pokemon games. You can play the original two generations (Red/Blue through Crystal), literally billions of procedurally generated maps, or create your own using the level editor.", "name": "Pok\u00e9mon" } # Group Leaderboard ## Leaderboard [/game/{game_slug}/boards/{board_slug}] + Parameters + game_slug (string, `mario-bros`) ... The slug of the Game. + board_slug (string, `warios-smashed`) ... The slug of the Leaderboard. + Model (application/json) ```js { "data": [ { "user": "cvan", "score": 100 }, { "user": "david", "score": 705 }, { "user": "wil", "score": 340 }, ], "name": "Warios Smashed", "slug": "warios-smashed" } ``` ### Retrieve a Leaderboard [GET] Returns a specific Leaderboard. + Response 200 (application/json) [Leaderboard][] ### Delete a Leaderboard [DELETE] Delete a Leaderboard. The current user must be the same user who created the Leaderboard (or be an admin). + Response 200 (application/json) ```js { "success": "true" } ``` ### Update a Leaderboard [PATCH] Update the `name` and `slug` for the Leaderboard. Coming soon. + Request (application/json) [Leaderboard][] + Response 200 (application/json) ```js { "success": "true" } ``` ## Leaderboard Score [/game/{game_slug}/boards/{board_slug}/scores] + Parameters + game_slug (string, `mario-bros`) ... The slug of the Game. + board_slug (string, `warios-smashed`) ... The slug of the Leaderboard. ### Add a Score [POST] Updates the score for a Leaderboard board for a particular game. + Request (application/json) ```js { "value": 5.0 } ``` + Response 200 (application/json) ```js { "success": "true" } ``` ## Leaderboard Collection [/game/{game_slug}/boards] A collection of Leaderboards. + Model (application/json) ```js [ { "data": [ { "user": 1, "score": 100 }, { "user": 5, "score": 705 }, { "user": 9, "score": 340 }, ... ], "name": "Warios Smashed", "slug": "warios-smashed" }, ... ] ``` ### Create a Leaderboard [POST] To create a new Leaderboard object simply provide a JSON blob of the `name` and `slug` attributes for the new Leaderboard. + Request (application/json) ```js { "name": "Name of Leaderboard", "string": "Slug of Leaderboard" } ``` + Response 200 (application/json) ```js { "success": "true" } ``` ### Retrieve all Leaderboards [GET] Returns a list of the Leaderboards available for a particular game. + Response 200 (application/json) [Leaderboard Collection][]
FORMAT: 1A HOST: https://api-galaxy.dev.mozaws.net # Galaxy API ## Current Version By default, all requests receive the __v1__ version of the API. We encourage you to explicitly request this version via the `Accept` header. Accept: application/vnd.galaxy.v1+json # Group Game ## Game [/game/{game_slug}] + Parameters + game_slug (string, `pokemon`) ... The slug of the Game. + Model (application/json) ```js { "app_url": "http://www.fullscreenpokemon.com/", "slug": "pokemon", "description": "Full Screen Pokemon is an open source HTML5 remake of the original Pokemon games. You can play the original two generations (Red/Blue through Crystal), literally billions of procedurally generated maps, or create your own using the level editor.", "name": "Pok\u00e9mon" } ``` ### Retrieve a Game [GET] Returns a specific Game. + Response 200 (application/json) [Game][] ### Delete a Game [DELETE] Delete a Game. The current user must be the same user who created the Game (or be an admin). + Response 200 (application/json) ```js { "success": true } ``` ### Update a Game [PATCH] Update the fields of the Game. + Request (application/json) [Game][] + Response 200 (application/json) ```js { "success": true } ``` ## Game Collection [/games] A collection of Games. + Model (application/json) ```js [ { "app_url": "http://www.fullscreenpokemon.com/", "slug": "pokemon", "description": "Full Screen Pokemon is an open source HTML5 remake of the original Pokemon games. You can play the original two generations (Red/Blue through Crystal), literally billions of procedurally generated maps, or create your own using the level editor.", "name": "Pok\u00e9mon" }, ... ] ``` ### Create a Game [POST] To create a new Game object simply provide a JSON blob of the attributes of the new Game. + Request (application/json) [Game][] + Response 200 (application/json) ```js { "success": true } ``` ### Retrieve all Games [GET] Returns a list of the Games available for a particular game. + Response 200 (application/json) [Game Collection][] # Group Leaderboard ## Leaderboard [/game/{game_slug}/boards/{board_slug}] + Parameters + game_slug (string, `pokemon`) ... The slug of the Game. + board_slug (string, `pokeballs-collected`) ... The slug of the Leaderboard. + Model (application/json) ```js { "slug": "pokeballs-collected", "description": "This keeps track of how many pok\u00e9balls a user finds.", "name": "Pok\u00e9balls Collected" } ``` ### Retrieve a Leaderboard [GET] Returns a specific Leaderboard. + Response 200 (application/json) [Leaderboard][] ### Delete a Leaderboard [DELETE] Delete a Leaderboard. The current user must be the same user who created the Leaderboard (or be an admin). + Response 200 (application/json) ```js { "success": true } ``` ### Update a Leaderboard [PATCH] Update the fields of the Leaderboard. + Request (application/json) [Leaderboard][] + Response 200 (application/json) ```js { "success": true } ``` ## Leaderboard Score [/game/{game_slug}/boards/{board_slug}/scores] + Parameters + game_slug (string, `pokemon`) ... The slug of the Game. + board_slug (string, `pokeballs-collected`) ... The slug of the Leaderboard. ### Add a Score [POST] Updates the score for a Leaderboard board for a particular game. + Request (application/json) ```js { "user": "cvan" "score": 50 } ``` + Response 200 (application/json) ```js { "success": true } ``` ### Retrieve all Scores [GET] + Response 200 (application/json) ```js [ { "member": "rick", "score": "101" }, { "member": "mark", "score": "99" }, { "member": "toby", "score": "84" }, { "member": "david", "score": "72" }, { "member": "cvan", "score": "50" }, { "member": "bill", "score": "39" }, { "member": "wil", "score": "4" } ] ``` ## Leaderboard Collection [/game/{game_slug}/boards] A collection of Leaderboards. + Model (application/json) ```js [ { "slug": "pokeballs-collected", "description": "This keeps track of how many pok\u00e9balls a user finds.", "name": "Pok\u00e9balls Collected" }, ... ] ``` ### Create a Leaderboard [POST] To create a new Leaderboard object simply provide a JSON blob of the attributes of the new Leaderboard. + Request (application/json) ```js { "name": "Name of Leaderboard", "string": "Slug of Leaderboard" } ``` + Response 200 (application/json) ```js { "success": true } ``` ### Retrieve all Leaderboards [GET] Returns a list of the Leaderboards available for a particular game. + Response 200 (application/json) [Leaderboard Collection][]
update API docs per revamped game+leaderboard endpoints
update API docs per revamped game+leaderboard endpoints
API Blueprint
bsd-3-clause
mozilla/galaxy-api
d6b50ce89beb9562524b9ac2bb68c8656e518661
apig/testdata/docs/user.apib
apig/testdata/docs/user.apib
# Group Users Welcome to the users API. This API provides access to the users service. ## users [/users] ### Create user [POST] Create a new user + Request user (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Attributes + name: NAME (string) + Response 201 (application/json; charset=utf-8) + Attributes (user, fixed) ### Get users [GET] Returns an user list. + Request (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) + (user) ## user details [/users/{id}] + Parameters + id: `1` (enum[string]) - The ID of the desired user. + Members + `1` + `2` + `3` ### Get user [GET] Returns an user. + Request (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Response 200 (application/json; charset=utf-8) + Attributes (user, fixed) ### Update user [PUT] Update an user. + Request user (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Attributes + name: NAME (string) + Response 200 (application/json; charset=utf-8) + Attributes (user, fixed) ### Delete user [DELETE] Delete an user. + Request (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Response 204 # Data Structures ## user (object) + id: 1 (number) + name: NAME (string) + created_at: `2000-01-01 00:00:00` (string) + updated_at: `2000-01-01 00:00:00` (string)
# Group Users Welcome to the users API. This API provides access to the users service. ## users [/users] ### Create user [POST] Create a new user + Request user (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Attributes + name: NAME (string) + Response 201 (application/json; charset=utf-8) + Attributes (user, fixed) ### Get users [GET] Returns an user list. + Request (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) + (user) ## user details [/users/{id}] + Parameters + id: `1` (enum[string]) - The ID of the desired user. + Members + `1` + `2` + `3` ### Get user [GET] Returns an user. + Request (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Response 200 (application/json; charset=utf-8) + Attributes (user, fixed) ### Update user [PUT] Update an user. + Request user (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Attributes + name: NAME (string) + Response 200 (application/json; charset=utf-8) + Attributes (user, fixed) ### Delete user [DELETE] Delete an user. + Request (application/json; charset=utf-8) + Headers Accept: application/vnd.wantedly+json + Response 204 # Data Structures ## user (object) + id: *1* (number) + name: *NAME* (string) + created_at: `*2000-01-01 00:00:00*` (string) + updated_at: `*2000-01-01 00:00:00*` (string)
Update testdata
Update testdata
API Blueprint
mit
loomnetwork/apig,wantedly/apig,loomnetwork/apig,wantedly/apig
203fcea39d18c03ad02552ea97d13cb5c39efade
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://iot-camera-object-recognizer.herokuapp.com/ # IOT Object Camera Recognizer. IOT object camera recognizer. Orginize camera objects list and check current state of stage. # Manage Objects api [/webapi/houses/{houseid}/objects] + Parameters + houseid (required, string, `"76c6-456d-8971"`) ... Unique house identifier ## List All Objects [GET] Returns code 200 and list of jsons if correct houseid, 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 houseid 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) ## Get Object by id [GET/{objectid}] Get an object type by id, if houseid or objectid is not valid 404 is returned. + Parameters + objectid (required, string, `"76c6-456d-8971"`) ... ID of an object, returned by api when called put object + Response 200 (application/json) + Body { "id": "requestedid", "type": "objecttype" } + Response 404 (application/json) ## Put Object by id [PUT/{objectid}] You may update object type by id. 404 if invalid ids + type (string): new object type + Parameters + objectid (required, string, `"76c6-456d-8971"`) ... ID of an object, returned by api when called put object + Request (application/json) { "type": "newType" } + Response 200 (application/json) + Response 404 (application/json) ## Delete Object by id [DELETE/{objectid}] You may delete object type by id. 404 if invalid ids + type (string): new object type + Parameters + objectid (required, string, `"76c6-456d-8971"`) ... ID of an object, returned by api when called put object + Response 200 (application/json) + Response 404 (application/json) # Check for unknown objects api [GET/houses/{houseid}/check] You may ask recognizer for uknown objects on the stage. 404 is returned if houseid is invalid. + Parameters + houseid - string, same house identifier as in manage objects api. + Response 200 (application/json) + Body { "result": true "objects": [ { "id": "randomid1", "type": "chair" }, { "id": "kokanto", "type": "toxic" }, { "id": "randomid3", "type": "table" } ] } + Response 404 (application/json)
FORMAT: 1A HOST: http://iot-camera-object-recognizer.herokuapp.com/ # IOT Object Camera Recognizer. IOT object camera recognizer. Orginize camera objects list and check current state of stage. # Manage Objects api [/webapi/houses/{houseid}/objects] + Parameters + houseid (required, string, `"76c6-456d-8971"`) ... Unique house identifier ## List All Objects [GET] Returns code 200 and list of jsons if correct houseid, 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 houseid 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) ## Get Object by id [GET/{objectid}] Get an object type by id, if houseid or objectid is not valid 404 is returned. + Parameters + objectid (required, string, `"76c6-456d-8971"`) ... ID of an object, returned by api when called put object + Response 200 (application/json) + Body { "id": "requestedid", "type": "objecttype" } + Response 404 (application/json) ## Put Object by id [PUT/{objectid}] You may update object type by id. 404 if invalid ids + type (string): new object type + Parameters + objectid (required, string, `"76c6-456d-8971"`) ... ID of an object, returned by api when called put object + Request (application/json) { "type": "newType" } + Response 200 (application/json) + Response 404 (application/json) ## Delete Object by id [DELETE/{objectid}] You may delete object type by id. 404 if invalid ids + type (string): new object type + Parameters + objectid (required, string, `"76c6-456d-8971"`) ... ID of an object, returned by api when called put object + Response 200 (application/json) + Response 404 (application/json) # Check for unknown objects api [GET/houses/{houseid}/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 houseid is invalid. + Parameters + houseid - string, same house identifier as in manage objects api. + Response 200 (application/json) + Body { "result": false "objects": [ "unknownchair", "unknownkoka", "unknownakunamatata" ] } + Response 404 (application/json)
Change check blueprint.
Change check blueprint.
API Blueprint
mit
freeuni-sdp/iot-camera-object-recognizer
77e5f48abe942bf61d5fdc2fe9d64e2f8b220b2a
doc/apiary.apib
doc/apiary.apib
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
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" }
Update apiary.apib
Update apiary.apib
API Blueprint
mit
yannickcr/test
3736e63de9122759970237dbdd8c874504f87703
docs/ezra.apib
docs/ezra.apib
FORMAT: 1a # Ezra Ezra is a project intended to manage JPCC Community Classes. The name Ezra inspired from Nehemiah Book. # Group Participant Manage Participant ## Register [POST /participant] Register new participant + Request Register Participant (application/json) + Attributes (Participant) + Response 201 (application/json) + Attributes (Participant) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /participant{?num, cursor, year, batch}] Fetch participants + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of participant to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Participant]) ## Participant [/participant/{participant_id}] + Parameters + participant_id: `someparticipantid` (string) - Participant ID ### GET [GET] Get Participant + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) ### Update [PUT] Update participant + Request (application/json) + Attributes (Participant) + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove participant + Response 204 (application/json) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) # Group Presenter Manage Presenter ## Register [POST /presenter] Register new presenter + Request register presenter (application/json) + Attributes (Presenter) + Response 201 (application/json) + Attributes (Presenter) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /presenter{?num, cursor, year, batch}] Fetch Presenters + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Presenter to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Presenter]) ## Presenter [/presenter/{presenter_id}] + Parameters + presenter_id: `somepresenterid` (string) - Presenter ID ### GET [GET] Get Presenter + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no Presenter with specified ID + Attributes (Error) ### Update [PUT] Update Presenter + Request (application/json) + Attributes (Presenter) + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove presenter + Response 204 (application/json) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) # Group Facilitator Manage Facilitator ## Register [POST /facilitator] Register new facilitator + Request Register Placement (application/json) + Attributes (Facilitator) + Response 201 (application/json) + Attributes (Facilitator) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /facilitator{?num, cursor, year, batch}] Fetch Facilitators + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Facilitator to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Facilitator]) ## Facilitator [/facilitator/{facilitator_id}] + Parameters + facilitator_id: `somefacilitatorid` (string) - Facilitator ID ### GET [GET] Get Facilitator + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) ### Update [PUT] Update Facilitator + Request (application/json) + Attributes (Facilitator) + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove Facilitator + Response 204 (application/json) + Response 404 (application/json) If there is no Facilitator with specified ID + Attributes (Error) ## Assign Facilitator to Class [/facilitator/{facilitator_id}/class/{class_id}] + Parameters + facilitator_id: `somefacilitatorid` (string) - Facilitator ID + class_id: `someclassid` (string) - Class ID ## Assign [POST] Assign facilitator to class + Response 200 + Response 404 (application/json) If there is no facilitator/class with specified ID + Attributes (Error) ## Unassign [DELETE] Unassign facilitator from class + Response 200 + Response 404 (application/json) If there is no facilitator/class with specified ID + Attributes (Error) # Group Class Manage class ## Register [POST /class] Add new class + Request add class (application/json) + Attributes (Class) + Response 201 (application/json) + Attributes (Class) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /class{?num, cursor, year, batch}] Fetch classs + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of class to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Class]) ## Class [/class/{class_id}] + Parameters + class_id: `someclassid` (string) - class ID ### GET [GET] Get class + Response 200 (application/json) + Attributes (Class) + Response 404 (application/json) If there is no class with specified ID + Attributes (Error) ### Update [PUT] Update class + Request (application/json) + Attributes (Class) + Response 200 (application/json) + Attributes (Class) + Response 404 (application/json) If there is no class with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Remove [DELETE] Remove class + Response 204 (application/json) + Response 404 (application/json) If there is no class with specified ID + Attributes (Error) # Data Structures ## Participant + id: `someparticipantid` (string) - ID of participant + name: `John Doe` (string) - Participant's name + email: `[email protected]` (string) - Participant's email + phone_number: `+62819123123` (string) - Participant's phone number + dob: `30-12-1980` (string) - Participant date of birth + date: `Rasuna 1` (string) - Participant's DATE ## Presenter + id: `somepresenterid` (string) - ID of Presenter + name: `John Doe` (string) - Presenter's name + email: `[email protected]` (string) - Presenter's email + phone_number: `+62819123123` (string) - Presenter's phone number + dob: `30-12-1980` (string) - Presenter date of birth + date: `Rasuna 1` (string) - Presenter's DATE ## Facilitator + id: `somefacilitatorid` (string) - ID of Facilitator + name: `John Doe` (string) - Facilitator's name + email: `[email protected]` (string) - Facilitator's email + phone_number: `+62819123123` (string) - Facilitator's phone number + dob: `30-12-1980` (string) - Facilitator date of birth + date: `Rasuna 1` (string) - Facilitator's DATE ## Class + id: `jpcc-col-1-2017` (string) - ID of class + type: `jpcc-col` (string) - Type of class, e.g jpcc-cob, jpcc-col + batch: 1 (number) - Class Batch + year: 2017 (number) - Class Year + description: `here is class description` (string) - description of class ## Error (object) + message: This is an error (string)
FORMAT: 1a # Ezra Ezra is a project intended to manage JPCC Community Classes. The name Ezra inspired from Nehemiah Book. # Group Participant Manage Participant ## Register [POST /participant] Register new participant + Request Register Participant (application/json) + Attributes (Participant) + Response 201 (application/json) + Attributes (Participant) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /participant{?num, cursor, year, batch}] Fetch participants + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of participant to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Participant]) ## Participant [/participant/{participant_id}] + Parameters + participant_id: `someparticipantid` (string) - Participant ID ### GET [GET] Get Participant + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) ### Update [PUT] Update participant + Request (application/json) + Attributes (Participant) + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove participant + Response 204 (application/json) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) # Group Presenter Manage Presenter ## Register [POST /presenter] Register new presenter + Request register presenter (application/json) + Attributes (Presenter) + Response 201 (application/json) + Attributes (Presenter) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /presenter{?num, cursor, year, batch}] Fetch Presenters + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Presenter to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Presenter]) ## Presenter [/presenter/{presenter_id}] + Parameters + presenter_id: `somepresenterid` (string) - Presenter ID ### GET [GET] Get Presenter + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no Presenter with specified ID + Attributes (Error) ### Update [PUT] Update Presenter + Request (application/json) + Attributes (Presenter) + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove presenter + Response 204 (application/json) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) # Group Facilitator Manage Facilitator ## Register [POST /facilitator] Register new facilitator + Request Register Placement (application/json) + Attributes (Facilitator) + Response 201 (application/json) + Attributes (Facilitator) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /facilitator{?num, cursor, year, batch}] Fetch Facilitators + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Facilitator to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Facilitator]) ## Facilitator [/facilitator/{facilitator_id}] + Parameters + facilitator_id: `somefacilitatorid` (string) - Facilitator ID ### GET [GET] Get Facilitator + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) ### Update [PUT] Update Facilitator + Request (application/json) + Attributes (Facilitator) + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove Facilitator + Response 204 (application/json) + Response 404 (application/json) If there is no Facilitator with specified ID + Attributes (Error) ## Assign Facilitator to Class [/facilitator/{facilitator_id}/class/{class_id}] + Parameters + facilitator_id: `somefacilitatorid` (string) - Facilitator ID + class_id: `someclassid` (string) - Class ID ## Assign [POST] Assign facilitator to class + Response 200 + Response 404 (application/json) If there is no facilitator/class with specified ID + Attributes (Error) ## Unassign [DELETE] Unassign facilitator from class + Response 200 + Response 404 (application/json) If there is no facilitator/class with specified ID + Attributes (Error) # Group Class Manage class ## Register [POST /class] Add new class + Request add class (application/json) + Attributes (Class) + Response 201 (application/json) + Attributes (Class) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /class{?num, cursor, year, batch}] Fetch classs + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of class to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Class]) ## Class [/class/{class_id}] + Parameters + class_id: `someclassid` (string) - class ID ### GET [GET] Get class + Response 200 (application/json) + Attributes (Class) + Response 404 (application/json) If there is no class with specified ID + Attributes (Error) ### Update [PUT] Update class + Request (application/json) + Attributes (Class) + Response 200 (application/json) + Attributes (Class) + Response 404 (application/json) If there is no class with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Remove [DELETE] Remove class + Response 204 (application/json) + Response 404 (application/json) If there is no class with specified ID + Attributes (Error) # Data Structures ## Participant + id: 12345 (number) - ID of participant + name: `John Doe` (string) - Participant's name + email: `[email protected]` (string) - Participant's email + phone_number: `+62819123123` (string) - Participant's phone number + dob: `30-12-1980` (string) - Participant date of birth + date: `Rasuna 1` (string) - Participant's DATE ## Presenter + id: 12345 (number) - ID of Presenter + name: `John Doe` (string) - Presenter's name + email: `[email protected]` (string) - Presenter's email + phone_number: `+62819123123` (string) - Presenter's phone number + dob: `30-12-1980` (string) - Presenter date of birth + date: `Rasuna 1` (string) - Presenter's DATE ## Facilitator + id: 12345 (number) - ID of Facilitator + name: `John Doe` (string) - Facilitator's name + email: `[email protected]` (string) - Facilitator's email + phone_number: `+62819123123` (string) - Facilitator's phone number + dob: `30-12-1980` (string) - Facilitator date of birth + date: `Rasuna 1` (string) - Facilitator's DATE ## Class + id: `jpcc-col-1-2017` (string) - ID of class + type: `jpcc-col` (string) - Type of class, e.g jpcc-cob, jpcc-col + batch: 1 (number) - Class Batch + year: 2017 (number) - Class Year + description: `here is class description` (string) - description of class ## Form + id: 12345 (number) + name: `Feedback Form PRESENTER CoL Sesi 8 - SMAART Planning (Responses)` (string) + external_url: `https://docs.google.com/spreadsheets/d/1pNHG0uPsMyaLjinREP4UYXXeVrUw0-3UCHZ7uxltIEQ/edit#gid=1523709804` ## FormQuestion + form_id: 1 (number) + question_id: 123 (number) ## Question + id: 123 (number) - ID of feedback question + name: `Penguasaan Materi` (string) - Name will be shown in field + description: `Penjelasan mengenai penguasaan materi` (string) - Description + answer_type : `number` (string) - Answer Type e.g (number, string) ## Answer + id: 2 (number) - ID of feedback answer + recipient_type: `presenter` (string) - Type of recipient e.g (presenter, facilitator) + recipient_id: 12345 (number) - Type of recipient + reviewer_type: `participant` (string) - Type of reviewer + reviewer_id : 12345 (number) - ID of reviewer + class_id: `jpcc-col-1-2017` (string) - ID of class + session: 1 (number) - Session number + question_id: 123 + answer: `Great!` (string) - Answer for feedback, could be in the form of number/ string e.g 4 or `Awesome!` + created_at: `2017-01-01 00:00:00` (string) - Answer created at time ## Error (object) + message: This is an error (string)
Add feedback (question, answer, form)
Add feedback (question, answer, form)
API Blueprint
apache-2.0
arielizuardi/ezra
6a2edad2ea15effc24d6d7b88a27776476681ee2
docs/ezra.apib
docs/ezra.apib
FORMAT: 1a # Ezra Ezra is a project intended to manage JPCC Community Classes. The name Ezra inspired from Nehemiah Book. # Group Participant Manage Participant ## Register [POST /participant] Register new participant + Request Register Participant (application/json) + Attributes (Participant) + Response 201 (application/json) + Attributes (Participant) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /participant{?num, cursor, year, batch}] Fetch participants + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of participant to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Participant]) ## Participant [/participant/{participant_id}] + Parameters + participant_id: `someparticipantid` (string) - Participant ID ### GET [GET] Get Participant + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) ### Update [PUT] Update participant + Request (application/json) + Attributes (Participant) + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove participant + Response 204 (application/json) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) # Group Presenter Manage Presenter ## Register [POST /presenter] Register new presenter + Request register presenter (application/json) + Attributes (Presenter) + Response 201 (application/json) + Attributes (Presenter) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /presenter{?num, cursor, year, batch}] Fetch Presenters + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Presenter to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Presenter]) ## Presenter [/Presenter/{Presenter_id}] + Parameters + Presenter_id: `somePresenterid` (string) - Presenter ID ### GET [GET] Get Presenter + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no Presenter with specified ID + Attributes (Error) ### Update [PUT] Update Presenter + Request (application/json) + Attributes (Presenter) + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove presenter + Response 204 (application/json) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) # Group Facilitator Manage Facilitator ## Register [POST /facilitator] Register new facilitator + Request Register Placement (application/json) + Attributes (Facilitator) + Response 201 (application/json) + Attributes (Facilitator) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /facilitator{?num, cursor, year, batch}] Fetch Facilitators + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Facilitator to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Facilitator]) ## Facilitator [/Facilitator/{Facilitator_id}] + Parameters + Facilitator_id: `someFacilitatorid` (string) - Facilitator ID ### GET [GET] Get Facilitator + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) ### Update [PUT] Update Facilitator + Request (application/json) + Attributes (Facilitator) + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no Facilitator with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove Facilitator + Response 204 (application/json) + Response 404 (application/json) If there is no Facilitator with specified ID + Attributes (Error) # Data Structures ## Participant + id: `someparticipantid` (string) - ID of participant + name: `John Doe` (string) - Participant's name + email: `[email protected]` (string) - Participant's email + phone_number: `+62819123123` (string) - Participant's phone nmber + dob: `30-12-1980` (string) - Participant date of birth + date: `Rasuna 1` (string) - Participant's DATE ## Presenter + id: `somepresenterid` (string) - ID of Presenter + name: `John Doe` (string) - Presenter's name + email: `[email protected]` (string) - Presenter's email + phone_number: `+62819123123` (string) - Presenter's phone nmber + dob: `30-12-1980` (string) - Presenter date of birth + date: `Rasuna 1` (string) - Presenter's DATE ## Facilitator + id: `somefacilitatorid` (string) - ID of Facilitator + name: `John Doe` (string) - Facilitator's name + email: `[email protected]` (string) - Facilitator's email + phone_number: `+62819123123` (string) - Facilitator's phone nmber + dob: `30-12-1980` (string) - Facilitator date of birth + date: `Rasuna 1` (string) - Facilitator's DATE ## Error (object) + message: This is an error (string)
FORMAT: 1a # Ezra Ezra is a project intended to manage JPCC Community Classes. The name Ezra inspired from Nehemiah Book. # Group Participant Manage Participant ## Register [POST /participant] Register new participant + Request Register Participant (application/json) + Attributes (Participant) + Response 201 (application/json) + Attributes (Participant) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /participant{?num, cursor, year, batch}] Fetch participants + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of participant to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Participant]) ## Participant [/participant/{participant_id}] + Parameters + participant_id: `someparticipantid` (string) - Participant ID ### GET [GET] Get Participant + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) ### Update [PUT] Update participant + Request (application/json) + Attributes (Participant) + Response 200 (application/json) + Attributes (Participant) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove participant + Response 204 (application/json) + Response 404 (application/json) If there is no participant with specified ID + Attributes (Error) # Group Presenter Manage Presenter ## Register [POST /presenter] Register new presenter + Request register presenter (application/json) + Attributes (Presenter) + Response 201 (application/json) + Attributes (Presenter) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /presenter{?num, cursor, year, batch}] Fetch Presenters + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Presenter to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Presenter]) ## Presenter [/presenter/{presenter_id}] + Parameters + presenter_id: `somepresenterid` (string) - Presenter ID ### GET [GET] Get Presenter + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no Presenter with specified ID + Attributes (Error) ### Update [PUT] Update Presenter + Request (application/json) + Attributes (Presenter) + Response 200 (application/json) + Attributes (Presenter) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove presenter + Response 204 (application/json) + Response 404 (application/json) If there is no presenter with specified ID + Attributes (Error) # Group Facilitator Manage Facilitator ## Register [POST /facilitator] Register new facilitator + Request Register Placement (application/json) + Attributes (Facilitator) + Response 201 (application/json) + Attributes (Facilitator) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ## Fetch [GET /facilitator{?num, cursor, year, batch}] Fetch Facilitators + Parameters + cursor (string, optional) - Cursor for pagination. + Default: 0 + num (number, optional) - Number of Facilitator to be returned + Default: 10 + year (number, optional) - Year + batch (number, optional) - Batch + Response 200 (application/json) + Attributes (array[Facilitator]) ## Facilitator [/facilitator/{facilitator_id}] + Parameters + facilitator_id: `somefacilitatorid` (string) - Facilitator ID ### GET [GET] Get Facilitator + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) ### Update [PUT] Update Facilitator + Request (application/json) + Attributes (Facilitator) + Response 200 (application/json) + Attributes (Facilitator) + Response 404 (application/json) If there is no facilitator with specified ID + Attributes (Error) + Response 422 (application/json) If the request body invalid or does not contain required fields + Attributes (Error) ### Unregister [DELETE] Unregister/remove Facilitator + Response 204 (application/json) + Response 404 (application/json) If there is no Facilitator with specified ID + Attributes (Error) ## Assign Facilitator to Class [/facilitator/{facilitator_id}/class/{class_id}] + Parameters + facilitator_id: `somefacilitatorid` (string) - Facilitator ID + class_id: `someclassid` (string) - Class ID ## Assign [POST] Assign facilitator to class + Response 200 + Response 404 (application/json) If there is no facilitator/class with specified ID + Attributes (Error) ## Unassign [DELETE] Unassign facilitator from class + Response 200 + Response 404 (application/json) If there is no facilitator/class with specified ID + Attributes (Error) # Data Structures ## Participant + id: `someparticipantid` (string) - ID of participant + name: `John Doe` (string) - Participant's name + email: `[email protected]` (string) - Participant's email + phone_number: `+62819123123` (string) - Participant's phone number + dob: `30-12-1980` (string) - Participant date of birth + date: `Rasuna 1` (string) - Participant's DATE ## Presenter + id: `somepresenterid` (string) - ID of Presenter + name: `John Doe` (string) - Presenter's name + email: `[email protected]` (string) - Presenter's email + phone_number: `+62819123123` (string) - Presenter's phone number + dob: `30-12-1980` (string) - Presenter date of birth + date: `Rasuna 1` (string) - Presenter's DATE ## Facilitator + id: `somefacilitatorid` (string) - ID of Facilitator + name: `John Doe` (string) - Facilitator's name + email: `[email protected]` (string) - Facilitator's email + phone_number: `+62819123123` (string) - Facilitator's phone number + dob: `30-12-1980` (string) - Facilitator date of birth + date: `Rasuna 1` (string) - Facilitator's DATE ## Error (object) + message: This is an error (string)
Add assign and unassign facilitator to class
Add assign and unassign facilitator to class
API Blueprint
apache-2.0
arielizuardi/ezra
232d2c13ac389ef156589140bc510eb9ed33ae91
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 + 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] not implemented yet + 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 + 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 + 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 + 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
upgrade apiary doc
upgrade apiary doc
API Blueprint
agpl-3.0
telefonicaid/orchestrator,telefonicaid/orchestrator
6e08c69e66890a1681d9efe6acc443ec50879f60
private/API.apib
private/API.apib
FORMAT: 1A HOST: http://localhost:3000/api/v2 # Group Apps An App is a logical named and versioned entity. It serves as a template for an **Instance**. This ***API*** offers multiple resources to retrieve and modify different aspects of an App. ## App [/apps/{name}/{version}] An application is a logical unit of application configuration data. + Parameters + name: `nginx` (string) - The name of the application + version: `latest` (string) - The version of the application + Model (application/json) ```js { "id": "MKMZCnLcEJmkjSenJ", "name": "nginx", "version": "latest" } ``` ### Retrieve an App [GET] Returns a specific application. + Response 200 [App][] + Response 404 ### Create an App [PUT] Creates a new application with the specified name and version. Returns the App when succesfully created or updated. + Response 201 [App][] ### Delete an App [DELETE] Delete an application. + Response 204 + Response 404 ## Docker Compose [/apps/{name}/{version}/files/dockerCompose] A Docker compose file associated with an application. + Parameters + name: `nginx` (string) - The name of the application + version: `latest` (string) - The version of the application + Model (text/yaml) www: image: nginx:latest ### Retrieve the Docker compose file [GET] + Response 200 [Docker Compose][] ### Update the Docker compose file [PUT] + Request [Docker Compose][] + Response 201 + Response 400 (application/json) ```js { "message": "JS-YAML: end of the stream or a document separator is expected at line 2, column 1:....." } ``` ## BigBoat Compose [/apps/{name}/{version}/files/bigboatCompose] A BigBoat compose file associated with an application. + Parameters + name: `nginx` (string) - The name of the application + version: `latest` (string) - The version of the application + Model (text/yaml) name: nginx version: latest www: enable_ssh: true ### Retrieve the BigBoat compose file [GET] + Response 200 [BigBoat Compose][] ### Update the BigBoat compose file [PUT] The BigBoat compose file should be a valid YAML file. The `name` and `version` properties of the BigBoat Compose file should equal to the name and version values of the App entity. The request is denied otherwise. + Request [BigBoat Compose][] + Response 201 + Response 400 (application/json) ```js { "message": "JS-YAML: end of the stream or a document separator is expected at line 2, column 1:....." } ``` ## Applications [/apps] + Model (application/json) ```js [ { "id": "MKMZCnLcEJmkjSenJ", ... }, { "id": "LENn6QcjnG8WRvAxf", ... } ] ``` ### Retrieve all Applications [GET] Returns all applications. + Response 200 [Applications][] # Group Instance An Instance is a parameterized App that is deployed for execution. ## Instances [/instances] + Model (application/json) ```js [ { "id": "...", .... }, { "id": "..." } ] ``` ### Retrieve all Instances [GET] Returns all instances. + Response 200 [Instances][]
FORMAT: 1A HOST: http://localhost:3000/api/v2 # Group Apps An App is a logical named and versioned entity. It serves as a template for an **Instance**. This ***API*** offers multiple resources to retrieve and modify different aspects of an App. ## Applications [/apps] + Model (application/json) ```js [ { "id": "ERfrBncoPKSN9ampt", "name": "nginx", "version": "latest" }, { "id": "LENn6QcjnG8WRvAxf", "name": "nginx", "version": "1.11.4" } ] ``` ### Retrieve all Applications [GET] Returns all applications. + Response 200 [Applications][] ## App [/apps/{name}/{version}] An application is a logical unit of application configuration data. + Parameters + name: `nginx` (string) - The name of the application + version: `latest` (string) - The version of the application + Model (application/json) ```js { "id": "MKMZCnLcEJmkjSenJ", "name": "nginx", "version": "latest" } ``` ### Retrieve an App [GET] Returns a specific application. + Response 200 [App][] + Response 404 ### Create an App [PUT] Creates a new application with the specified name and version. Returns the App when succesfully created or updated. + Response 201 [App][] ### Delete an App [DELETE] Delete an application. + Response 204 + Response 404 ## Docker Compose [/apps/{name}/{version}/files/dockerCompose] A Docker compose file associated with an application. + Parameters + name: `nginx` (string) - The name of the application + version: `latest` (string) - The version of the application + Model (text/yaml) www: image: nginx:latest ### Retrieve the Docker compose file [GET] + Response 200 [Docker Compose][] ### Update the Docker compose file [PUT] + Request [Docker Compose][] + Response 201 + Response 400 (application/json) ```js { "message": "JS-YAML: end of the stream or a document separator is expected at line 2, column 1:....." } ``` ## BigBoat Compose [/apps/{name}/{version}/files/bigboatCompose] A BigBoat compose file associated with an application. + Parameters + name: `nginx` (string) - The name of the application + version: `latest` (string) - The version of the application + Model (text/yaml) name: nginx version: latest www: enable_ssh: true ### Retrieve the BigBoat compose file [GET] + Response 200 [BigBoat Compose][] ### Update the BigBoat compose file [PUT] The BigBoat compose file should be a valid YAML file. The `name` and `version` properties of the BigBoat Compose file should equal to the name and version values of the App entity. The request is denied otherwise. + Request [BigBoat Compose][] + Response 201 + Response 400 (application/json) ```js { "message": "JS-YAML: end of the stream or a document separator is expected at line 2, column 1:....." } ``` # Group Instance An Instance is a parameterized App that is deployed for execution. ## Instances [/instances] + Model (application/json) ```js [ { "id": "y7bzwghzP9ouM56g6", "name": "nginx", "state": { "current": "running", "desired": "running" } }, { "id": "ySYXNTPw2ry9XE6nu", "name": "nginx2", "state": { "current": "starting", "desired": "running" } } ] ``` ### Retrieve all Instances [GET] Returns all instances along with their current and desired state attributes. + Response 200 [Instances][] ## Instance [/instances/{name}] + Parameters + name: `nginx` (string) - The unique name of the instance + Model (application/json) ```js { "id": "y7bzwghzP9ouM56g6", "name": "nginx", "state": { "current": "starting", "desired": "running" }, "app": { "name": "nginx", "version": "latest" }, "services": { "www": { "state": "starting" } } } ``` ### Retrieve a single instance [GET] Returns a single instance + Response 200 [Instance][] + Response 404 ### Create an instance [PUT] Requests a new instance to be created with a desired state of 'running'. The `parameters` and `options` properties of the posted document are required but can be left empty when no parameters are present or when you don't want to override the default storage bucket. See request example 2. + Request (application/json) ```js { "app":"nginx", "version":"latest", "parameters":{ "version":"1.11.4" }, "options": { "storageBucket": "custom-storage-bucket" } } ``` + Request (application/json) ```js { "app":"nginx", "version":"latest", "parameters":{}, "options": {} } ``` + Response 201 [Instance][] + Response 400 ### Stop an instance [DELETE] Requests an instance to be stopped. Returns the instance when successful. + Response 200 [Instance][] + Response 404
update api documentation
update api documentation
API Blueprint
apache-2.0
ICTU/docker-dashboard,ICTU/docker-dashboard,ICTU/docker-dashboard
b1f59f8e56e667953ce8ea67877aa8560c741b3d
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. + 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" } ] }
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 # at the end of file
[SunriseSunset] Add # at the end of file
API Blueprint
apache-2.0
MeteoGroup/weather-api,MeteoGroup/weather-api
643e156bb86d9cc8adae5d1f0e64231317b234f5
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) [ { "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" }
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 [/api/v1/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 [/api/v1/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 [/api/v1/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 [/api/v1/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 [/api/v1/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 [/api/v1/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 endpoints
[CHORE] Update endpoints
API Blueprint
mit
brayoh/bucket-list-api
12d660ef71167511155da76e989cfe0a207abc82
LIGHTNING-API-BLUEPRINT.apib
LIGHTNING-API-BLUEPRINT.apib
FORMAT: 1A Weather API ============================= # General information This technical document was created for developers who are creating applications based on weather data provided by this API. This document is using [API blueprint format](https://apiblueprint.org/documentation/). ### Authentication All endpoints are **secured** with Two-Legged OAuth2 authorization uses JWT token 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). ### Backward compatibility Every endpoint may add one or more response parameters in the future. Clients should ignore unknown parameters, to avoid technical issues. # Group Lightning ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurrenceFrom={startTime}&occurrenceUntil={endTime}] ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}] #### Example https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:21:14Z&occurrenceUntil=2017-01-05T12:21:15Z https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:21:14Z https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5] ##### Limitation Lambda service response can have size < 6MB which is near 25000 records If locationWithin is worldwide [-180, 90][180, -90] and occurrence ~3 days it is big probability that response is > 6Mb In such scenario service respond only first 25000 records. ### Observed lightning for a given boundingBox and time period This resource provides data from existing lightning observation providers. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 + occurrenceFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurrenceUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + provider: `ENGLN,NOWCAST' (string, required) - lightning providers. + Response 200 (application/json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "strokes":[ { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"NOWCAST", "strokeType":"CLOUD_TO_GROUND", "heightInKilometer":0, "currentInAmpere":4500, "location":[ 9.6345, 19.3064 ] }, { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"ENGLN", "strokeType":"CLOUD_TO_GROUND", "heightInKilometer":0, "currentInAmpere":4700, "location":[ 8.6345, 20.3064 ] }, { "provider": "NOWCAST", "occurredAt": "2017-01-05T12:20:14.974Z", "heightInKilometer": 0, "strokeType": "CLOUD_TO_GROUND", "currentInAmpere": -3500, "location": [ 9.3345, 19.7064 ] } ] } # # Weighted Lightning ## Retrieve weighted lightning observation [?timeSpan={timeSpan}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurrenceFrom={startTime}&occurrenceUntil={endTime}] ## Retrieve weighted lightning observation [?timeSpan={timeSpan}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurredFrom={startTime}] #### Example https://lightning.weather.mg/weigh?&timeSpan=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:19:14Z&occurrenceUntil=2017-01-05T12:21:15Z https://lightning.weather.mg/weigh?&timeSpan=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:19:14Z https://lightning.weather.mg/weigh?&timeSpan=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5] ### Observed weighted lightning for a given boundingBox, time period, weighted by time span and spatial resolution This resource provides data from existing lightning observation providers. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + timeSpan: 'PT15M, PT5M' (string required) - time span interval in which lightning should be weighted + spatialResolution '0.5, 0.25, 0.05' (string required) - spatial resolution within which lightning should be weighted + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 + occurrenceFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurrenceUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + Response 200 (application/json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "weightedLightningList": [{ "occurredFrom": "2017-01-05T12:15:00.000Z", "currentSum": 8000, "weightedLocation": [9.5033, 19.4814], "strikesNumber": 2, "timeSpan": "PT15M", "occurredTo": "2017-01-05T12:30:00.000Z", "region": [[9.25, 19.75], [9.75, 19.25]], "weightedObservation": "2017-01-05T12:20:47.000Z" }, { "occurredFrom": "2017-01-05T12:15:00.000Z", "currentSum": 4700, "weightedLocation": [8.6345, 20.3064], "strikesNumber": 1, "timeSpan": "PT15M", "occurredTo": "2017-01-05T12:30:00.000Z", "region": [[8.25, 20.75], [8.75, 20.25]], "weightedObservation": "2017-01-05T12:21:14.000Z" } ] } #
FORMAT: 1A Weather API ============================= # General information This technical document was created for developers who are creating applications based on weather data provided by this API. This document is using [API blueprint format](https://apiblueprint.org/documentation/). ### Authentication All endpoints are **secured** with Two-Legged OAuth2 authorization uses JWT token 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). ### Backward compatibility Every endpoint may add one or more response parameters in the future. Clients should ignore unknown parameters, to avoid technical issues. # Group Lightning ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurrenceFrom={startTime}&occurrenceUntil={endTime}] ## Retrieve lightning observation [?provider={provider1,provider2}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurrenceFrom={startTime}] #### Example https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:21:14Z&occurrenceUntil=2017-01-05T12:21:15Z https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:21:14Z https://lightning.weather.mg/search?provider=NOWCAST&locationWithin=[-10,80],[10,5] ##### Limitation Lambda service response can have size < 6MB which is near 25000 records If locationWithin is worldwide [-180, 90][180, -90] and occurrence ~3 days it is big probability that response is > 6Mb In such scenario service respond only first 25000 records. ### Observed lightning for a given boundingBox and time period This resource provides data from existing lightning observation providers. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 + occurrenceFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurrenceUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + provider: `ENGLN,NOWCAST' (string, required) - lightning providers. + Response 200 (application/json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "strokes":[ { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"NOWCAST", "strokeType":"CLOUD_TO_GROUND", "heightInKilometer":0, "currentInAmpere":4500, "location":[ 9.6345, 19.3064 ] }, { "occurredAt":"2017-01-05T12:21:14.974Z", "provider":"ENGLN", "strokeType":"CLOUD_TO_GROUND", "heightInKilometer":0, "currentInAmpere":4700, "location":[ 8.6345, 20.3064 ] }, { "provider": "NOWCAST", "occurredAt": "2017-01-05T12:20:14.974Z", "heightInKilometer": 0, "strokeType": "CLOUD_TO_GROUND", "currentInAmpere": -3500, "location": [ 9.3345, 19.7064 ] } ] } # # Weighted Lightning ## Retrieve weighted lightning observation [?timeSpan={timeSpan}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurrenceFrom={startTime}&occurrenceUntil={endTime}] ## Retrieve weighted lightning observation [?timeSpan={timeSpan}&spatialResolution={resolution}&locationWithin={lonTopLeft,latTopLeft,lonBottomRight,latBottomRight}&occurrenceFrom={startTime}] #### Example https://lightning.weather.mg/weigh?&timeSpan=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:19:14Z&occurrenceUntil=2017-01-05T12:21:15Z https://lightning.weather.mg/weigh?&timeSpan=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5]&occurrenceFrom=2017-01-05T12:19:14Z https://lightning.weather.mg/weigh?&timeSpan=PT15M&spatialResolution=0.5&locationWithin=[-10,80],[10,5] ### Observed weighted lightning for a given boundingBox, time period, weighted by time span and spatial resolution This resource provides data from existing lightning observation providers. For any request service returns a set of lightnings occurred in geographical bounding box locations during period of time specified in parameters. + Parameters + timeSpan: 'PT15M, PT5M' (string required) - time span interval in which lightning should be weighted + spatialResolution '0.5, 0.25, 0.05' (string required) - spatial resolution within which lightning should be weighted + locationWithin: `[-10,80],[10,5]` (longitude top left, latitude top left, longitude bottom right, latitude bottom_right, required) - latitude in degree numeric format and in range <-90,90> eg. -85.541, 5.32, - longitude in degree numeric format and in range <-180,180> eg. -123.454, 179.864 + occurrenceFrom: `2017-01-05T12:21:14Z` (start time range, optional) - start lightning observation time. End time is current time by default, setup by the service. + occurrenceUntil: `2017-01-05T12:21:15Z` (end time range, optional) - time range period for lightning observation. + Response 200 (application/json) + Headers Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE + Body { "weightedLightningList": [{ "occurredFrom": "2017-01-05T12:15:00.000Z", "currentSum": 8000, "weightedLocation": [9.5033, 19.4814], "strikesNumber": 2, "timeSpan": "PT15M", "occurredTo": "2017-01-05T12:30:00.000Z", "region": [[9.25, 19.75], [9.75, 19.25]], "weightedObservation": "2017-01-05T12:20:47.000Z" }, { "occurredFrom": "2017-01-05T12:15:00.000Z", "currentSum": 4700, "weightedLocation": [8.6345, 20.3064], "strikesNumber": 1, "timeSpan": "PT15M", "occurredTo": "2017-01-05T12:30:00.000Z", "region": [[8.25, 20.75], [8.75, 20.25]], "weightedObservation": "2017-01-05T12:21:14.000Z" } ] } #
Fix misspelling
Fix misspelling
API Blueprint
apache-2.0
MeteoGroup/weather-api,MeteoGroup/weather-api
d4cfd991953fc197e9c11363b24b204350efd040
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 ## Redesigns [/site/{id}/redesign{?inflight}] ### Listing redesigns [GET] Users can request a listing of the current redesigns for a website. Whenever the site configuration is changed or new content is published, the redesigns list resets to only contain the current live design. + Parameters + id (required, string) - Site UUID + inflight (optional, boolean) - Whether to include in-flight redesigns in the listing + Response 200 (application/json) ### Requesting a redesign [POST] New redesigns can be requested by submitting a rating on an existing design. + Request (application/json) + Body ``` <!-- include(examples/redesignrequest-minimal.json) --> ``` + Schema ``` <!-- include(full-schema/redesignrequest.json) --> ``` + Response 202 + Headers Location: /job/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177 # 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
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 ## Redesigns [/site/{id}/redesign{?inflight}] ### Listing redesigns [GET] Users can request a listing of the current redesigns for a website. Whenever the site configuration is changed or new content is published, the redesigns list resets to only contain the current live design. + Parameters + id (required, string) - Site UUID + inflight (optional, boolean) - Whether to include in-flight redesigns in the listing + Response 200 (application/json) ### Requesting a redesign [POST] New redesigns can be requested by submitting a rating on an existing design. + Request (application/json) + Body ``` <!-- include(examples/redesignrequest-minimal.json) --> ``` + Schema ``` <!-- include(full-schema/redesignrequest.json) --> ``` + Response 202 + Headers Location: /job/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177 ## Redesign [/site/{id}/redesign/{redesign}{?inflight}] ### Individual redesign [GET] + Parameters + id (required, string) - Site UUID + redesign (required, string) - Redesign UUID + inflight (optional, boolean) - Whether to include in-flight redesigns in the listing + Response 200 (application/json) ### Publish a redesign [POST] A site can be updated to use any of the redesigns by publishing it. This will trigger a re-solve of the website. + Parameters + id (required, string) - Site UUID + redesign (required, string) - Redesign UUID + Response 202 + Headers Location: /job/61a23f6a-d438-49c3-a0b9-7cd5bb0fe177 ### Delete a redesign [DELETE] + Parameters + id (required, string) - Site UUID + redesign (required, string) - Redesign UUID + Response 200 ## Redesign Previews [/site/{id}/redesign/{redesign}/preview] ### Showing redesign preview [GET] + Parameters + id (required, string) - Site UUID + redesign (required, string) - Redesign UUID + Response 200 (text/html) # 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
Document the rest of the redesign routes
Document the rest of the redesign routes
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
aa748fac96f818f05b3f00f11a2074ef69a2c8cf
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) --> ``` ### Delete website [DELETE] + Response 200 ## Site logos [/site/{id}/logo] ### Set website logo [POST] + Request (multipart/form-data) A logo can be provided for a website by uploading it as multipart/form-data. Only SVG logos are supported. + Response 202 Logo was successfully updated ## 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
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 ## Site logos [/site/{id}/logo] ### Set website logo [POST] + Request (multipart/form-data) A logo can be provided for a website by uploading it as multipart/form-data. Only SVG logos are supported. + Response 202 Logo was successfully updated ## 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 200 ## 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
Update HTTP status code for deleting an item.
Update HTTP status code for deleting an item.
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
b27491ea42a293d1fd77375a6e24e6926dd36b27
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
d2cc556dedc346605afdaeaada5e540125e1db31
API.apib
API.apib
FORMAT: 1A # DraciDoupe.cz API for exposing underying public data from DraciDoupe.cz. ## Entry Point [/] ### List available pages [GET] + Response 200 (application/json) { "creations": [ { "name": "Tvorba", "items": [ { "name": "Články&Eseje", "type": "article", "_links": {"self": { "href": "/tvorba/clanky-a-eseje/" }} }, { "name": "Galerie", "type": "photo", "_links": {"self": { "href": "/tvorba/galerie/" }} }, { "name": "Fotogalerie", "type": "photo", "_links": {"self": { "href": "/tvorba/fotogalerie/" }} }, { "name": "Hřbitov", "type": "article", "_links": {"self": { "href": "/tvorba/hrbitov/" }} } ] }, { "name": "Doplňky", "items": [ { "name": "Dovednosti", "type": "skills", "_links": {"self": { "href": "/doplnky/dovednosti/" }} }, { "name": "Nová Povolání", "type": "article", "_links": {"self": { "href": "/doplnky/nova-povolani/" }} }, { "name": "Nové Rasy", "type": "article", "_links": {"self": { "href": "/doplnky/nove-rasy/" }} } ] }, { "name": "Pro PJ", "items": [ { "name": "Bestiář", "type": "monster", "_links": {"self": { "href": "/pro-pj/nestvury/" }} }, { "name": "Dobrodružství", "type": "adventure", "_links": {"self": { "href": "/pro-pj/dobrodruzstvi/" }} }, { "name": "Předměty", "type": "game-object", "_links": {"self": { "href": "/pro-pj/predmety/" }} } ] } ], "news": [ { "name": "Aktuality", "items": [ { "name": "Aktuality", "type": "news", "_links": {"self": { "href": "/aktuality/" }} }, ] } ] }
FORMAT: 1A # DraciDoupe.cz API for exposing underying public data from DraciDoupe.cz. ## Entry Point [/] ### List available pages [GET] + Response 200 (application/json) { "creations": [ { "name": "Tvorba", "items": [ { "name": "Články&Eseje", "type": "article", "_links": {"self": { "href": "/tvorba/clanky-a-eseje/" }} }, { "name": "Galerie", "type": "photo", "_links": {"self": { "href": "/tvorba/galerie/" }} }, { "name": "Fotogalerie", "type": "photo", "_links": {"self": { "href": "/tvorba/fotogalerie/" }} }, { "name": "Hřbitov", "type": "article", "_links": {"self": { "href": "/tvorba/hrbitov/" }} } ] }, { "name": "Doplňky", "items": [ { "name": "Dovednosti", "type": "skills", "_links": {"self": { "href": "/doplnky/dovednosti/" }} }, { "name": "Nová Povolání", "type": "article", "_links": {"self": { "href": "/doplnky/nova-povolani/" }} }, { "name": "Nové Rasy", "type": "article", "_links": {"self": { "href": "/doplnky/nove-rasy/" }} } ] }, { "name": "Pro PJ", "items": [ { "name": "Bestiář", "type": "monster", "_links": {"self": { "href": "/pro-pj/nestvury/" }} }, { "name": "Dobrodružství", "type": "adventure", "_links": {"self": { "href": "/pro-pj/dobrodruzstvi/" }} }, { "name": "Předměty", "type": "game-object", "_links": {"self": { "href": "/pro-pj/predmety/" }} } ] } ], "news": [ { "name": "Aktuality", "items": [ { "name": "Aktuality", "type": "news", "_links": {"self": { "href": "/aktuality/" }} }, ] } ] } ## News [/] ### Retrieve all news [GET] + Response 200 (application/json) { "name": "Aktuality", "_links": {"self": { "href": "/aktuality/" }}, items: [ { date: "2017-01-02 02:02:02", title: "Example News", text: "Text of news (tm)", author: { nick: "Unknown/N", _url: "/uzivatele/123/" } }, { date: "2017-01-01 01:01:01", title: "Example News 2", text: "Text of news (tm), but longer", author: { nick: "Unknown/N", _url: "/uzivatele/123/" } } ] }
Add news
Add news
API Blueprint
mit
dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard,dracidoupe/graveyard
f37691231a7a05628d3b89aa28c43f1f50979a66
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] 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": [ ] } ] } ] ## 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": [ ] } ] } ] ## 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>" }
Use .json extension for categories
Use .json extension for categories
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
a3ae33e19191ea6baa1143cbcb650622e5201ef6
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://events.oakscastle.org/api/ # Oaks Management A service for collectively managing shared space. [The project roadmap is coalescing on GitHub.](//github.com/oakscastle/event) # Group Areas Areas recursively represent the spaces available. ## Area [/v1/areas/{id}] + Attributes - id: *FED210* (string, required) - object guid - name: *The Oaks Castle* (string) - image: *//i.io/t.svg* (string) - svg to load - contains (array[Contained Area]) - child areas ### View Area [GET] + Response 501 ## Area with Descendants [/v1/areas/{id}/tree] + Parameters - id: house (string) - guid of area to return ### List Areas [GET] + Request + Headers Location: /api/v1/areas/house/tree + Response 200 (application/json) + Attributes - areas (house_tree) # Group Reservations ## Reservation [/v1/reservations/{id}] + Attributes - id: *MJHGT7* (string, required) - reservation guid - for: *kitchen* (string, required) - area guid - starts_at: *`2015-11-21@17:54`* (string) - commencement time - ends_at: *`2015-11-21@17:54`* (string) - termination time ### View Reservation [GET] + Response 501 ## Area Reservations [/v1/areas/{id}/tree/reservations{?from,to}] Return all reservatons for an area and its descendants. + Parameters - id: house (string) - area guid - from: `2015-11-21@17:54` (string) - lower bound - to: `2015-11-31@17:54` (string) - upper bound + Attributes (array[Reservation]) ### List Reservations [GET] + Response 200 (application/json) + Attributes - reservations (array[Reservation]) # Group Events ## Event [/v1/events/{id}] + Attributes - id: *wedding* (string, required) - event guid - in: *kitchen* (string, required) - area guid - name: *Bob & Alice Get Hitched* (string) - starts_at: *`2015-11-21@17:54`* (string) - commencement time - ends_at: *`2015-11-21@17:54`* (string) - termination time - adds (array[Contained Area]) - areas that exist for the event - parts: toast, dinner, dance (array) - constituent event guids ### View Event [GET] + Response 501 ## Area Events [/v1/areas/{id}/events{?from,to}] Return abbreviated event info for an area. + Parameters - id: house (string) - area guid - from: `2015-11-21@17:54` (string) - lower bound - to: `2015-11-31@17:54` (string) - upper bound ### List Events [GET] + Response 200 (application/json) + Attributes - events (array[Event]) ## Event with Parts [/v1/events/{id}/tree] Return an event and all its descendants. + Parameters - id: wedding (string) - event guid ### List Events [GET] + Response 200 (application/json) + Attributes - events (array[Event]) # Group Bids ## Bid [ # Data Structures # Contained Area - area: *h9iAjB* (string) - area guid - x: *5* (number) - y: *10* (number) - width: *10* (number) - height: *20* (number) # house_single - id: house - image: house.svg - contains (array) - (object) - area: kitchen - x: 50 (number) - y: 50 (number) - width: 100 (number) - height: 50 (number) - (object) - area: den - x: 25 (number) - y: 20 (number) - width: 100 (number) - height: 50 (number) # house_tree (array) - (house_single) - (object) - id: kitchen - image: kitchen.svg - (object) - id: den - image: den.svg - contains (array) - area: tv - x: 25 (number) - y: 25(number) - width: 10 (number) - height: 10 (number) - (object) - id: tv - image: tv.svg
FORMAT: 1A HOST: http://events.oakscastle.org/api/v1/ # Oaks Management A service for collectively managing shared space. [The project roadmap is coalescing on GitHub.](//github.com/oakscastle/event) # Group Areas Areas recursively represent the spaces available. ## Area [/areas/{id}] + Attributes - id: *FED210* (string, required) - object guid - name: *The Oaks Castle* (string) - image: *//i.io/t.svg* (string) - svg to load - contains (array[Contained Area]) - child areas ### View Area [GET] + Response 501 ## Area with Descendants [/areas/{id}/tree] + Parameters - id: house (string) - guid of area to return ### List Areas [GET] + Request + Headers Location: /api/v1/areas/house/tree + Response 200 (application/json) + Attributes - areas (house_tree) # Group Reservations ## Reservation [/reservations/{id}] + Attributes - id: *MJHGT7* (string, required) - reservation guid - for: *kitchen* (string, required) - area guid - starts_at: *`2015-11-21@17:54`* (string) - commencement time - ends_at: *`2015-11-21@17:54`* (string) - termination time ### View Reservation [GET] + Response 501 ## Area Reservations [/areas/{id}/tree/reservations{?from,to}] Return all reservatons for an area and its descendants. + Parameters - id: house (string) - area guid - from: `2015-11-21@17:54` (string) - lower bound - to: `2015-11-31@17:54` (string) - upper bound + Attributes (array[Reservation]) ### List Reservations [GET] + Response 200 (application/json) + Attributes - reservations (array[Reservation]) # Group Events ## Event [/events/{id}] + Attributes - id: *wedding* (string, required) - event guid - in: *kitchen* (string, required) - area guid - name: *Bob & Alice Get Hitched* (string) - starts_at: *`2015-11-21@17:54`* (string) - commencement time - ends_at: *`2015-11-21@17:54`* (string) - termination time - adds (array[Contained Area]) - areas that exist for the event - parts: toast, dinner, dance (array) - constituent event guids ### View Event [GET] + Response 501 ## Area Events [/areas/{id}/events{?from,to}] Return abbreviated event info for an area. + Parameters - id: house (string) - area guid - from: `2015-11-21@17:54` (string) - lower bound - to: `2015-11-31@17:54` (string) - upper bound ### List Events [GET] + Response 200 (application/json) + Attributes - events (array[Event]) ## Event with Parts [/events/{id}/tree] Return an event and all its descendants. + Parameters - id: wedding (string) - event guid ### List Events [GET] + Response 200 (application/json) + Attributes - events (array[Event]) # Group Bids ## Bid [ # Data Structures # Contained Area - area: *h9iAjB* (string) - area guid - x: *5* (number) - y: *10* (number) - width: *10* (number) - height: *20* (number) # house_single - id: house - image: house.svg - contains (array) - (object) - area: kitchen - x: 50 (number) - y: 50 (number) - width: 100 (number) - height: 50 (number) - (object) - area: den - x: 25 (number) - y: 20 (number) - width: 100 (number) - height: 50 (number) # house_tree (array) - (house_single) - (object) - id: kitchen - image: kitchen.svg - (object) - id: den - image: den.svg - contains (array) - area: tv - x: 25 (number) - y: 25(number) - width: 10 (number) - height: 10 (number) - (object) - id: tv - image: tv.svg
correct v1
correct v1
API Blueprint
artistic-2.0
oakscastle/event
0d935d053c44b57fb2cbbbc1d0f2688546c67ef4
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" } ] } ### 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 + 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] not implemented yet + 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_NAME_ID":"234234234234", "SERVICE_ADMIN_USER":"adm1", "SERVICE_ADMIN_PASSWORD": "password", "SERVICE_ADMIN_TOKEN": "token", "ROLE_NAME":"ServiceCustomer", "ROLE_NAME_ID":"sadfasdfasdfas", "SERVICE_USER_NAME":"user_nameX", "SERVICE_USER_ID":"asdfasdf", "INHERIT":true } + Response 201 ## Users in Service [/v1.0/service/{serviceId}/user] ### Users list [GET] + Parameters + serviceId (required, `string`) ... Service Id + 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 + 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] not implemented yet + 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_NAME_ID":"234234234234", "SERVICE_ADMIN_USER":"adm1", "SERVICE_ADMIN_PASSWORD": "password", "SERVICE_ADMIN_TOKEN": "token", "ROLE_NAME":"ServiceCustomer", "ROLE_NAME_ID":"sadfasdfasdfas", "SERVICE_USER_NAME":"user_nameX", "SERVICE_USER_ID":"asdfasdf", "INHERIT":true } + Response 201 ## Users in Service [/v1.0/service/{serviceId}/user] ### Users list [GET] + Parameters + serviceId (required, `string`) ... Service Id + 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
update apiary doc
update apiary doc
API Blueprint
agpl-3.0
telefonicaid/orchestrator,telefonicaid/orchestrator
a0c84c493eb1a160ebb83923238f51f58992ba17
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://iot-camera-object-recognizer.herokuapp.com/ # IOT Object Camera Recognizer. IOT object camera recognizer. Orginize camera objects list and check current state of stage. # Get List or Add new Object api [/webapi/houses/{houseid}/objects] + Parameters + houseid (required, string, `"76c6-456d-8971"`) ... Unique house identifier ## List All Objects [GET] Returns code 200 and list of jsons if correct houseid, 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 houseid 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 [/webapi/houses/{houseid}/objects/{objectid}] + Parameters + objectid (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 houseid or objectid 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/{houseid}/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 houseid is invalid. + Parameters + houseid - 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/ # 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 [/webapi/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 [/webapi/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)
Update API Blueprint
Update API Blueprint
API Blueprint
mit
freeuni-sdp/iot-camera-object-recognizer
b5429ae7e2cdcf1853bd04bb89ee10231e357377
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://localhost # KaThinka Is testing api for **KaThinka** project ## Retrieve Entry Point [/] ### Check if api is connected to db and running [GET] + Response 200 (application/json; charset=utf-8) { "status": "up", "version": "1" } # Group Users Users related resources of the **Users API** ## Users Collection [/users] ### List all Users [GET] + Response 200 (application/json) [{ "id": 1, "name": "Mario" }, { "id": 2, "name": "Luigi" }] ### Create a User [POST] + Request (application/json) { "name": "Princess Peach" } + Response 201 (application/json) { "id": 3, "name": "Princess Peach" } ## User [/users/{id}] A single User object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the User to perform action with. Has example value. ### Retrieve a User [GET] + Response 200 (application/json) + Body { "id": 2, "title": "Luigi" } ### Remove a User [DELETE] + Response 204
FORMAT: 1A HOST: http://localhost # KaThinka Is testing api for **KaThinka** project ## Retrieve Entry Point [/] ### Check if api is connected to db and running [GET] + Response 200 (application/json; charset=utf-8) { "status": "up", "version": "1" } # Group Users Users related resources of the **Users API** ## Users Collection [/users] ### Create a User [POST] + Request (application/json) { "name": "Mario" } + Response 201 (application/json) { "name": "Mario" } ### List all Users [GET] + Response 200 (application/json) [{ "name": "Mario" }] ## User [/users/{id}] A single User object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the User to perform action with. Has example value. ### Retrieve a User [GET] + Response 200 (application/json) + Body { "title": "Mario" } ### Remove a User [DELETE] + Response 204
Change api order
Change api order
API Blueprint
mit
Wercajk/KaThinka,Wercajk/KaThinka
96d5e8a0de25df969100259aa99f76d1a0cb36b4
apiary.apib
apiary.apib
HOST: http://prometheus-api.herokuapp.com/   --- Prometheus API ---   -- Exchange Resources -- List all stock exchanges GET /exchange < 200 < Content-Type: application/json {   "total_pages": 1,   "objects": [     {       "commodities": [],       "id": 1,       "name": "New York Stock Exchange",       "symbol": "NYSE",       "utc_created": "2013-05-18T04:08:32.702383",       "utc_updated": "2013-05-18T04:08:32.702432"     }   ],   "num_results": 1,   "page": 1 } List a particular stock exchange GET /exchange/{id} < 200 < Content-Type: application/json { "commodities": [], "id": 1, "name": "New York Stock Exchange", "symbol": "NYSE", "utc_created": "2013-05-18T04:08:32.702383", "utc_updated": "2013-05-18T04:08:32.702432" }   Add new stock exchanges POST /exchange > Content-Type: application/json { "name":"New York Stock Exchange", "symbol": "NYSE" } < 201 < Content-Type: application/json {"id": 1}
HOST: http://prometheus-api.herokuapp.com/ --- Prometheus API --- -- Exchange Resources -- List all stock exchanges GET /exchange < 200 < Content-Type: application/json { "total_pages": 1, "objects": [ { "commodities": [], "id": 1, "name": "New York Stock Exchange", "symbol": "NYSE", "utc_created": "2013-05-18T04:08:32.702383", "utc_updated": "2013-05-18T04:08:32.702432" } ], "num_results": 1, "page": 1 } List a particular stock exchange GET /exchange/{id} < 200 < Content-Type: application/json { "commodities": [], "id": 1, "name": "New York Stock Exchange", "symbol": "NYSE", "utc_created": "2013-05-18T04:08:32.702383", "utc_updated": "2013-05-18T04:08:32.702432" } Add new stock exchanges POST /exchange > Content-Type: application/json { "name":"New York Stock Exchange", "symbol": "NYSE" } < 201 < Content-Type: application/json {"id": 1}
Fix merge conflict
Fix merge conflict
API Blueprint
mit
nerevu/prometheus-api,nerevu/prometheus-api,nerevu/prometheus-api
8b6b8d8d5bbd20a7ae5750d3fb635a2049072cd7
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 X-My-Header: The Value + Body { "id": "where-to-go-to-get-free-debt-advice", "title": "Where to go to get free debt advice" }
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" }
Add link header to API Blueprint
Add link header to API Blueprint
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
586e028029e824dcf94f6831bd005147a540b1d6
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://rails5-api-base.herokuapp.com # API BASE Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. ## Users Collection [/api/v1/users] ### Sign Up [POST] + Request (application/json) + Body { "user": { "username": "test", "email": "[email protected]", "password": "password", "password_confirmation": "password", "first_name": "Johhny", "last_name": "Perez" } } + Response 401 + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Body { "id": 102, "email": "[email protected]", "provider": "email", "uid": "[email protected]", "first_name": "", "last_name": "", "username": "test", "created_at": "2017-02-23T13:54:33.283Z", "updated_at": "2017-02-23T13:54:33.425Z" } ## Current user's profile [/api/v1/user/] ### Get current user profile [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 401 + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Body { "user": { "email": "[email protected]", "username": "test", "first_name": "John", "last_name": "Doe" } } ### Update current user profile [PUT] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Body { "user": { "username": "test", "password": "password", "first_name": "John", "last_name": "Doe" } } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Body { "user": { "email": "[email protected]", "username": "test", "first_name": "John", "last_name": "Doe" } } ## Get other user's profile [/api/v1/users/{id}] ### Get user [GET] + Request (application/json) + Parameters + id (integer, required) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 401 + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Body { "user": { "email": "[email protected]", "username": "test", "first_name": "John", "last_name": "Doe" } } ## Login [/api/v1/users/sign_in] ### Login [POST] + Request (application/json) + Body { "user": { "email": "[email protected]", "password": "password" } } + Response 401 + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Body { "user": { "id": 102, "email": "[email protected]", "provider": "email", "uid": "[email protected]", "first_name": "", "last_name": "", "username": "test", "created_at": "2017-02-23T13:54:33.283Z", "updated_at": "2017-02-23T13:54:33.425Z" } } ## Login with Facebook [/api/v1/user/facebook] ### Login with Facebook [POST] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Body { "user": { "id": 366, "email": "[email protected]", "first_name": "Test", "last_name": "test", "username": "", "provider": "facebook", "uid": "1234567890" } } ## Logout [/api/v1/users/sign_out] ### Logout [DELETE] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Response 200 (application/json) ## Reset password [/api/v1/users/password] ### Reset passowrd [POST] Use this route to send a password reset confirmation email https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow + Request (application/json) + Body { "email": "[email protected]", "redirect_url": "http://www.example.com" } + Response 200 (application/json) + Body { "success": true, "message": "An email has been sent to '[email protected]' containing instructions for resetting your password." } ### Reset passowrd [PUT] Use this route to change user's passwords https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow + Request (application/json) + Parameters + reset_password_token (string, required) + Body { "password": "12345678", "password_confirmation": "12345678" } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Body { "user": { "id": 366, "email": "[email protected]", "first_name": "Test", "last_name": "test", "username": "", "provider": "facebook", "uid": "1234567890" } } ## Edit reset password [/api/v1/users/password/edit] ### Edit reset password [GET] This route is the destination URL for password reset confirmation https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow + Request (application/json) + Parameters + reset_password_token (string, required) + redirect_url (string) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected]
FORMAT: 1A HOST: http://rails5-api-base.herokuapp.com # API BASE Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. ## Users Collection [/api/v1/users] ### Sign Up [POST] + Request (application/json) + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Current user's profile [/api/v1/user/profile] ### Get current user profile [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ### Update current user profile [PUT] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) ## Get other user's profile [/api/v1/users/{id}] ### Get user [GET] + Request (application/json) + Parameters + id (integer, required) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (User, required) + Response 401 ## Login [/api/v1/users/sign_in] ### Login [POST] + Request (application/json) + Body { "user": { "email": "[email protected]", "password": "password" } } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Login with Facebook [/api/v1/user/facebook] ### Login with Facebook [POST] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Attributes + user (Profile Response, required) ## Logout [/api/v1/users/sign_out] ### Logout [DELETE] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Response 200 (application/json) ## Reset password [/api/v1/users/password] More information of how reset password works: https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow ### Reset password [POST] Use this route to send a password reset confirmation email + Request (application/json) + Body { "email": "[email protected]", "redirect_url": "http://www.example.com" } + Response 200 (application/json) + Body { "success": true, "message": "An email has been sent to '[email protected]' containing instructions for resetting your password." } ### Reset password [PUT] Use this route to change user's passwords + Request (application/json) + Parameters + reset_password_token (string, required) + Body { "password": "12345678", "password_confirmation": "12345678" } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes (Profile Response) ## Edit reset password [/api/v1/users/password/edit] ### Edit reset password [GET] This route is the destination URL for password reset confirmation + Request (application/json) + Parameters + reset_password_token (string, required) + redirect_url (string) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] # Data Structures ## Profile Response (object) + id: 100 (number) + email: [email protected] (string) + provider: email, facebook, twitter (enum[string]) - it's way the user logins + uid: [email protected] (string) - the provider identifier + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) + created_at: 2017-02-23T13:54:33.283Z (string) ## Profile Edition (object) + email: [email protected] (string) + password: 12345678 (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) ## User (object) + email: [email protected] (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string)
Use Attributes and Data structures in Api Blueprint
Use Attributes and Data structures in Api Blueprint
API Blueprint
mit
rootstrap/rails_api_base,rootstrap/rails_api_base,rootstrap/rails_api_base,rootstrap/rails_api_base
bf7030e1d3f283101d78d2780d8ab78b8b1fa652
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", "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", <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="alternate"; title="Where to go to get free debt advice" + 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", <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="alterante"; title="Action plan – Prepare for the cost of having a baby" + 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", <https://www.moneyadviceservice.org.uk/en/articles/where-to-go-to-get-free-debt-advice>; rel="alternate"; title="Where to go to get free debt advice" + 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>", "categories": ["taking-control-of-debt"] } # 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", <https://www.moneyadviceservice.org.uk/en/action_plans/prepare-for-the-cost-of-having-a-baby>; rel="alterante"; title="Action plan – Prepare for the cost of having a baby" + 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>", "categories": ["budgeting-for-a-family","action-plans-having-a-baby"] } #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 categories to the article and action plan Apiary prototype.
Add categories to the article and action plan Apiary prototype. Forgotten about when added on public_website.
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
fa57ee48cc0341796b65b7f57884c2e452bf37ea
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", "password": "bar" } + Response 201 # Group Data Related resources of the **Data API** ## Datafiles Collection [/datafiles] ### Create a Datafile [POST] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "url": "http://s3.com/mnist-data.zip" } + Response 201 (application/json) { "id": "datafile-uuid" } ## Datasets Collection [/datasets] ### Create a Dataset [POST] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "datafile": "datafile-uuid", "split": { "training": 0.7, "testing": 0.3 } } + Response 201 (application/json) { "datasets": [ { "uuid": "training-dataset-uuid", "name":"training" }, { "uuid": "testing-dataset-uuid", "name":"testing" } ] } # Group Training Related resources of the **Training API** ## Solvers Collection [/solvers] ### Create a Solver [POST] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "engine": "caffe", "caffe": { "solver-prototxt-url": "http://s3.com/mnist.prototxt", "environment": { "training-source": "training-dataset-uuid", "testing-source": "training-dataset-uuid" } } } + 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", "status": "/training-jobs/{training-job-uuid}/status", "logs": "/training-jobs/{training-job-uuid}/logs" } ## 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] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "url": "http://s3.com/mnist-data.zip" } + Response 201 (application/json) { "id": "datafile-uuid" } ## Datasets Collection [/datasets] ### Create a Dataset [POST] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "datafile": "datafile-uuid", "split": { "training": 0.7, "testing": 0.3 } } + Response 201 (application/json) { "datasets": [ { "datafile-id": "datafile-uuid", "id": "training-dataset-uuid", "name":"training" }, { "datafile-id": "datafile-uuid", "id": "testing-dataset-uuid", "name":"testing" } ] } # Group Training Related resources of the **Training API** ## Solvers Collection [/solvers] ### Create a Solver [POST] + Request (application/json) + Header Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== + Body { "engine": "caffe", "caffe": { "solver-prototxt-url": "http://s3.com/mnist.prototxt", "environment": { "training-source": "training-dataset-uuid", "testing-source": "training-dataset-uuid" } } } + 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", "status": "/training-jobs/{training-job-uuid}/status", "logs": "/training-jobs/{training-job-uuid}/logs" } ## 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 api docs
update api docs
API Blueprint
apache-2.0
tleyden/elastic-thought,aaam/elastic-thought,aaam/elastic-thought,aaam/elastic-thought,tleyden/elastic-thought,tleyden/elastic-thought
de8c33df6492159628600e54152b0f1e4d0a41c2
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # rails-twitter Polls is a simple API allowing consumers to view polls and vote in them. ## 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: http://polls.apiblueprint.org/ # rails-twitter Polls is a simple API allowing consumers to view polls and vote in them. # group Tweet ## Tweets Collection [/tweets] ### List all Tweets [GET] + Response 200 (application/json) [ { "text": "Hello World", "created_at": "2017-06-05T08:40:51.620Z", }, { "text": "Bye World", "created_at": "2017-06-20T08:40:51.620Z", } ] ## Show Tweet [/tweets/{id}] + Parameters + id: 1001 (number, required) - Id of a tweet. ### Show Tweet [GET] + Response 200 (application/json) + Body { "text": "Hello World", "created_at": "2017-06-05T08:40:51.620Z", }
create show tweets api
create show tweets api
API Blueprint
mit
komcal/rails-twitter,komcal/rails-twitter,komcal/rails-twitter
0e6ced63ec0c71239e8b66203adaabc1ff52086d
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://rails5-api-base.herokuapp.com # API BASE Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. ## Users Collection [/api/v1/users] ### Sign Up [POST] + Request (application/json) + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Current user's profile [/api/v1/user/show] ### Get current user profile [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ### Update current user profile [PUT] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) ## Login [/api/v1/users/sign_in] ### Login [POST] + Request (application/json) + Body { "user": { "email": "[email protected]", "password": "password" } } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Logout [/api/v1/users/sign_out] ### Logout [DELETE] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Response 200 (application/json) ## Reset password [/api/v1/users/password] More information of how reset password works: https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow ### Reset password [POST] Use this route to send a password reset confirmation email + Request (application/json) + Body { "email": "[email protected]", "redirect_url": "http://www.example.com" } + Response 200 (application/json) + Body { "success": true, "message": "An email has been sent to '[email protected]' containing instructions for resetting your password." } ### Reset password [PUT] Use this route to change user's passwords + Request (application/json) + Parameters + reset_password_token (string, required) + Body { "password": "12345678", "password_confirmation": "12345678" } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes (Profile Response) ## Edit reset password [/api/v1/users/password/edit] ### Edit reset password [GET] This route is the destination URL for password reset confirmation + Request (application/json) + Parameters + reset_password_token (string, required) + redirect_url (string) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] # Data Structures ## Profile Response (object) + id: 100 (number) + email: [email protected] (string) + provider: email, facebook, twitter (enum[string]) - it's way the user logins + uid: [email protected] (string) - the provider identifier + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) + created_at: 2017-02-23T13:54:33.283Z (string) ## Profile Edition (object) + email: [email protected] (string) + password: 12345678 (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) ## User (object) + email: [email protected] (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string)
FORMAT: 1A HOST: http://rails5-api-base.herokuapp.com # API BASE Rails Api Base is a boilerplate project for JSON RESTful APIs. It follows the community best practices in terms of standards, security and maintainability, integrating a variety of testing and code quality tools. ## Users Collection [/api/v1/users] ### Sign Up [POST] + Request (application/json) + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Current user's profile [/api/v1/user] ### Get current user profile [GET] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ### Update current user profile [PUT] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg uid: [email protected] + Attributes + user (Profile Edition, required) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) ## Login [/api/v1/users/sign_in] ### Login [POST] + Request (application/json) + Body { "user": { "email": "[email protected]", "password": "password" } } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes + user (Profile Response, required) + Response 401 ## Logout [/api/v1/users/sign_out] ### Logout [DELETE] + Request (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Response 200 (application/json) ## Reset password [/api/v1/users/password] More information of how reset password works: https://github.com/lynndylanhurley/devise_token_auth/wiki/Reset-Password-Flow ### Reset password [POST] Use this route to send a password reset confirmation email + Request (application/json) + Body { "email": "[email protected]", "redirect_url": "http://www.example.com" } + Response 200 (application/json) + Body { "success": true, "message": "An email has been sent to '[email protected]' containing instructions for resetting your password." } ### Reset password [PUT] Use this route to change user's passwords + Request (application/json) + Parameters + reset_password_token (string, required) + Body { "password": "12345678", "password_confirmation": "12345678" } + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] + Attributes (Profile Response) ## Edit reset password [/api/v1/users/password/edit] ### Edit reset password [GET] This route is the destination URL for password reset confirmation + Request (application/json) + Parameters + reset_password_token (string, required) + redirect_url (string) + Response 200 (application/json) + Headers access-token: sO2bm_Bpdyoo8r78jZ-fqg client: QADgNCWRJj0LyRruqzYbBg expiry: 1489009792 uid: [email protected] # Data Structures ## Profile Response (object) + id: 100 (number) + email: [email protected] (string) + provider: email, facebook, twitter (enum[string]) - it's way the user logins + uid: [email protected] (string) - the provider identifier + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) + created_at: 2017-02-23T13:54:33.283Z (string) ## Profile Edition (object) + email: [email protected] (string) + password: 12345678 (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string) ## User (object) + email: [email protected] (string) + first_name: John (string) + last_name: Doe (string) + username: jdoe (string)
Update apiary.apib
Update apiary.apib Co-authored-by: Santiago Bartesaghi <[email protected]>
API Blueprint
mit
rootstrap/rails_api_base,rootstrap/rails_api_base,rootstrap/rails_api_base,rootstrap/rails_api_base
04f748d4136fe10d5f8cb016f771a840651cb807
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://www.google.com # Panoptes API Panoptes API is a *crowdsourcing system* based on serving _subjects_, images or other media, to _volunteers_ and asking them to _classify_ the _subject_ based on a defined _workflow_ for the _subject_ type. # Authentication Panoptes API provides an OAuth 2.0 authentication mechanism. (TODO: Describe Authentication Workflow). # Panoptes API Root [/] Panoptes API entry point. This resource does not have attributes intstead it lists links to the available resources. ## Retrieve Entry Point [GET] + Response 200 (application/vnd.api+json) + Body { "links": { "subjects": "/subjects", "users": "/users", "projects": "/projects", "workflows": "/workflows", "subject_sets": "/subject_sets", "groups": "/groups", "classifications": "/classifications", "memberships": "/memberships", "collections": "/collections" } } # Group User Resources related to *Panotpes API Users* ## User [/users/{id}] A single User object. A User is representation of the identity and contributions of a voluneteer. The User resource has the following attribtues: - id - created_at - updated_at - credited_name - display_name - login - email - zooniverse_id - classifications_count - languages *id*, *zooniverse_id*, *created_at*, *updated_at*, and *classification_count* are created and updated by the Panoptes API. + Parameters + id (integer) ... ID of the User as an integer key + Model (application/vnd.api+json) JSON-API representation of the User Resource. + Body { "links": { "user.projects": {}, "user.user_groups": {}, "user.subjects": {}, "user.collections": {} }, "users": { "id": 1, "created_at": "2014-03-20T00:15:47Z", "updated_at": "2013-09-30T10:20:32Z", "created_name": "Dr. Stuart Lynn", "display_name": "stuart", "login": "stuart", "email": "[email protected]", "zooniverse_id": "123432", "classifications_count": "104", "langauges": ["en-gb", "es-mx"], "links": { "projects": ["4", "43", "220"], "user_groups": ["8"], "subjects": ["1", "20", "40", "567"], "collections": ["3"] } } } ### Retrieve a single User [GET] + Response 200 [User][] ### Edit a single User [PUT] The currently logged in User may edit their record by sending a partial representation of the resource including their changes. A User cannot edit their links. + Request (application/vnd.api+json) { "credited_name": "Dr. Stuart Lynn, DDS" } + Response 200 (application/vnd.api+json) [User][] ### Destory a single User [DELETE] The current logged in User may delete themselves. This does not fully remove their record. It deactivates their projects and removes personally identifying information. + Response 204 ## Users Collection [/users{?page,per_page,sort}] Collection of all Users All collections add a *meta* attribute that is a hash containing paging information. - meta User resources are included a an array under the _users_ key + Model (application/vnd.api+json) JSON-API formatted respresentation of the Users collection + Body { "links": { "user.projects": {}, "user.user_groups": {}, "user.subjects": {}, "user.collections": {} }, "meta": { "users": { "page": 1, "page_size": 2, "count": 28, "include": [], "page_count": 14, "previous_page": 14, "next_page": 2, "first_href": "/users?page_size=2", "previous_href": "/users?page=14page_size=2", "next_href": "/users?page=2&page_size=2", "last_href": "/users?page=14&page_size=2" } } "users": [{ "id": 1, "created_at": "2014-03-20T00:15:47Z", "updated_at": "2013-09-30T10:20:32Z", "created_name": "Dr. Stuart Lynn", "display_name": "stuart", "login": "stuart", "email": "[email protected]", "zooniverse_id": "123432", "classifications_count": "104", "langauges": ["en-gb", "es-mx"], "links": { "projects": ["4", "43", "220"], "user_groups": ["8"], "subjects": ["1", "20", "40", "567"], "collections": ["3"] } }, { "id": 2, "created_at": "2014-03-20T00:15:47Z", "updated_at": "2013-09-30T10:20:32Z", "created_name": "Dr. Stuart Lynn", "display_name": "stuart", "login": "stuart", "email": "[email protected]", "zooniverse_id": "123432", "classifications_count": "104", "langauges": ["en-gb", "es-mx"], "links": { "projects": ["4", "43", "220"], "user_groups": ["8"], "subjects": ["1", "20", "40", "567"], "collections": ["3"] } }] } ### List all Users [GET] + Parameters + page (optional, integer) ... index of the collection page, 1 is default + per_page (optional, integer) ... number of items on a page. 20 is default + sort (optional, string) ... fields to sort collection by. id is default + Response 200 [Users Collection][]
FORMAT: 1A HOST: http://www.google.com # Panoptes API Panoptes API is a *crowdsourcing system* based on serving _subjects_, images or other media, to _volunteers_ and asking them to _classify_ the _subject_ based on a defined _workflow_ for the _subject_ type. # Authentication Panoptes API provides an OAuth 2.0 authentication mechanism. (TODO: Describe Authentication Workflow). # Panoptes API Root [/] Panoptes API entry point. This resource does not have attributes intstead it lists links to the available resources. ## Retrieve Entry Point [GET] + Response 200 (application/vnd.api+json) + Body { "links": { "subjects": "/subjects", "users": "/users", "projects": "/projects", "workflows": "/workflows", "subject_sets": "/subject_sets", "groups": "/groups", "classifications": "/classifications", "memberships": "/memberships", "collections": "/collections" } } # Group User Resources related to *Panotpes API Users* ## User [/users/{id}] A single User object. A User is representation of the identity and contributions of a voluneteer. The User resource has the following attribtues: - id - created_at - updated_at - credited_name - display_name - login - email - zooniverse_id - classifications_count - languages *id*, *zooniverse_id*, *created_at*, *updated_at*, and *classification_count* are created and updated by the Panoptes API. + Parameters + id (integer) ... ID of the User as an integer key + Model (application/vnd.api+json) JSON-API representation of the User Resource. + Body { "links": { "users.projects": { "href": "/projects/{users.projects}", "type": "projects" }, "users.user_groups": { "href": "/groups/{users.user_groups}", "type": "user_groups" }, "users.subjects": { "href": "/subjects/{users.subjects}", "type": "subjects" }, "users.collections": { "href": "/collections/{users.collections}", "type": "collections" } }, "users": { "id": 1, "created_at": "2014-03-20T00:15:47Z", "updated_at": "2013-09-30T10:20:32Z", "created_name": "Dr. Stuart Lynn", "display_name": "stuart", "login": "stuart", "email": "[email protected]", "zooniverse_id": "123432", "classifications_count": "104", "langauges": ["en-gb", "es-mx"], "links": { "projects": ["4", "43", "220"], "user_groups": ["8"], "subjects": ["1", "20", "40", "567"], "collections": ["3"] } } } ### Retrieve a single User [GET] + Response 200 [User][] ### Edit a single User [PUT] The currently logged in User may edit their record by sending a partial representation of the resource including their changes. A User cannot edit their links. + Request (application/vnd.api+json) { "users": { "credited_name": "Dr. Stuart Lynn, DDS" } } + Response 200 (application/vnd.api+json) [User][] ### Destory a single User [DELETE] The current logged in User may delete themselves. This does not fully remove their record. It deactivates their projects and removes personally identifying information. + Response 204 ## Users Collection [/users{?page,per_page,sort}] Collection of all Users All collections add a *meta* attribute that is a hash containing paging information. - meta User resources are included a an array under the _users_ key + Model (application/vnd.api+json) JSON-API formatted respresentation of the Users collection + Body { "links": { "user.projects": {}, "user.user_groups": {}, "user.subjects": {}, "user.collections": {} }, "meta": { "users": { "page": 1, "page_size": 2, "count": 28, "include": [], "page_count": 14, "previous_page": 14, "next_page": 2, "first_href": "/users?page_size=2", "previous_href": "/users?page=14page_size=2", "next_href": "/users?page=2&page_size=2", "last_href": "/users?page=14&page_size=2" } } "users": [{ "id": 1, "created_at": "2014-03-20T00:15:47Z", "updated_at": "2013-09-30T10:20:32Z", "created_name": "Dr. Stuart Lynn", "display_name": "stuart", "login": "stuart", "email": "[email protected]", "zooniverse_id": "123432", "classifications_count": "104", "langauges": ["en-gb", "es-mx"], "links": { "projects": ["4", "43", "220"], "user_groups": ["8"], "subjects": ["1", "20", "40", "567"], "collections": ["3"] } }, { "id": 2, "created_at": "2014-03-20T00:15:47Z", "updated_at": "2013-09-30T10:20:32Z", "created_name": "Dr. Stuart Lynn", "display_name": "stuart", "login": "stuart", "email": "[email protected]", "zooniverse_id": "123432", "classifications_count": "104", "langauges": ["en-gb", "es-mx"], "links": { "projects": ["4", "43", "220"], "user_groups": ["8"], "subjects": ["1", "20", "40", "567"], "collections": ["3"] } }] } ### List all Users [GET] + Parameters + page (optional, integer) ... index of the collection page, 1 is default + per_page (optional, integer) ... number of items on a page. 20 is default + sort (optional, string) ... fields to sort collection by. id is default + Response 200 [Users Collection][] # Group Classification Resources related to _Pantopes Classifications_. ## Classification [/classification/{id}] A single Classification resource object. This represents a _user's_ responses to a _worflow's_ questions about a _subject_. A classifications has the following attributes: - id - created_at - updated_at - complete - annotations Annotations is an array of of hashes. Hashs that answer a workflow question have the form `{ "key": "workflow question", "value": "user response"}` in addition there are following hashes that should be generated by a client: - started_at - finished_at - user_agent + Model (application/vnd.api+json) JSON-API formatted represenation of a classificaiton object + Body { "links": { "classifications.user": { "href": "/users/{classifications.user", "type": "classification" }, "classifications.project": { "href": "/projects/{classifications.project}", "type": "project" }, "classifications.workflow": { "href": "/workflows/{classification.workflow}", "type": "workflow" }, "classifications.subject": { "href": "/subjects/{classifications.subject}" "type": "subject" }, }, "classifications": { "id": 1001, "created_at": "2014-08-24T22:24:32Z", "updated_at": "2014-08-24T22:24:32Z", "complete": false, "annotations: [ {"key": "workflow-1", "value": [10.4, 12.4, 13.2]}, {"started_at": "2014-08-24T22:20:21Z"}, {"finished_at": "2014-08-24T22:24:31Z"}, {"user_agent": "cURL"} ], "links": { "user": "1", "subject": "10", "workflow": "81", "project": "2" } } } ### Retrieve a single Classification [GET] A User can only retrieve a single classification is it not completed in order to finish it. Otherwise they can get a list of classifications from the Classification Collection resource. + Response 200 [Classification][] ### Edit a single Classification [PUT] A User may modify an incomplete classification. It should be marked as completed when done. + Request (application/vnd.api+json) { "classifications": { "annotations": [ {"key": "workflow-1", "value": [10.4, 12.4, 13.2]}, {"key": "workflow-2", "value": "fishy"}, {"started_at": "2014-08-24T22:20:21Z"}, {"finished_at": "2014-08-24T22:24:31Z"}, {"user_agent": "cURL"} ] "complete": true } } + Response 200 [Classification][] ### Destroy a single Classification [DELETE] A User may delete an incomplete classification. + Response 204 ## Classification Collection [/classifications{?page,per_page,sort,project_id,group_id}] A representation of all the Classifications in a collection All collections add a *meta* attribute that is a hash containing paging information. - meta Classifications are return as an array under the _classifications_ key. + Model (application/vnd.api+json) A JSON API formatted respresentation of a collection of classification resources + Body { "links": { "classifications.user": { "href": "/users/{classifications.user", "type": "classification" }, "classifications.project": { "href": "/projects/{classifications.project}", "type": "project" }, "classifications.workflow": { "href": "/workflows/{classification.workflow}", "type": "workflow" }, "classifications.subject": { "href": "/subjects/{classifications.subject}" "type": "subject" }, }, "meta": { "classifications": { "page": 1, "page_size": 2, "count": 28, "include": [], "page_count": 14, "previous_page": 14, "next_page": 2, "first_href": "/classifications?page_size=2", "previous_href": "/classifications?page=14page_size=2", "next_href": "/classifications?page=2&page_size=2", "last_href": "/classifications?page=14&page_size=2" } } "classifications": [{ "id": 1001, "created_at": "2014-08-24T22:24:32Z", "updated_at": "2014-08-24T22:24:32Z", "complete": false, "annotations: [ {"key": "workflow-1", "value": [10.4, 12.4, 13.2]}, {"started_at": "2014-08-24T22:20:21Z"}, {"finished_at": "2014-08-24T22:24:31Z"}, {"user_agent": "cURL"} ], "links": { "user": "1", "subject": "10", "workflow": "81", "project": "2" } }, { "id": 1002, "created_at": "2014-08-24T22:25:32Z", "updated_at": "2014-08-24T22:28:32Z", "complete": ture, "annotations: [ {"key": "workflow-1", "value": [10.4, 12.4, 13.2]}, {"key": "workflow-2", "value": "starry"}, {"started_at": "2014-08-24T22:24:21Z"}, {"finished_at": "2014-08-24T22:28:31Z"}, {"user_agent": "cURL"} ], "links": { "user": "1", "subject": "11", "workflow": "81", "project": "2" } }] } ### List all classifications [GET] Only lists a classifications the active user has made, or classifications from other members of a user_group or projects the user has permission to view. + Parameters + page (optional, integer) ... index of the collection page, 1 is default + per_page (optional, integer) ... number of items on a page. 20 is default + sort (optional, string) ... fields to sort collection by. updated_at is default + project_id (optional, integer) ... only retrieve classifications for a specific project + group_id (optional, integer) ... only retrieve classifications for a specific user group + Response 200 [Classification Collection][] ### Create a Classification [POST] Create a classification by providing a JSON-API formatted object that must include annotations and a links hash with a subject, a project, and a workflow. Optionally may include the complete field, which will be set to true by default. + Request (application/vnd.api+json) { "classifications": { "complete": flase "annotations": [ {"key": "workflow-1", "value": [10.4, 12.4, 13.2]}, {"started_at": "2014-08-24T22:20:21Z"}, {"finished_at": "2014-08-24T22:24:31Z"}, {"user_agent": "cURL"} ], "links": { "subject": "11", "workflow": "81", "project": "2" } } } + Response 201 [Classification][]
Add Classification Docs
Add Classification Docs
API Blueprint
apache-2.0
rogerhutchings/Panoptes,parrish/Panoptes,parrish/Panoptes,astopy/Panoptes,astopy/Panoptes,edpaget/Panoptes,astopy/Panoptes,astopy/Panoptes,srallen/Panoptes,parrish/Panoptes,zooniverse/Panoptes,camallen/Panoptes,edpaget/Panoptes,rogerhutchings/Panoptes,zooniverse/Panoptes,srallen/Panoptes,edpaget/Panoptes,marten/Panoptes,camallen/Panoptes,parrish/Panoptes,zooniverse/Panoptes,rogerhutchings/Panoptes,rogerhutchings/Panoptes,camallen/Panoptes,camallen/Panoptes,marten/Panoptes,marten/Panoptes,srallen/Panoptes,edpaget/Panoptes,srallen/Panoptes,zooniverse/Panoptes,marten/Panoptes
b1e888c5583279096f20766ebf38195ef5e8b074
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
82bd18ea78b6e91897b96189f2dd4d972ce80c22
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://api.opened.io # OpenEd The **OpenEd API** allows you to search for educational resources based on keywords or Common Core standardsOpenEd is the world's largest educational resource catalog, currently with over 250,000 videos, games and other resources. It is the only site completely focused on aligning educational resources to standards. The **OpenEd API** lets you use the capabilities of the OpenEd engine for finding resources and providing information about educational standards (Common Core and otherwise) inside your own apps and websites. All API access is over HTTPS, and accessed from the api.opened.io domain. All data is sent and received as JSON. API calls which make changes require OAuth 2 authentication. OpenEd allows videos to be searchable with the following REST API, from any app, web or otherwise. ## Manage Resources [/resources] ### Search Resources [GET] Find resources based on: * descriptive - searches title, description, area_title and subject_title with Solr fulltext search * standard_group_id - looks for resources aligned with specified standards are in the standard_group by standard_group.id * category - looks for resources aligned with specified standards are in the category by category.id or category.title * standard - looks for resources aligned with specified standard by standard.id (the internal object ID) or standard.identifier (the Common Core ID) * area - looks for resources assigned with specified area (and/or with specified subjects of area) by area.id or area.title * subject - looks for resources assigned with specified subject by subject.id or subject.title * grade - restricts to specified grades (expressed as K,1, .. 12) * ids - comma separated list of resource IDs (will ignore all other supplied filters) * limit - resources to return, default to 50 * contribution_name - the name of the contribution (e.g. "BrightStorm", "KhanAcademy") + Response 200 (application/json) { "meta": {"resources_total_count":19,"resources_page_count":3,"resources_per_page":3}, "resources": [ { "standard_idents": [ "F.IF.3" ], "grades_range": "6-12", "contribution_name": "PBS", "description": "Apply the Fibonacci Sequence and find its relationship to a piano keyboard. Explore various relationships between music and the Fibonacci Sequence.", "embeddable": false, "resource_type": "other", "id": 101504, "thumb": "https://opened.s3.amazonaws.com/pictures/101504/thumb/pbs-logo.png?1358125703", "title": "The Fibonacci Keyboard", "share_url": "http://www.opened.io/#/share/101504", "rating": 3, "my_rating": null, "safe_url": "http://www.pbs.org/jazz/classroom/fibonacci.htm" } ] }
FORMAT: 1A HOST: http://api.opened.io # OpenEd The **OpenEd API** allows you to search for educational resources based on keywords or Common Core standardsOpenEd is the world's largest educational resource catalog, currently with over 250,000 videos, games and other resources. It is the only site completely focused on aligning educational resources to standards. The **OpenEd API** lets you use the capabilities of the OpenEd engine for finding resources and providing information about educational standards (Common Core and otherwise) inside your own apps and websites. All API access is over HTTPS, and accessed from the api.opened.io domain. All data is sent and received as JSON. API calls which make changes require OAuth 2 authentication. OpenEd allows videos to be searchable with the following REST API, from any app, web or otherwise. # Manage Resources [/resources] ## Search Resources [GET] Find resources based on: * descriptive - searches title, description, area_title and subject_title with Solr fulltext search * standard_group_id - looks for resources aligned with specified standards are in the standard_group by standard_group.id * category - looks for resources aligned with specified standards are in the category by category.id or category.title * standard - looks for resources aligned with specified standard by standard.id (the internal object ID) or standard.identifier (the Common Core ID) * area - looks for resources assigned with specified area (and/or with specified subjects of area) by area.id or area.title * subject - looks for resources assigned with specified subject by subject.id or subject.title * grade - restricts to specified grades (expressed as K,1, .. 12) * ids - comma separated list of resource IDs (will ignore all other supplied filters) * limit - resources to return, default to 50 * contribution_name - the name of the contribution (e.g. "BrightStorm", "KhanAcademy") + Response 200 (application/json) { "resources": [ { "standard_idents": [ "F.IF.3" ], "grades_range": "6-12", "contribution_name": "PBS", "description": "Apply the Fibonacci Sequence and find its relationship to a piano keyboard. Explore various relationships between music and the Fibonacci Sequence.", "embeddable": false, "resource_type": "other", "id": 101504, "thumb": "https://opened.s3.amazonaws.com/pictures/101504/thumb/pbs-logo.png?1358125703", "title": "The Fibonacci Keyboard", "share_url": "http://www.opened.io/#/share/101504", "rating": 3, "my_rating": null, "safe_url": "http://www.pbs.org/jazz/classroom/fibonacci.htm" } ] } ## Add Resources [POST] Attributes of resource to add. For example: + Request (application/json) { "url": "http://yoursite.com/yourawesomevideo.mp4", "title": "My Awesome Counting Video", "description": "Vun octopus arm, two octopus arms..three vunderful octopus arms", "standard_idents": [ "K.CC.1", "K.CC.4" ], "grades_range": "K-1", "contribution_name": "YourSite", "resource_type": "video", "rating": "5", "image": "http://yoursite.com/pics/awesomevideothumb.jpg" } + Response 200
add resource method documented
add resource method documented
API Blueprint
mit
Almad/openedapi,openedinc/openedapi
6da769024dca63dbbfce43a325b10d52e06f7a95
apiary.apib
apiary.apib
HOST: http://www.silex.me/api/v1.0/ --- Unifile API --- --- Welcome to the our sample API documentation. All comments can be written in (support [Markdown](http://daringfireball.net/projects/markdown/syntax) syntax) --- -- Services utilities Utilities to discover services -- List services GET /services/list < 200 < Content-Type: application/json [ { "name": "dropbox", "display_name": "Dropbox", "image_small": "unifile-assets/services/dropbox.png", "description": "Edit html files from your Dropbox.", "visible": true, "isLoggedIn": true, "isConnected": true, "isOAuth": true, "user": { "display_name": "Alex Hoyau", "quota_info": { "available": 5234491392, "used": 2899550907 } } }, { "name": "ftp", "display_name": "FTP", "image_small": "unifile-assets/services/ftp.png", "description": "Edit files on a web server.", "visible": true, "isLoggedIn": false, "isConnected": false, "isOAuth": false } ]
FORMAT: 1A HOST: http://www.silex.me/api/v1.0 # Unifile API This is the API to manage your users' cloud services from your application. ## Resources [Unifile, unified access to cloud storage services through a simple web API.](https://github.com/silexlabs/unifile) ## Services list [/services/list] ### List the available services [GET] + Response 200 (application/json; charset=utf-8) [ { "name": "dropbox", "display_name": "Dropbox", "image_small": "unifile-assets/services/dropbox.png", "description": "Edit html files from your Dropbox.", "visible": true, "isLoggedIn": true, "isConnected": true, "isOAuth": true, "user": { "display_name": "Alex Hoyau", "quota_info": { "available": 5234491392, "used": 2899550907 } } }, { "name": "ftp", "display_name": "FTP", "image_small": "unifile-assets/services/ftp.png", "description": "Edit files on a web server.", "visible": true, "isLoggedIn": false, "isConnected": false, "isOAuth": false } ] # Group Service authentication and user account ## User account [/*/account] ### List the available information concerning the authenticated user [GET] + Response 200 (application/json; charset=utf-8) + Response 401 (application/json; charset=utf-8) { "success": false, "message": "User not connected yet. You need to call the 'login' service first.", "code": 401 } ## Connect the user [/*/connect] ### Connect the user and start the oauth process [GET] After calling connect, you are expected to follow the "authorize_url" provided in the response. There the user will authorize your app to acces his/her data. And then you will want to call the login route. + Response 200 (application/json; charset=utf-8) { "success": true, "message": "Now connected. You probably want to <a href=\"/api/v1.0/www-auth\">authenticate</a> now.", "authorize_url": "..." } ## User login [/*/login] ### Login after connection through oauth mechanism [GET] + Response 200 (application/json; charset=utf-8) { "success": true } + Response 401 (application/json; charset=utf-8) { "success": false, "message": "User not authorized.", "code": 401 }
connect and login
connect and login
API Blueprint
mit
silexlabs/unifile,JbIPS/unifile
1cb8f5457aed3e143033f47796ad7d45029fa495
blueprint/index.apib
blueprint/index.apib
FORMAT: 1A HOST: https://thegrid.io/ # The Grid API See the following sections: * [Authentication](authentication.html) * [Content Management](api.html) * [User Management](passport.html)
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).
Add some introduction
index: Add some introduction
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
d8c4945f2e03a46b1177fa540bb3a540d707bcc7
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 # 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
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] + Request + Attributes + 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/{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) image successfully removed
update API
update API
API Blueprint
mit
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
b53ea7474e394e41673857bf8f4b2775926d07c9
apiary.apib
apiary.apib
HOST: http://prometheus-api.herokuapp.com/ --- Prometheus API --- -- Exchange Resources -- List stock exchanges GET /exchange < 200 < Content-Type: application/json { "total_pages": 1, "objects": [ { "name": "New York Stock Exchange", "symbol": "NYSE", "commodities": [], "utc_created": "2013-05-18T04:08:32.702383", "id": 1, "utc_updated": "2013-05-18T04:08:32.702432" } ], "num_results": 1, "page": 1 } Add new stock exchanges POST /exchange > Content-Type: application/json { "name":"New York Stock Exchange", "symbol": "NYSE" } < 201 < Content-Type: application/json {"id": 1}
HOST: http://prometheus-api.herokuapp.com/ Format: 1A # Prometheus API ## Exchange Resources ### GET /exchange{/id} List stock exchanges + Parameters + id (int): ID of an exchange to retrieve. If no id specified all exchanges are returned. + Response 200 (application/json) + Parameters + commodities (array): Related commodities. + id (int): Exchange ID. + name (string): Exchange name. + symbol (string): Exchange symbol. + utc_created (string): UTC time the exchange was created. + utc_updated (string): UTC time the exchange was last updated. + Body { "total_pages": 1, "objects": [ { "name": "New York Stock Exchange", "symbol": "NYSE", "commodities": [], "utc_created": "2013-05-18T04:08:32.702383", "id": 1, "utc_updated": "2013-05-18T04:08:32.702432" } ], "num_results": 1, "page": 1 } ### POST /exchange Add new stock exchanges + Request new exchange (application/json) { "name":"New York Stock Exchange", "symbol": "NYSE" } + Response 201 (application/json) {"id": 1}
Update API docs
Update API docs
API Blueprint
mit
nerevu/prometheus-api,nerevu/prometheus-api,nerevu/prometheus-api
bb4b48d61eb15ae38d1ca0eb84743b57b1bed012
apiary.apib
apiary.apib
FORMAT: 1A TITLE: FIWARE-PaaS API v1 Specification DATE: 15 January 2016 VERSION: v1.0 APIARY_PROJECT: fiware-aiakos # FIWARE-Aiakos <!-- Copyright 2015 Telefónica I+D All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> Server with public API to manage ssh/gpg public keys for the support user of each FIWARE Lab node. ## Editors + Jesús Pérez González, Telefónica I+D ## Copyright Copyright (c) 2016 Telefónica Investigación y Desarrollo. This specification is licensed under the [FIWARE Open Specification License (implicit patents license)](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_(implicit_patents_license)). ## Status Final version aligned with FIWARE Release 5.3.5. # Group aiakos v1 ## Regions [/v1/support] ### Get list [GET] Get the region list with keys. Response in JSON: * Succesful operation uses 200 Ok * Body: a list of JSON with region name and date of last update of the availables keys. + Request (application/json) + Headers Accept: application/json + Response 200 (application/json) [ { "gpgkey": "2016-02-01T13:09:24.000Z", "regionName": "trento" }, { "gpgkey": "2016-02-01T13:09:24.000Z", "sshkey": "2016-02-01T13:09:24.000Z", "regionName": "spain" } ] ## Query key [/v1/support/{region_name}/{key}] Get the key for region + Parameters + region_name (required, string, `region1`) ... region name. + key (sshkey | gpgkey) ### Get key [GET] + Request (application/json) + Headers Accept: text/plain + Response 200 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 200 (text/plain) ssh-rsa fBIqA5CALsR/gF6ITbjnSSc5pYTDZ/T0JwIb5Z [email protected] ## Add key [/v1/support] Upload the keys with ssh and gpg format. ### Post key [POST] + Request (text/plain) + Headers X-Auth-Token: token-id Accept: text/plain + Request (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 201 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK-----
FORMAT: 1A TITLE: FIWARE-PaaS API v1 Specification DATE: 15 January 2016 VERSION: v1.0 APIARY_PROJECT: fiware-aiakos # FIWARE-Aiakos <!-- Copyright 2015 Telefónica I+D All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> Server with public API to manage ssh/gpg public keys for the support user of each FIWARE Lab node. ## Editors + Jesús Pérez González, Telefónica I+D ## Copyright Copyright (c) 2016 Telefónica Investigación y Desarrollo. This specification is licensed under the [FIWARE Open Specification License (implicit patents license)](http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_Open_Specification_Legal_Notice_(implicit_patents_license)). ## Status Final version aligned with FIWARE Release 5.3.5. # Group aiakos v1 ## Regions [/v1/support?regionName={regionName}] ### Get list [GET] Get the region list with keys. You should use regionName parameter in order to filter the list. Response in JSON: * Succesful operation uses 200 Ok * Body: a list of JSON with region name and date of last update of the availables keys. + Parameters + regionName (optional, String, `spain`) ... filter by region name + Request (application/json) + Headers Accept: application/json + Response 200 (application/json) [ { "gpgkey": "2016-02-01T13:09:24.000Z", "regionName": "trento" }, { "gpgkey": "2016-02-01T13:09:24.000Z", "sshkey": "2016-02-01T13:09:24.000Z", "regionName": "spain" } ] ## Query key [/v1/support/{regionName}/{key}] Get the key for region + Parameters + regionName (required, string, `region1`) ... region name. + key (sshkey | gpgkey) ### Get key [GET] + Request (application/json) + Headers Accept: text/plain + Response 200 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 200 (text/plain) ssh-rsa fBIqA5CALsR/gF6ITbjnSSc5pYTDZ/T0JwIb5Z [email protected] ## Add key [/v1/support] Upload the keys with ssh and gpg format. ### Post key [POST] + Request (text/plain) + Headers X-Auth-Token: token-id Accept: text/plain + Request (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK----- + Response 201 (text/plain) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au -----END PGP PUBLIC KEY BLOCK-----
add apiary doc
add apiary doc
API Blueprint
apache-2.0
telefonicaid/fiware-aiakos,telefonicaid/fiware-aiakos,telefonicaid/fiware-aiakos,telefonicaid/fiware-aiakos
2bfe08a9245a21ba3334b6e9771b3c7733b9a147
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(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-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 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(full-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 ## Random content [/share/random{?category,number}] ### Retrieve some pre-populated random content [GET] + Parameters + category (string) - Content category, for example `technology` + number (number) - How many items to retrieve + Response 200 (application/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) + offset (number) - Offset to use for pagination + limit (number) - Limit to use for pagination + site (string) - Receive only items associated with a site + 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 ## 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 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(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-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 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(full-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 ## Random content [/share/random{?category,number}] ### Retrieve some pre-populated random content [GET] + Parameters + category (string) - Content category, for example `technology` + number (number) - How many items to retrieve + Response 200 (application/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) + offset (number) - Offset to use for pagination + limit (number) - Limit to use for pagination + site (string) - Receive only items associated with a site + 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 ## 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
Document the 409 response on discovery API
Document the 409 response on discovery API
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
4365f41feb30f6050dec200cbde18a62953cb60c
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://fossilcalibrations.org/api/v1/ # fcdb-api fcdb-api is a read-only REST interace to the [Fossil Calibrations database](https://github.com/NESCent/FossilCalibrations) # Group Calibrations Calibrations related resources of the **fcdb-api** ## Calibrations Collection [/calibrations{?.format}{?maxAge,minAge,clade,tipTaxa%5B%5D,geologicalTime}] + Parameters + maxAge (optional, string) ... Maximum (oldest) calibration age in Ma. + minAge (optional, string) ... Minimum (youngest) calibration age in Ma. + clade (optional, string) ... Name of taxon identifying clade in which to search + tipTaxa%5B%5D (optional, array) ... Up to 2 taxa to use when performing an MRCA search. + geologicalTime (optional, string) ... Geological time period + format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json` ### Filter Calibrations [GET] Returns calibrations in the database, maching the optional filter parameters. + 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 read-only REST interace to the [Fossil Calibrations database](https://github.com/NESCent/FossilCalibrations) # Group Calibrations Calibrations related resources of the **fcdb-api** ## Calibrations Collection [/calibrations{?.format}{?maxAge,minAge,clade,tipTaxa%5B%5D,geologicalTime}] + Parameters + maxAge (optional, string) ... Maximum (oldest) calibration age in Ma. + minAge (optional, string) ... Minimum (youngest) calibration age in Ma. + clade (optional, string) ... Name of taxon identifying clade in which to search + tipTaxa%5B%5D (optional, array) ... Up to 2 taxa to use when performing an MRCA search. + geologicalTime (optional, string) ... Geological time period + format (optional, string, `json`) ... Format to return - supports `json` or `csv`, defaults to `json` ### Filter Calibrations [GET] #### Samples - GET /api/v1/calibrations?geologicalTime=Neogene - GET /api/v1/calibrations?minAge=10&maxAge=35 - GET /api/v1/calibrations.csv?clade=Primates - GET /api/v1/calibrations?tipTaxa[]=dog&tipTaxa[]=cat Returns calibrations in the database, maching the optional filter parameters. + 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 sample GET links
Add sample GET links
API Blueprint
mit
NESCent/fcdb-api,NESCent/fcdb-api
b340fe0e87fb4db1af83dd8c7bd6f4301377f579
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-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(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-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 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(full-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 ## Random content [/share/random{?category,number}] ### Retrieve some pre-populated random content [GET] + Parameters + category (string) - Content category, for example `technology` + number (number) - How many items to retrieve + Response 200 (application/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 ## 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-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(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-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 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 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 ## Random content [/share/random{?category,number}] ### Retrieve some pre-populated random content [GET] + Parameters + category (string) - Content category, for example `technology` + number (number) - How many items to retrieve + Response 200 (application/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 ## 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
Remove docs for deprecated /share uploading
Remove docs for deprecated /share uploading
API Blueprint
mit
the-grid/apidocs,the-grid/apidocs,the-grid/apidocs,the-grid/apidocs
931ae7e4a0f8b90aa143c6e4046c07d9ac2989d5
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: {{_}}://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": "{{<protocol}}//{{<hostname}}/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": "{{<protocol}}//{{<hostname}}/post", "json": { "origin": "{{<origin}}", "date": "{{<some_date}}", "whoarewe": "{{>whoarewe}}" } } PARAM some_static_param="somevalue" GET /get?whoarewe={{<whoarewe}}&origin={{<origin}}&somevalue={{<some_static_param}} > Accept: application/json > User-Agent: KATT < 200 < Content-Type: application/json { "args": { "whoarewe": "{{<your_name}}_and_{{<my_name}}", "origin": "{{<origin}}{{_}}", "somevalue": "{{<some_static_param}}" }, "headers": "{{_}}", "origin": "{{_}}", "url": "{{<protocol}}//{{<hostname}}/get?{{_}}&origin={{<origin}}&{{_}}" }
--- Examples against httpbin.org --- --- Examples of how some requests to _httpbin.org_ can be specified. Read more about the httpbin.org API at https://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: {{_}}://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": "{{<protocol}}//{{<hostname}}/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": "{{<protocol}}//{{<hostname}}/post", "json": { "origin": "{{<origin}}", "date": "{{<some_date}}", "whoarewe": "{{>whoarewe}}" } } PARAM some_static_param="somevalue" GET /get?whoarewe={{<whoarewe}}&origin={{<origin}}&somevalue={{<some_static_param}} > Accept: application/json > User-Agent: KATT < 200 < Content-Type: application/json { "args": { "whoarewe": "{{<your_name}}_and_{{<my_name}}", "origin": "{{<origin}}{{_}}", "somevalue": "{{<some_static_param}}" }, "headers": "{{_}}", "origin": "{{_}}", "url": "{{<protocol}}//{{<hostname}}/get?{{_}}&origin={{<origin}}&{{_}}" }
use https for httpbin
use https for httpbin
API Blueprint
apache-2.0
for-GET/katt
436e50fbb288f462e8c8e6c8c27050fe3d433b55
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": "0830647b-43c5-4641-96c8-bbb2a306c23f", "geometry": { "type": "Point", "coordinates": [ "151.6034", "-33.1567" ] }, "properties": { "reportUuid": "ea1c0c1f-df33-4e7d-bc64-70ca77500ea6", "guid": "tag:www.rfs.nsw.gov.au,2014-05-20:84431", "title": "Crangan Bay-West Coal Fire", "link": "http:\/\/www.rfs.nsw.gov.au\/dsp_content.cfm?cat_id=683", "category": "Advice", "pubdate": "2014-05-20T00:00:00Z", "firstSeen": "2013-11-30T06:48:00Z", "lastSeen": "2014-05-20T00: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": "NSW National Parks and Wildlife 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": "0830647b-43c5-4641-96c8-bbb2a306c23f", "geometry": { "type": "Point", "coordinates": [ "151.6034", "-33.1567" ] }, "properties": { "reportUuid": "ea1c0c1f-df33-4e7d-bc64-70ca77500ea6", "guid": "tag:www.rfs.nsw.gov.au,2014-05-20:84431", "title": "Crangan Bay-West Coal Fire", "link": "http:\/\/www.rfs.nsw.gov.au\/dsp_content.cfm?cat_id=683", "category": "Advice", "pubdate": "2014-05-20T00:00:00Z", "firstSeen": "2013-11-30T06:48:00Z", "lastSeen": "2014-05-20T00: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": "NSW National Parks and Wildlife 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": "" } }
Include updated payload examples.
Include updated payload examples.
API Blueprint
mit
DylanFM/bushfires
cce92f28eda6bb4c4d791713087e691918ef1b85
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 # 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{?query}] ### Perform xkcd Search [GET] + Parameters + query: `thumbs up` (string, required) - Search terms ## 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": "![gif](http://localhost:3993/images/default/xkcd.png)", "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) + Response 201 ## giphy Random [/giphy] ### Retrieve Random Giphy Gif [GET] ## giphy Search [/giphy/search{?query}] ### Retrieve Giphy Search [GET] + Parameters + query: `thumbs up` (string, required) - Search terms ## 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": "![gif](http://localhost:3993/images/default/xkcd.png)", "username": "scifgif" } ## 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/{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 # 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{?query}] ### Perform xkcd Search [GET] + Parameters + query: `thumbs up` (string, required) - Search terms ## 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": "![gif](http://localhost:3993/images/default/xkcd.png)", "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." } ## giphy Random [/giphy] ### Retrieve Random Giphy Gif [GET] ## giphy Search [/giphy/search{?query}] ### Retrieve Giphy Search [GET] + Parameters + query: `thumbs up` (string, required) - Search terms ## 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": "![gif](http://localhost:3993/images/default/xkcd.png)", "username": "scifgif" } ## 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/{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
update API
API Blueprint
mit
blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif,blacktop/scifgif
5f5acaa733c3689e2af288e56843c0cc3e9dbd9d
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] this is the same as calling `kdb get {path}` + 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 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] this is the same as calling `kdb set {path}` + Request (text/plain) hello world + Response 204 + Request (application/json) "hello world" + Response 204 + 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] this is the same as calling `kdb rm {path}` + Response 204 + 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] this is the same as calling `kdb get {path}` + 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] this is the same as calling `kdb set {path}` + 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] this is the same as calling `kdb rm {path}` + 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
add APIKEY_MISSING responses
elektrad.apib: add APIKEY_MISSING responses
API Blueprint
bsd-3-clause
e1528532/libelektra,petermax2/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,e1528532/libelektra,e1528532/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,BernhardDenner/libelektra,e1528532/libelektra,mpranj/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,mpranj/libelektra,BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,e1528532/libelektra
c389994cc1e828bcd3a47f0e5d0b48ede0da8336
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # Orgmanager API Polls is a simple API allowing consumers to view polls and vote in them. ## 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. ## 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 } ] }
Update API docs
:memo: Update API docs
API Blueprint
mpl-2.0
orgmanager/orgmanager,orgmanager/orgmanager,orgmanager/orgmanager
dddba2c0b13b4096d7c52b6bd039be5a753096c1
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": [ ] } ] } ] ## 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&nbsp;money", "description": "", "subCategories": [ ] }, { "id": "money-topics", "title": "Money topics", "description": "", "subCategories": [ ] }, { "id": "tools--resources", "title": "Tools &amp; 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>" }
Add more content for mock categories
Add more content for mock categories
API Blueprint
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
084318af5e97a97a8dbe519fa36fb8986de44c97
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
64aa6c639ae39a50bb80514de58592f698f7aa75
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # misskey-auth A misskey authz server api ## Create a New Application [/apps/create] Create a new application using user's credential. ### POST [POST] + Request (application/json) + Attributes + `screen-name`: john (string, required) - a user's name + `password`: password (string, required) - a user's password + `app-name`: test (string, required) - an application's name + `description`: description (string, required) - an application's description + `callback-url`: http://url.com/path/to/callback (string, optional) - a callback URL + Response 201 (application/json) + Attributes + `name`: test (string, required) - an application's name + `description`: description (string, required) - an application's description + `isPublicClient`: false (boolean, required) + `createdAt`: `2017-06-05T09:45:06.537Z` (string, required) - a timestamp which an application created + `userId`: 592f9a3d44c65921e47469c7 (string, required) - an id of a user who created an application + `id` : 59352822ecdf2b257d4c7949 (string, required) - an application's id(app-id) + `secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string, required) - an application-secret(app-secret) ## Destroy an Application [/apps/destroy] ### POST [POST] + Request (application/json) + Attributes + `app-id`: 59352822ecdf2b257d4c7949 (string, required) - an application's id + `app-secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string, required) - an application-secret + Response 200 (application/json) ## Show application's information [/apps/show] Show application's information. if you want to get `secret`, you need to authorize using `app-secret` or user's credential. ### POST [POST] + Request (application/json) + Attributes + `app-id`: 59352822ecdf2b257d4c7949 (string, required) - an application's id + One of + `app-secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string) - an application-secret + Properties + `screen-name`: john (string) - a user's name + `password`: password (string)- a user's password + Response 200 (application/json) + Attributes + `name`: test (string, required) - an application's name + `description`: description (string, required) - an application's description + `isPublicClient`: false (boolean, required) + `createdAt`: `2017-06-05T09:45:06.537Z` (string, required) - a timestamp which an application created + `userId`: 592f9a3d44c65921e47469c7 (string, required) - an id of a user who created an application + `id` : 59352822ecdf2b257d4c7949 (string, required) - an application's id(app-id) + `secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string, required) - an application-secret(app-secret) ## Search applications [/apps/search] Search applications using a user's id. ### POST [POST] + Request (application/json) + Attributes + `user-id`: 592f9a3d44c65921e47469c7 (string, required) - a user's id + Response 200 (application/json) + Attributes (array) + (object) + `name`: test (string, required) - an application's name + `description`: description (string, required) - an application's description + `isPublicClient`: false (boolean, required) + `createdAt`: `2017-06-05T09:45:06.537Z` (string, required) - a timestamp which an application created + `userId`: 592f9a3d44c65921e47469c7 (string, required) - an id of a user who created an application + `id` : 59352822ecdf2b257d4c7949 (string, required) - an application's id(app-id)
FORMAT: 1A HOST: http://polls.apiblueprint.org/ # misskey-auth A misskey authz server api # Data Structures ##Error(object) + `error` (string, required) - an error type + `description` (string, required) - a description of error + `uri` (string, optional) - a help uri ##Application(object) + `name`: test (string, required) - an application's name + `description`: description (string, required) - an application's description + `isPublicClient`: false (boolean, required) + `createdAt`: `2017-06-05T09:45:06.537Z` (string, required) - a timestamp which an application created + `userId`: 592f9a3d44c65921e47469c7 (string, required) - an id of a user who created an application + `id` : 59352822ecdf2b257d4c7949 (string, required) - an application's id(app-id) + `secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string, optional) - an application-secret(app-secret) ## Create a New Application [/apps/create] Create a new application using user's credential. ### POST [POST] + Request (application/json) + Attributes + `screen-name`: john (string, required) - a user's name + `password`: password (string, required) - a user's password + `app-name`: test (string, required) - an application's name + `description`: description (string, required) - an application's description + `callback-url`: http://url.com/path/to/callback (string, optional) - a callback URL + Response 201 (application/json) + Attributes(Application) + Response 400 (application/json) + Attributes(Error) ## Destroy an Application [/apps/destroy] ### POST [POST] + Request (application/json) + Attributes + `app-id`: 59352822ecdf2b257d4c7949 (string, required) - an application's id + `app-secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string, required) - an application-secret + Response 200 (application/json) + Response 400 (application/json) + Attributes(Error) ## Show application's information [/apps/show] Show application's information. if you want to get `secret`, you need to authorize using `app-secret` or user's credential. ### POST [POST] + Request (application/json) + Attributes + `app-id`: 59352822ecdf2b257d4c7949 (string, required) - an application's id + One of + `app-secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string) - an application-secret + Properties + `screen-name`: john (string) - a user's name + `password`: password (string)- a user's password + Response 200 (application/json) + Attributes(Application) + Response 400 (application/json) + Attributes(Error) ## Search applications [/apps/search] Search applications using a user's id. ### POST [POST] + Request (application/json) + Attributes + `user-id`: 592f9a3d44c65921e47469c7 (string, required) - a user's id + Response 200 (application/json) + Attributes (array) + (Application) + Response 400 (application/json) + Attributes(Error) ## Create a new token [/tokens/create] ### Resource Owner Password Credential Grant [POST] + Request (application/json) + Attributes + `grant_type`: password (string, required) - a grant type(MUST be 'password'.) + `client_id`: 59352822ecdf2b257d4c7949 (string, required) - an application's id + `client_secret`: Oxw1tH4PvQqTdRz4HSe36JeceeEb0VqWnJSiJA3kjdU= (string, required) - an application-secret + `username`: john (string, required) - a user's screenname + `password`: kanikani1192 (string, required) - a user's password + Response 200 (application/json) + Attributes + `access_token`: jwt.formatted.token (string) - an access token + `token_type`: bearer (string) - a token type(always 'bearer') + Response 400 (application/json) + Attributes(Error) + Response 401 (application/json) + Attributes(Error) ## Introspect tokens [/tokens/introspect] This is INTERNAL endpoint. ### POST [POST] + Request (application/json) + Attributes + `token`: jwt.formatted.token(string, required) - token + Response 200 (application/json) + Attributes + `active`: true (boolean, required)
update document (#27)
:star: update document (#27)
API Blueprint
mit
Tosuke/misskey-auth
f4c1723f9ecce53b60dcc0f5aa607169930a99b8
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 ### Query org passes [GET /orgs/{id}/passes] Returns all passes associated with an org. The authenticated user must be a mod of this org. + Request + Header Authorization: Bearer JWT + Response 200 (application/json) + Attributes (array[Pass]) ## 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 (application/json) + Headers Location: /users/2 + Body { "msg": "Successfully created user" } ### 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 } ] } ### Query passes [GET /me/passes] Retrieves a list of all passes relevant to the authenticated user. + Request + Header Authentication: Bearer JWT + Response 200 (application/json) + Attributes + passes (array[Pass]) - Passes relevent to the authenticated user ### Borrow a pass [POST /me/passes/borrow] Creates a request to borrows a pass on behalf of the user + Request + Header Authentication: Bearer JWT + Response 200 (application/json) + Body { "msg": "borrow request successful" } ### Lend a pass [POST /me/passes/{pass_id}/lend] + Parameters + pass_id (number) - The pass to lend + Request + Header Authentication: Bearer JWT + Response 200 (application/json) + Body { "msg": "lend request successful" } ## Pass [/passes] + 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 ### 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 (number) - The Org that the pass is to be requested from + state_id (number) - The requested day state of the pass + spot_num (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}] + 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" }
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)
Update API documentation
Update API documentation
API Blueprint
mit
lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend
689bb1f568ac437dc82d7e6a9e75f3a80840e64c
apiary.apib
apiary.apib
# 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
# 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/{slug}] + Parameters + slug (required, string) ... Project slug ### 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", "slug": "project-name", "resources": [ "resource1", "..." ] } + Response 404 (application/json) + Header Lion-Api-Version: v1
Substitute name with slug for fetching projects
Substitute name with slug for fetching projects
API Blueprint
mit
sebdah/lion
82230b5d90fd27a4ee42fca5d6e3530802cc08c8
docs/apiary.apib
docs/apiary.apib
FORMAT: 1A HOST: http://apiparticulier.sgmap.fr/ # API Particulier Récupérez en ligne les informations de vos citoyens # Group Impots ## Service de vérification de l'avis d'impôt sur le revenu [/api/impots/svair{?numeroFiscal}{?referenceAvis}] Le service permet de vérifier l'authenticité du justificatif d'impôt sur le revenu ou de l'avis d'impôt sur le revenu présenté par un usager + Parameters + numeroFiscal (string) - numeroFiscal + referenceAvis (string) - referenceAvis ### Affiche une déclaration [GET] + Request + Headers X-API-Key: <api-key> + Response 200 (application/json) { "declarant1": { "nom": "MARTIN", "nomNaissance": "MARTIN", "prenoms": "HENRI", "dateNaissance": "29/05/1984" }, "declarant2": { "nom": "", "nomNaissance": "", "prenoms": "", "dateNaissance": "" }, "dateRecouvrement": "31/07/2015", "dateEtablissement": "08/07/2015", "nombreParts": 1, "situationFamille": "Célibataire", "nombrePersonnesCharge": 0, "revenuBrutGlobal": 17580, "revenuImposable": 17580, "impotRevenuNetAvantCorrections": 1665, "montantImpot": 1665, "revenuFiscalReference": 17580, "anneeImpots": "2015", "anneeRevenus": "2014" } # Group Caf ## Attestation de la Caf [/api/caf/attestation{?codeOrganisme}{?numeroAllocataire}] Permet de récupérer les attestations de CAF + Parameters + codeOrganisme (string) - code la caisse de la caf + numeroAllocataire (string) - numéro de l'allocataire ### Affiche une déclaration [GET] + Request + Headers X-API-Key: <api-key> + Response 200 (application/pdf)
FORMAT: 1A HOST: https://apiparticulier.sgmap.fr/ # API Particulier Récupérez en ligne les informations de vos citoyens # Group Impots ## Service de vérification de l'avis d'impôt sur le revenu [/api/impots/svair{?numeroFiscal}{?referenceAvis}] Le service permet de vérifier l'authenticité du justificatif d'impôt sur le revenu ou de l'avis d'impôt sur le revenu présenté par un usager + Parameters + numeroFiscal (string) - numeroFiscal + referenceAvis (string) - referenceAvis ### Affiche une déclaration [GET] + Request + Headers X-API-Key: <api-key> + Response 200 (application/json) { "declarant1": { "nom": "MARTIN", "nomNaissance": "MARTIN", "prenoms": "HENRI", "dateNaissance": "29/05/1984" }, "declarant2": { "nom": "", "nomNaissance": "", "prenoms": "", "dateNaissance": "" }, "dateRecouvrement": "31/07/2015", "dateEtablissement": "08/07/2015", "nombreParts": 1, "situationFamille": "Célibataire", "nombrePersonnesCharge": 0, "revenuBrutGlobal": 17580, "revenuImposable": 17580, "impotRevenuNetAvantCorrections": 1665, "montantImpot": 1665, "revenuFiscalReference": 17580, "anneeImpots": "2015", "anneeRevenus": "2014" } # Group Caf ## Attestation de la Caf [/api/caf/attestation{?codeOrganisme}{?numeroAllocataire}] Permet de récupérer les attestations de CAF + Parameters + codeOrganisme (string) - code la caisse de la caf + numeroAllocataire (string) - numéro de l'allocataire ### Affiche une déclaration [GET] + Request + Headers X-API-Key: <api-key> + Response 200 (application/pdf)
use https instead of http
use https instead of http
API Blueprint
agpl-3.0
sgmap/api-particulier,sgmap/api-particulier
2580641244ff2602695973e78cbb2b9cc2ee0afd
apiary.apib
apiary.apib
FORMAT: 1A HOST: http://fortunecookieapi.herokuapp.com # Fortune Cookie API Fortune Cookie API retrieves data to create a fortune cookie - fortunes, lotto numbers, and a very brief lesson in Chinese. # Group Notes Notes related resources of the **Fortune Cookie API** ## Fortunes Collection [/fortunes] ### List all Fortunes [GET] + Response 200 (application/json) [{ "id": 1, "message": "This fortune intentionally left blank" }, { "id": 2, "message": "Tomorrow is a latter-day" }] ## Fortune [/fortunes/{id}] A single Fortune object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Fortune to perform action with. Has example value. ### Retrieve a Note [GET] + Response 200 (application/json) + Body { "id": 1, "message": "This fortune intentionally left blank" } ## Lottos Collection [/lottos] ### List all Lottos [GET] + Response 200 (application/json) [{ "id": 1, "numbers": "10 20 30 40 50 6" }, { "id": 2, "numbers": "15 24 88 9 10 78" }] ## Lotto [/lottos/{id}] A single Lotto object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Lotto to perform action with. Has example value. ### Retrieve a Lotto [GET] + Response 200 (application/json) + Body { "id": 1, "numbers": "10 20 30 40 50 6" } ## Lessons Collection [/lessons] ### List all Lessons [GET] + Response 200 (application/json) [{ "id": 1, "chinese": "因特网", "romanization": "yintewang", "english": "internet" }, { "id": 2, "chinese": "狮子狗", "romanization": "shizi gou", "english": "poodle" }] ## Lesson [/lessons/{id}] A single Lesson object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Lesson to perform action with. Has example value. ### Retrieve a Lesson [GET] + Response 200 (application/json) + Body { "id": 1, "chinese": "因特网", "romanization": "yintewang", "english": "internet" } ## Cookie [/cookie{?fortuneId,lottoId,lessonId}] ### Returns a whole cookie, which includes a fortune, lotto, and lesson [GET] + Parameters + fortuneId (string,optional) ... ID of the Fortune to build the cookie (random if not specified). + lottoId (string,optional) ... ID of the Lotto to build the cookie (random if not specified). + lessonId (string,optional) ... ID of the Lesson to build the cookie (random if not specified). + Response 200 (application/json) + Body { "fortune": { "id": 1, "message": "This fortune intentionally left blank" }, "lotto": { "id": 1, "numbers": "10 20 30 40 50 6" }, "lesson": { "id": 1, "chinese": "因特网", "romanization": "yintewang", "english": "internet" } }
FORMAT: 1A HOST: http://fortunecookieapi.herokuapp.com # Fortune Cookie API Fortune Cookie API retrieves data to create a fortune cookie - fortunes, lotto numbers, and a very brief lesson in Chinese. # Group Notes Notes related resources of the **Fortune Cookie API** ## Fortunes Collection [/fortunes] ### List all Fortunes [GET] + Response 200 (application/json) [{ "id": 1, "message": "This fortune intentionally left blank" }, { "id": 2, "message": "Tomorrow is a latter-day" }] ## Fortune [/fortunes/{id}] A single Fortune object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Fortune to perform action with. Has example value. ### Retrieve a Note [GET] + Response 200 (application/json) + Body { "id": 1, "message": "This fortune intentionally left blank" } ## Lottos Collection [/lottos] ### List all Lottos [GET] + Response 200 (application/json) [{ "id": 1, "numbers": [10,20,30,40,50,6] }, { "id": 2, "numbers": [15,24,11,9,10,55] }] ## Lotto [/lottos/{id}] A single Lotto object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Lotto to perform action with. Has example value. ### Retrieve a Lotto [GET] + Response 200 (application/json) + Body { "id": 1, "numbers": [10,20,30,40,50,6] } ## Lessons Collection [/lessons] ### List all Lessons [GET] + Response 200 (application/json) [{ "id": 1, "chinese": "因特网", "romanization": "yintewang", "english": "internet" }, { "id": 2, "chinese": "狮子狗", "romanization": "shizi gou", "english": "poodle" }] ## Lesson [/lessons/{id}] A single Lesson object with all its details + Parameters + id (required, number, `1`) ... Numeric `id` of the Lesson to perform action with. Has example value. ### Retrieve a Lesson [GET] + Response 200 (application/json) + Body { "id": 1, "chinese": "因特网", "romanization": "yintewang", "english": "internet" } ## Cookie [/cookie{?fortuneId,lottoId,lessonId}] ### Returns a whole cookie, which includes a fortune, lotto, and lesson [GET] + Parameters + fortuneId (string,optional) ... ID of the Fortune to build the cookie (random if not specified). + lottoId (string,optional) ... ID of the Lotto to build the cookie (random if not specified). + lessonId (string,optional) ... ID of the Lesson to build the cookie (random if not specified). + Response 200 (application/json) + Body { "fortune": { "id": 1, "message": "This fortune intentionally left blank" }, "lotto": { "id": 1, "numbers": [10,20,30,40,50,6] }, "lesson": { "id": 1, "chinese": "因特网", "romanization": "yintewang", "english": "internet" } }
Update Blueprint: Lotto numbers as array of integers
Update Blueprint: Lotto numbers as array of integers
API Blueprint
mit
larryprice/fortune-cookie-api,larryprice/fortune-cookie-api
033e7c1da1956d3e958f2b9ba1fd0e2116d6fa29
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.
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 ```
Add Consumer Identification
Add Consumer Identification
API Blueprint
mit
jsynowiec/api-blueprint-boilerplate,jsynowiec/api-blueprint-boilerplate