phenoscape / KB-DataFest-2017

Promoting Phenoscape KB Data Access and Interoperability Codefest, 2017
3 stars 2 forks source link

tutorial on phenoscape API's #19

Open snacktavish opened 6 years ago

snacktavish commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@balhoff some thoughts/questions

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 commented 6 years ago

I am interested to learn what/how Phenoscape does.

Also I am interested to explore web tools that

-- Zhiliang

balhoff commented 6 years ago

@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 commented 6 years ago

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 :/