Search Mailing List Archives
[bioontology-support] issues retrieving class labels with REST API
Jennifer Leigh Vendetti
vendetti at stanford.edu
Mon Mar 7 17:52:42 PST 2016
Great! Glad it’s working for you now!
On Mar 7, 2016, at 5:33 PM, Maxwell Neal <maxneal at gmail.com<mailto:maxneal at gmail.com>> wrote:
When I went back and tried to execute the Java sample code, it worked. And it turns out I wasn't using the correct, Bioportal-specific namespaces in my application. So after fixing that, things are working. Looks like it was an issue on my end. Sorry for the inconvenience!
On Fri, Mar 4, 2016 at 6:27 PM, Jennifer Leigh Vendetti <vendetti at stanford.edu<mailto:vendetti at stanford.edu>> wrote:
I tried out your API key. It works for me in all scenarios - Java sample code, web browser, and curl. How are you executing the Java program? Have you made any other edits to the Java file besides assigning a value to the API_KEY variable?
On Mar 4, 2016, at 12:11 PM, Maxwell Neal <maxneal at gmail.com<mailto:maxneal at gmail.com>> wrote:
Many thanks for the reply. That curl command does actually work for me. Here's the command I used:
curl -X GET 'http://data.bioontology.org/ontologies/BRO?apikey=c4192e4b-88a8-4002-ad08-b4636c88df1a'
But I still get the 401 error when I try the GetLabels example. Does the example succeed if you use my API key on your end?
On Fri, Mar 4, 2016 at 2:13 PM, Jennifer Leigh Vendetti <vendetti at stanford.edu<mailto:vendetti at stanford.edu>> wrote:
I was able to execute the sample code to retrieve labels with my API key successfully. HTTP 401 errors indicate unauthorized access, so I’m wondering if the API key you put in GetLabels.java is correct. Are you able to issue a simple curl command at the command line to retrieve ontology data, e.g.:
curl -X GET 'http://data.bioontology.org/ontologies/BRO?apikey=your_api_key_here'
Does this succeed for you?
On Mar 3, 2016, at 10:10 AM, Maxwell Neal <maxneal at gmail.com<mailto:maxneal at gmail.com>> wrote:
When I attempt to retrieve class labels programmatically using the "GetLabels" example<https://github.com/ncbo/ncbo_rest_sample_code/blob/master/java/src/GetLabels.java> on the BioPortal API GitHub site, I get an HTTP 401 error and the labels aren't retrieved.
I've edited the example code so it uses my own application apikey, and I get the 401 error whether I run the original or edited code.
Any help is appreciated. Thanks!
bioontology-support mailing list
bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bioontology-support