Repropedia

A Reproductive Lexicon

NOTICE:

Ownership of this website has been transferred from Northwestern University to Michigan State University.
Please note that some site information may be inaccurate while adjustments to reflect this organizational change are made.

MOOC Advertisement

Learn More:
Get An Introduction to Reproduction

Learn more about the science of reproduction. Dr. Teresa Woodruff, creator of Repropedia, is offering a free online course exploring the world of reproduction.

Get Started!

API Documentation

The Repropedia API is a RESTful web service that expresses all the terms and definitions created in the Repropedia Website. The content is curated by a team of specialists around the globe, to define and provide appropriate meaning to many new research terms being created.


Repropedia API - Consumer Key

All requests should include a URL param with name of "oauth_consumer_key" and your consumer key.

Sample

https://www.repropedia.org/api/1.0/term.json?oauth_consumer_key=MYKEY

Repropedia API - Content Schema

Term - Resource Properties

Property Type Description
nid Integer Drupal's internal Node ID for the term
title TEXT Human Readable String
field_term_synonym URL Link to a synonymous Repropedia Term
body HTML Description of the term
field_termimage URL Link to image (if applicable)
field_termvideo URL Link to video (if applicable)
field_term_aka URL Array(TEXT) | List of synonymous terms
field_term_otherresources LINK Link to associated resources (if applicable)
path URL Mapped Url to this resource

Request Details

When making a request, please use these request and response formats.

Accepted Request Formats
application/json
application/x-www-form-urlencoded

.

Response Formats
json
jsonp

Usage:

// Prepare Request Data - fetching a definition for term[nid:119]
var node_uri = '/api/1.0/term/119';
var format = 'jsonp';
var uri = node_uri + '.' + format;

jQuery.ajax({
  'type' : "GET",
  'dataType' : 'jsonp',
  'contentType' : 'application/json',
  'url' : uri,
  'success' : function() { // success handler },
  'error' : function() { // error handler },
});

Endpoint

/api/1.0/

HTTP Methods Available

The WebService endpoint accepts HTTP GET requests.


Syntax

Query parameters are passed via the request URL with the following syntax:

/api/1.0?PARAM1=VALUE_A&PARAM2=VALUE_B

The available parameters are:

Parameter Type Description
pagesize integer Number of results for the response. Currently the API recognizes about 350 terms in the API. Setting this value to a higher value (1000) will ensure that terms are returned.
fields string List of fields separated by comma. ie: fields=title,nid

Output Formats

The webservice responds to 'JSON' requests only'. Add '.json' to the request url before the '?' preceding the parameters.


JSONP

The Web Service endpoint offers cross domain browser support with JSONP. See http://en.wikipedia.org/wiki/JSONP

jQuery Example

$.ajax({
  url : "/api/1.0",
  dataType : 'jsonp',
  data : {
    fields : "title, nid",
    pagesize : 1000    
  }
  error : function(jqXHR, textStatus, errorThrown) { // (…) },
  success : function(data, textStatus, jqXHR) { // (…) }
});

Listing All Terms and their URIs

Example:

// JSON
/api/1.0/term.json?fields=title,nid&pagesize=1000

By Default the result will return the URI for each term.

Live Results JSON


Term Definition:

Definitions for terms can be retrieved using their respective URIs. Keeping track of a list of terms and their URIs, then it is possible to do remote definition lookup:

JSON Output

/api/1.0/node/NID.json

Live Results JSON


RESTful WebServices Intro