Skip to content

Instantly share code, notes, and snippets.

@palexander
Created September 8, 2012 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palexander/3671163 to your computer and use it in GitHub Desktop.
Save palexander/3671163 to your computer and use it in GitHub Desktop.
BioPortal Prototype JSONP Proxy

Accessing BioPortal REST API from the browser with JSONP

This is a prototype service. As such, NCBO will not be providing support for its usage.

Signature

Parameters

The endpoint takes a few parameters (* required):

    • path={REST service endpoint path} - this should not include the /bioportal portion and should be url-encoded
    • apikey={your api key}
  • userapikey={your user's api key}
  • callback={function name} - whatever name your callback function should have
  • variable={variable name} - if you want to use a variable, include the name here

The proxy does not handle status codes appropriately. It will always return a 200, even if the REST API responded with a 404 or 500, and in these cases it will embed the status in the JSON with the key 'status'. The body of the response will also be included, in a second key called 'body'. Successful responses will only contain the full body of the response without the 'status' or 'body' keys.

Limitations: only works with GET requests

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