Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to Update REST API #344

Closed
someoneAnyone opened this issue Jan 14, 2015 · 11 comments
Closed

Proposal to Update REST API #344

someoneAnyone opened this issue Jan 14, 2015 · 11 comments

Comments

@someoneAnyone
Copy link
Contributor

someoneAnyone commented Jan 14, 2015

Per the conversation in gitter.im:

There are multiple clients (watches too) working their way through development that leverage nightscout data. It would be great if more of the data was available via rest APIs so things can be consistently and generically handled.

Can the APIs be modified so that items like bg-delta, or prediction entries are available?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7767134-proposal-to-update-rest-api?utm_campaign=plugin&utm_content=tracker%2F2451736&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2451736&utm_medium=issues&utm_source=github).
@someoneAnyone
Copy link
Contributor Author

Just adding some interesting tools/documentation i've encountered that might be useful for this feature/project. Has the teem considered using something like: http://loopback.io for documenting and exposing the APIs? might help in testing too.

@jimsiff
Copy link
Contributor

jimsiff commented Jan 22, 2015

It would also be nice to expose any mbgs, filtered, unfiltered, noise, and rssi data at some point.

@jasoncalabrese
Copy link
Member

all that is getting filtered by the sgvdata module, I think we're going to pull it out. Right now the api only supports the count param, really need some pagination, maybe query by date

@someoneAnyone
Copy link
Contributor Author

Here are some nice tips for REST design. http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#requirements

@bewest
Copy link
Member

bewest commented Mar 18, 2015

@jimsiff expressed some interest in helping document the API. If possible, there's a tool called swagger that might help a lot.

I modified the example uber api swagger spec to come up with this one: https://gist.github.com/bewest/5fb2910aa09a94052712

You can drag it/import it into swagger's demo API and it generates very nice documentation, complete with the objects to expect in the responses: http://editor.swagger.io/#/

image

@bewest
Copy link
Member

bewest commented Mar 18, 2015

Swagger has some nifty tools, one of them can help visualize the api and resources as an interactive graphic:
image

@jimsiff jimsiff self-assigned this Mar 18, 2015
@someoneAnyone
Copy link
Contributor Author

It can also generate client code which is nice.

@bewest - I like the PriceEstimate model ;-)

@bewest
Copy link
Member

bewest commented Mar 19, 2015

@someoneAnyone hehe, patches welcome, hehehe.

Turns out the REST API is already capable of some fairly advanced searching and filtering, if you know the right syntax: #504 I'll be working on extending it with feedback from community.

I updated that gist with a slightly more complete data model, HTH.

@bewest
Copy link
Member

bewest commented Mar 23, 2015

@jimsiff I created this repo https://github.com/bewest/ns-types where I've combined a lot of notes taken over the last year.

I'd like to use this to create website devoted to just discussing the data model, and have it available as a module for NS. My hope is this will replace sgvdata by including definitions for all the data types. Since it's got all the data-types, it might be a good place to document the "design" of the API as well, or perhaps it better in the wiki in this repo? Thoughts/feedback?

@bewest
Copy link
Member

bewest commented Mar 23, 2015

When I've worked up an implementation of the data-model with module/website, I'll move it into NS github if turns out to be workable/desirable code.

@jimsiff
Copy link
Contributor

jimsiff commented Mar 23, 2015

👍 Sounds like a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants