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

tutorial on phenoscape API's #19

Open
snacktavish opened this issue Dec 6, 2017 · 5 comments
Open

tutorial on phenoscape API's #19

snacktavish opened this issue Dec 6, 2017 · 5 comments

Comments

@snacktavish
Copy link

@blubbundbla and I have been working through https://phenoscapekb.docs.apiary.io, but we have some questions! a tutorial on the phenoscape API's would be great.

@balhoff
Copy link
Member

balhoff commented Dec 6, 2017

Oh no! I forgot to update the link on the front page to http://kb.phenoscape.org/apidocs/

It is more complete. You will probably still have many questions.

@sckott
Copy link
Member

sckott commented Dec 6, 2017

@balhoff some thoughts/questions

  • would it be possible to give back application/json when returning an error instead of text/plain?
  • I'm not super familiar with Phenoscape yet - wondering if it'd be possible to give eg values for parameters in the swagger docs, so one can quickly get a sense for response structure
  • pagination: do we assume that all results are returned on any request? i don't see any info on pagination, so i assume that's the case (UPDATE: now i see pagination for some routes, e.g, /study/phenotypes)
  • looks like only GET requests allowed. seems like other methods aren't rejected though, maybe that's by design?: e.g.,
curl -v -XPOST http://kb.phenoscape.org/api/term/search?text=femur
*   Trying 152.3.104.142...
* TCP_NODELAY set
* Connected to kb.phenoscape.org (152.3.104.142) port 80 (#0)
> POST /api/term/search?text=femur HTTP/1.1
> Host: kb.phenoscape.org
> User-Agent: curl/7.54.0
> Accept: */*

< HTTP/1.1 200 OK
... 

@zhilianghu
Copy link

zhilianghu commented Dec 7, 2017 via email

@balhoff
Copy link
Member

balhoff commented Dec 7, 2017

@sckott

would it be possible to give back application/json when returning an error instead of text/plain?

Probably so! This isn't something I've spent much time on so right now it's just a default result.

I'm not super familiar with Phenoscape yet - wondering if it'd be possible to give eg values for parameters in the swagger docs, so one can quickly get a sense for response structure

Definitely—I think there are a few but it can be expanded.

pagination: do we assume that all results are returned on any request? i don't see any info on pagination, so i assume that's the case (UPDATE: now i see pagination for some routes, e.g, /study/phenotypes)

Yep, many of the services have limit and offset parameters. Maybe it would be more intuitive to collapse that to page. But if you set limit to 0 you will generally get all the results.

looks like only GET requests allowed. seems like other methods aren't rejected though, maybe that's by design?: e.g.,

Most are intended to be used with GET, but as you say other methods aren't rejected. Perhaps that should be tightened up.

@sckott
Copy link
Member

sckott commented Dec 7, 2017

Thanks @balhoff - just some things that came to mind off the top. I'll stop here as I don't want to derail @snacktavish issue :/

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

4 participants