Difference between revisions of "OJ Break API Access"

From xBio:D Wiki
Jump to navigation Jump to search
(Created page with "'''Introduction''' OJ_Break is the name of the xBio:D RESTful(-like) API service to facilitate discovery of data within the xBio:D database. The API responds exclusively in J...")
 
(Overview)
Line 5: Line 5:
  
 
== Overview ==
 
== Overview ==
All API requests must be formatted by first selecting the OJ_Break library then specifying the API method. Also, each method must include a callback argument even if a callback function is unnecessary (e.g. jQuery AJAX requests).
+
All API requests must be formatted by first selecting the OJ_Break library then specifying the API method. Also, each method must include a format and key argument.
  
 
The format for API calls is: '''''<nowiki>http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.[method]?[argument1]=[value1]&...</nowiki>'''''
 
The format for API calls is: '''''<nowiki>http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.[method]?[argument1]=[value1]&...</nowiki>'''''
* Example: '''''<nowiki>http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.getTaxonInfo?tnuid=5012&callback=test</nowiki>'''''
+
* Example: '''''<nowiki>http://osuc.biosci.ohio-state.edu/OJ_Break/getTaxonHierarchy?tnuid=30148&format=json&key=FBF5D62445E57BDDE0430100007FC3A0</nowiki>'''''
* Response: '''''test({"taxon":"Oxyscelio consobrinus","author":"(Kieffer)","status":"Subsequent name/combination","rank":"Species","valid":"Valid","fossil":"N","rel_type":"Member",...'''''
+
 
 +
The response for an API call will include a success or error code, an associated response message, and the included data returned by the method call.
 +
* Response: '''''{"code"100:,"message":"API resource successfully retrieved","data":{"taxon":"Heptascelio striatosternus","author":"Narendran & Ramesh Babu","hier":{"Kingdom":...'''''

Revision as of 15:49, 16 June 2014

Introduction

OJ_Break is the name of the xBio:D RESTful(-like) API service to facilitate discovery of data within the xBio:D database. The API responds exclusively in JavaScript Object Notation (JSON) and accepts only HTTP GET and POST requests indiscriminately unlike a true REST API. Built using Oracle's PL/SQL database language, the API is fast but often inflexible and inconsistent, so take note of all of the comments below.


Overview

All API requests must be formatted by first selecting the OJ_Break library then specifying the API method. Also, each method must include a format and key argument.

The format for API calls is: http://osuc.biosci.ohio-state.edu/hymDB/OJ_Break.[method]?[argument1]=[value1]&...

  • Example: http://osuc.biosci.ohio-state.edu/OJ_Break/getTaxonHierarchy?tnuid=30148&format=json&key=FBF5D62445E57BDDE0430100007FC3A0

The response for an API call will include a success or error code, an associated response message, and the included data returned by the method call.

  • Response: {"code"100:,"message":"API resource successfully retrieved","data":{"taxon":"Heptascelio striatosternus","author":"Narendran & Ramesh Babu","hier":{"Kingdom":...