Innovation API Help

This document details the use of the iBridgeSM Network API to programmatically manage innovations, products, and related materials for your institution. The API allows you to create, read, update, and delete these records in the iBridge Network database without using a browser to interact with the site.

The topics covered in this help are:

  1. The Protocol
  2. Supported Actions
  3. Request and Response Formats
  4. Getting Help

The Protocol

The iBridgeSM Network API is an HTTP based protocol, so you can interact with it using normal Web requests. Sending requests to the API is identical to filling out a form on a Web page and submitting it to the server. All requests should be sent as HTTP POSTs.

Any programming language in popular use today should have a library available for building and sending these requests. You can even deliver them using command-line utilities like curl or wget.

Sending Requests

I’ll use curl to show a sample request to the iBridge Network API. In this request I will ask the Web site to show me the current database record for a fictional innovation in a fictional institution:

$ curl -F api_token=873e42ea226fb
       -F records=@-
       http://www.ibridgenetwork.org/api/read
       <<< '<innovation file_number="123" />'

To break that down, the -F switches are setting the form parameters the API expects. The first one is an API Token required by all API requests to the Web site. To locate that token for your institution, log into the iBridge Network application as an administrator for the institution and visit the “Edit INSTITUTION_NAME Profile” form in the administration actions. This page will display the API Token that you will need when interacting with the API.

The second parameter allows me to specify a file containing my XML request. All requests that need input expect this records parameter containing valid XML content which will be described in Request and Response Formats. My needs were simple in this case, so I just used STDIN and inlined the XML at the end of the command using my shell’s herestring syntax. If you had the data in a file called “request.xml” instead, you would change the second switch to “-F records=@request.xml”. This sends the records parameter as a file upload allowing the server to handle large requests, which will be important for actions like Sync that need a lot of data.

Finally, take note of the URL used in this request. The protocol, domain, and literal “api” reference will be the same for all requests. Only the last bit changes, to reflect the desired action for this request.

Note that you can add the -i command-line switch to curl calls if you want to see the status code and headers returned by the API.

For comparison, here are similar examples in some popular scripting languages. First we have Ruby:

#!/usr/bin/env ruby -wKU

require "net/http"
require "uri"

response = Net::HTTP.post_form( URI.parse("http://ibridgenetwork.org/api/read"),
                                :api_token => "873e42ea226fb",
                                :records   => DATA.read )
case response
when Net::HTTPSuccess
  puts response.body
else
  puts "Server Error:  #{response['Error-Message']}"
end

__END__
<innovation file_number="123" />

Here's a Perl version:

#!/usr/bin/env perl

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Request::Common "POST";

my $ua  = LWP::UserAgent->new;
my $req = POST "http://ibridgenetwork.org/api/read",
               [api_token => "873e42ea226fb", records => <DATA>];

my $res = $ua->request($req);
if ($res->is_success()) {
  print $res->content;
} else {
  print "Server error:  ", $res->header("Error-Message"), "\n";
}

__END__
<innovation file_number="123" />

Finally, we have a PHP example. This code requires libcurl:

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_POST,           TRUE); // inform curl to use POST
curl_setopt($ch, CURLOPT_HEADER,         TRUE); // prefix xml with Status etc.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // return string, not html page

curl_setopt($ch, CURLOPT_URL, "http://www.ibridgenetwork.org/api/read");

// iBridge "records" input can be either file or string, but syntax differs
$curl_record = '<innovation file_number="123" />';
if (isset($curl_record)) {
    curl_setopt($ch, CURLOPT_POSTFIELDS,
                array("api_token"=>"873e42ea226fb", "records"=>$curl_record));
} else {
    curl_setopt($ch, CURLOPT_POSTFIELDS,
                array("api_token"=>"873e42ea226fb", "records"=>"@curl_record.xml"));
}

$curl_response  = curl_exec($ch);
$statusOK       = strpos($curl_response, "Status: 200 OK");
if($statusOK === false) {
    echo "*** Status is not '200 OK' in CURL operation -- exit now\n\n";
    exit;
}

echo "$curl_response\n\n";

curl_close($ch);

?>

Supported Actions

The following is a list of actions supported by the iBridgeSM Network API. Actions detail expected input and possible outputs.

The provided actions target innovations, products, related materials in the iBridge Network database. The term records in this document, refers to these entities.

All action except Dump and List require a valid XML document specifying the details for the action as described in the Request and Response Formats section. XML should be passed in a parameter called records.

You can add an invite_users parameter set to “True” to generate invites for users that don't exist on the iBridge Network. User emails must be valid or an error will be returned. Invited users will be sent an email message when their innovations are published. The email message contains a list of all published innovations they are associated with.

Create (http://www.ibridgenetwork.org/api/create)

Builds a new database record, with the provided fields populated.

On success the response contains the following information:

Response code:
201
Headers:
A Location header will contain the URL for the resource on the iBridge Web site
Body:
None

Read (http://www.ibridgenetwork.org/api/read)

This action serializes a record in the iBridge Network database to XML, returning that record as the response.

By default, files attached to products and related materials are not included. However, your request can contain an include_downloads flag set to the value of “True” to override this restriction.

On success the response contains the following information:

Response code:
200
Headers:
A Location header will contain the URL for the resource on the iBridge Web site
Body:
Read response in XML

Update (http://www.ibridgenetwork.org/api/update)

Updates an existing record in the iBridge Network database matched by the key field(s). Any fields not provided in the body of the XML request will not be changed.

On success the response contains the following information:

Response code:
204
Headers:
A Location header will contain the URL for the resource on the iBridge Web site
Body:
None

Delete (http://www.ibridgenetwork.org/api/delete)

Deletes an existing record in the iBridge Network database matched by the key field(s). Note: Deleting innovations will cause associated orders, info requests and metrics to become orphaned even if an innovation is added back via the api.

On success the response contains the following information:

Response code:
204
Headers:
None
Body:
None

Sync (http://www.ibridgenetwork.org/api/sync)

This composite action allows users to create, update, and delete records with just one command. The request records should represent a complete list of records for your institution. Actions will then be taken based on the key field(s) of each record:

  1. All records with unrecognized key fields are created
  2. All records with recognized key fields have any fields provided in the request updated
  3. All other records for your institution will have their status changed to “Unpublished”

You can add a delete_untouched parameter set to “True” to have non-included records deleted instead of unpublished. Be warned that this action, and especially this flag, are dangerous options that can drastically modify the majority of your institution’s data on the iBridge Web site.

On success the response contains the following information:

Response code:
200
Headers:
None
Body:
Sync response in XML

Dump (http://www.ibridgenetwork.org/api/dump)

This action is the opposite of Sync. It will return an XML serialization of all innovations, products, and related materials for your organization in the iBridge Network database. It’s a good idea to use this action to pull a backup of your content before playing with other actions in the iBridge Network API.

The Dump response does not include files attached to products and related materials and this cannot be overridden for bandwidth reasons.

On success the response contains the following information:

Response code:
200
Headers:
None
Body:
Dump response in XML

List (http://www.ibridgenetwork.org/api/list)

The List action functions the same as the Dump action save that only innovations are returned and for those innovations only the title and status fields are provided. This action is intended to give a quick overview of your institution’s data in the iBridge Network database.

On success the response contains the following information:

Response code:
200
Headers:
None
Body:
List response in XML

Request and Reponse Formats

Most of the API actions expect an XML message in the records parameter. The formats of those messages build on the basic structures for innovations, products, and related materials.

The Create and Update actions simply require one of these records as the root of you XML document. Read will also respond using this format. The other actions expand on that format a bit and will be detailed separately.

Key Fields

Most of these actions actions require unique identifiers to refer to records. We wanted to avoid forcing users to track iBridgeSM Network specific identifiers for this, so we based the identifiers on key fields of data provided to us by the users.

By type, these fields are:

Innovation:
file_number
Product:
innovation_file_number and title
Related material:
innovation_file_number and title

Innovation

The following is the basic XML format for innovations passed to the iBridge Network API:

<innovation file_number="STRING" REQUIRED>
  <title REQUIRED>STRING</title>
  <short_url_name>STRING</short_url_name>
  <brief_description REQUIRED>TEXT</brief_description>
  <status>Unpublished | Published | Coming Soon</status>
  <featured>BOOLEAN</featured>
  
  <copyright>TEXT</copyright>
  <trademark>BOOLEAN</trademark>
  <third_party_rights>Unlimited</third_party_rights>

  <website_url>STRING</website_url>
  <innovation_type>INNOVATION_TYPE_NAME</innovation_type>
  <disease>DISEASE_NAME</disease>
  <full_description>TEXT</full_description>
  <suggested_uses>TEXT</suggested_uses>
  <advantages>TEXT</advantages>
  <limitations>TEXT</limitations>
  <state_of_development>TEXT</state_of_development>
  <testing>TEXT</testing>
  <other_information>TEXT</other_information>

  <categories>
    <category ONE CATEGORY IS REQUIRED>CATEGORY_NAME</category>
    …
  </categories>
  
  <tags>TAG_NAME, TAG_NAME, …</tags>
  
  <patents>
    <patent>PATENT_NUMBER</patent>
    …
  </patents>
  
  <case_manager first_name="STRING" last_name="STRING">USER_EMAIL</case_manager>
  <lead_innovator first_name="STRING" last_name="STRING">USER_EMAIL</lead_innovator>
  <innovators>
    <innovator first_name="STRING" last_name="STRING">USER_EMAIL</innovator>
    …
  </innovators>
  <contact_innovators>BOOLEAN</contact_innovators>
</innovation>

Note that due to the way relationships work, the categories and innovators tags must specify all categories and innovators, even those previously set.

Product

Products can be nested inside of innovations as such:

<innovation file_number="STRING">
  …
  <products>
    <product title="STRING">…</product>
    …
  </products>
</innovation>

Nested products do not need the innovation_file_number attribute.

The complete product format is as follows:

<product innovation_file_number="STRING"
         title="STRING">
  <product_type>
    Research Paper | Software | Animal Model | Cell Line |
    Biological
  </product_type>
  <brief_description>TEXT</brief_description>
  <full_description>TEXT</full_description>
  <price>FLOAT</price>
  <quantity>INTEGER</quantity>
  <status>Draft | Published</status>

  <file name="STRING">FILE</file>

  <license_name>LICENSE_NAME</license_name>

  <downloadable>BOOLEAN</downloadable>
  <payment_credit_card>BOOLEAN</payment_credit_card>
  <payment_check>BOOLEAN</payment_check>
  <approval_required>BOOLEAN</approval_required>

  <shipping_required>BOOLEAN</shipping_required>
  <shipping_cost>FLOAT</shipping_cost>
  <shipping_instructions>TEXT</shipping_instructions>
</product>

Related Materials

Related materials can be nested inside of innovations as such:

<innovation file_number="STRING">
  …
  <related_materials>
    <related_material title="STRING">…</related_material>
    …
  </related_materials>
</innovation>

Nested materials do not need the innovation_file_number attribute.

The complete related material format is as follows:

<related_material innovation_file_number="STRING"
                  title="STRING">
  <status>Draft | Published</status>
  <description>TEXT</description>

  <url>STRING</url>
  <file name="STRING">FILE</file>
</related_material>

Read and Delete

Read and Delete just require the key field(s) for the referenced record. The formats are:

<innovation file_number="STRING" />

or:

<product innovation_file_number="STRING"
         title="STRING" />

or:

<related_material innovation_file_number="STRING"
                  title="STRING" />

Sync, Dump, and List

The Sync action is simply passed a collection of innovations. Remember that each of those innovations may nest products and related materials as needed.

<innovations>
  <innovation file_number="STRING">
    …
    <products>
      <product title="STRING">
        …
      </product>
      …
    </products>
    <related_materials>
      <related_material title="STRING">
        …
      </related_material>
      …
    </related_materials>
  </innovation>
  …
</innovations>

The Dump and List action formats also look like this to support easy round-tripping of data.

A Sync response is a hierarchical breakdown of how your data was handled by the system:

<innovations>
  <innovation file_number="STRING">
    <result>
      Created | Updated | Deleted | Unpublished | Error
    </result>
    <error_message>STRING</error_message>
    <products>
      <product title="STRING">
        <result>
          Created | Updated | Deleted | Unpublished | Error
        </result>
        <error_message>STRING</error_message>
      </product>
      …
    </products>
    <related_materials>
      <related_material title="STRING">
        <result>
          Created | Updated | Deleted | Unpublished | Error
        </result>
        <error_message>STRING</error_message>
      </related_material>
      …
    </related_materials>
  </innovation>
  …
</innovations>

Data Types

The data types used in the XML formats are as follows:

STRING:
A string of text up to 256 characters in length
TEXT:
Like STRING, but supports up to 65,000 characters
One | Two | …:
This notation indicates alternate acceptable STRINGs
BOOLEAN:
True or False
CATEGORY_NAME:
The name of a category on the iBridge Web site

Possible categories:
  • Agriculture
  • Animal/Veterinary
  • Bioinformatics
  • Biology
  • Biomedical
  • Biotechnology
  • Chemicals
  • Communication
  • Computer Hardware
  • Computer Software
  • Dental
  • Devices
  • Diagnostic
  • Drug Delivery
  • Drug Discovery
  • Drug Screening
  • Electrical
  • Energy
  • Engineering
  • Environment
  • Gene Therapy
  • Genomics/Genetics
  • Imaging
  • Materials
  • Medical
  • Nanotechnology
  • Optics
  • Process/Procedure
  • Proteomics
  • Security
  • Therapeutic
  • Transportation
PATENT_LIST:
A semicolon-separated list of 7-digit patent numbers
PATENT_NUMBER:
A 7-digit USPTO patent number or USPTO published application or a 10-digit WIPO published application number prefixed with 'WO'
USER_EMAIL:
An email address matching a registered iBridge Network user
LICENSE_NAME:
The name of a license your organization has on iBridge
INNOVATION_TYPE_NAME:
The innovation type the innovation is associated with on the iBridge Web site

Possible innovation types:
  • Business Plan
  • Material
  • Merwyn Business Simulation Reports
  • Research Tool
  • Technology
DISEASE_NAME:
The disease name the innovation is associated with on the iBridge Web site

Possible diseases:
  • Autoimmune and Inflammation
  • Blood and Lymphatic System
  • Cancer
  • Cardiovascular and Circulatory System
  • Central Nervous System
  • Dental
  • Dermatology
  • Digestive System
  • Genetic Diseases and Dysmorphic Syndromes
  • Infectious Diseases
  • Kidneys and Genito-Urinary System
  • Metabolic/Endocrinology
  • Musculoskeletal Disorders
  • Ophthalmology and Optometry
  • Respiratory and Pulmonary System
  • Substance Abuse
  • Women's Health
FILE:
The Base64 encoded contents of a file

Error Responses

When something goes wrong with a request, the iBridge Web site will return one of the following response codes to indicate failure. These are normal HTTP status codes and your library should give some means to check them. An ErrorMessage header will also be set with a human readable response, for all errors save 500.

400:
Request was malformed. This typically involves missing parameters or invalid XML.
401:
The api_token parameter was missing or incorrect.
403:
Your request tried to make invalid changes to the iBridge Network database. You probably failed to provide some required fields for a record.
404:
Could not locate the referenced records. You either forgot to set their key fields or the key fields are incorrect.
500:
Server error. Retry your request later.

All other responses will have codes in the 200s to indicate success.

Notes

Updated and created innovations will appear in search results approximately 24 hours after syncing, updating, or creating innovations.

Getting Help

If you need assistance interacting with the iBridge Network API, feel free to contact us at support@iBridgeNetwork.org.



Creative Commons License iBridge Network API documentation by Innovation Accelerator Foundation is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.