ORCID – a taster of the API

Posted on September 13, 2011


As the official draft API (googledoc) is both in flux and read-protected so that only those invited can see it, I am unable to give you a complete view of how things are shaping up.

However, I can relay a number of key points that everyone involved is concerned about:

  • It must have sensible (some may say RESTful) URLs
  • Human and machine-readable data is a must via
    • Content-negotiation,
    • and optionally, “suffix” negotiation (adding a “.xml” or “/xml”) for convenience.
  • OAuth is the current plan to share trust, allowing users the greatest control over what and who has access to their live profile data.
  • Profile creation/editing “By Proxy” is important, but shouldn’t take any control of the researcher’s basic profile information from the researcher themselves.

Some code!

Gudmundur A. Thorisson (University of Leicester and a member of the ORCID Technical Advisory Group) has put together an emulation of certain portions of the ORCID API, including some of the OAuth parts:


Get the code from github and making sure you already have Rails/Ruby installed:

$ cd orcid-sandbox
$ bundle install
$ bundle exec rake db:migrate
$ bundle exec rake db:setup
$ rails server -p 3001 -d

(you may need “$ scripts/rails server -p 3001 -d)

Once you have the code up and running, you should be able to log in, make accounts and so on.

# OAuth-protected access to profile
[mummi@cambozola-2]curl  http://localhost:3001/profile -H "Accept: text/xml"  -I 
HTTP/1.1 401 Unauthorized 
X-Ua-Compatible: IE=Edge
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Date: Thu, 08 Sep 2011 12:20:50 GMT
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-06-12)
X-Runtime: 0.087887
Content-Length: 0
Cache-Control: no-cache
# Public access to profile
[mummi@cambozola-2]curl  http://localhost:3001/cid/0723-1814-6587-5983 -H "Accept: text/xml" -I 
HTTP/1.1 200 OK 
X-Ua-Compatible: IE=Edge
Etag: "390c3560fce0064d65dd1373799f13d0"
Connection: Keep-Alive
Content-Type: application/xml; charset=utf-8
Date: Thu, 08 Sep 2011 12:20:49 GMT
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-06-12)
X-Runtime: 0.035443
Content-Length: 0
Cache-Control: max-age=0, private, must-revalidate

# Sample response (from Mike's XML examples)
[mummi@cambozola-2]curl  http://localhost:3001/cid/0723-1814-6587-5983 -H "Accept: text/xml" 
<?xml version="1.0" encoding="UTF-8"?>
<orcid-bio-response xsi:schemaLocation="http://www.orcid.org/ns/orcid_bio_response_1.0.xsd"
        <submission-date>09-10-2012 15:50:01</submission-date>
        <completion-date>09-10-2012 15:50:07</completion-date>
        <!-- error message, if applicable -->
        <!-- unable to connect to ORCID, no matching researchers etc -->
        <error-desc>No researcher found for this institution.</error-desc>
            <!--  ORCID elements will be present for every researcher found -->
            <!-- In short, researcher has claimed the profile if confirmed=true-->
                <other-name>J. Carberry</other-name>
                <other-name>J. S. Carberry</other-name>
                <name>Brown University</name>
                        <addressLine1>38 Brown Street / Box 1920</addressLine1> 
                        <state-or-province>Rhode Island</state-or-province>
                        <country>United States</country>
                <departmentName>High Energy Metaphysics</departmentName>
                <role>Researcher (Academic)</role>
            <bulk-institution>Brown University</bulk-institution>
            <sponsor>Brown University Library</sponsor>
                <name> Wesleyan University</name>
                        <addressLine1>Wesleyan University</addressLine1>
                        <country>United States</country>
                <role>Researcher (Academic)</role>
About these ads
Posted in: ORCID