Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning
titleDRAFT * DRAFT * DRAFT

This documentation is a work in progress and should not be use for production applications.

 

Section
Column
width20%
Panel
borderColor#BF9900
bgColor#FFFFFF
titleBGColor#E5D699
titleIn this Section
borderStylesolid
Table of Contents
indent15px
stylenone
Column
Wiki Markup

Overview

These APIs provide a bulk load API for data that is published from the Online Directory system. If you need assistance with this APIs, please email


h2. Overview

These APIs provide a bulk load API for data that is published from the Online Directory system. If you need assistance with this APIs, please email [mailto:middleware-api@ucdavis.edu
.

Audience

Excerpt

This documentation is intended for developers who wish to perform a bulk download of the public data within the Online Directory system from within their application via the REST with JSON interface.

This is currently the only interface available for this API. If you would like to see an XML interface please email middleware-api@ucdavis.edu.

Application requirements

Each request must provide a valid application key. You may sign up for your own application key here <INSERT LINK>.

During periods of peak usage, API requests may be throttled. 

Using the JSON interface

The easiest way to start learning about this interface is to try it out. This section shows how to use the curl command line tool to execute sample queries.

Code Block
titleSample JSON Request
].


h2. Audience

{excerpt}This documentation is intended for developers who wish to perform a bulk download of the public data within the Online Directory system from within their application via the REST with JSON interface.
{excerpt}

This is currently the only interface available for this API. If you would like to see an XML interface please email [mailto:middleware-api@ucdavis.edu].


h2. Application requirements

Each request must provide a valid application key. You may sign up for your own application key here <INSERT LINK>.

During periods of peak usage, API requests may be throttled.&nbsp;

h2. Using the JSON interface

The easiest way to start learning about this interface is to try it out. This section shows how to use the&nbsp;curl&nbsp;command line tool to execute sample queries.
{code:title=Sample JSON Request}curl -i -H "Accept: application/json" https://iet-ws-test/directory/load?key=JPO3Dkljsd3Skjkdxxo3SJK00&v=1.0{code}This command performs a bulk load request ({color:#339966}/directory/load{color}). The response
has a Content-Type of text/javascript.
Code Block
langxml
titleSample JSON Response
 has a&nbsp;{color:#339966}Content-Type&nbsp;of&nbsp;text/javascript{color}.
{code:lang=xml|title=Sample JSON Response}
{
  "responseData" : {
    "results" : [ {"firstName":"Curtis","lastName":"Bray","phone":"754-6199","deptNum":12345} ],
    "cursor" : {
               "estimatedResultCount": "20102",
               "currentIndex": 0,
               "moreResultsUrl": "https://iet-ws-test/ondir/load?start=500"
               }
  },
  "responseDetails" : null,
  "responseStatus" : 200
}

JSON reference

Request format

Response format

Each response follow this general format:

Code Block
langxml
{code}


h2. JSON reference

{color:#000000}Unlike the core JavaScript interface, the JSON interface is exposed through a uniform URL that contains CGI arguments. Your application can use an HTTP stack of its choosing. In order to use the JSON interface:{color}
* You must construct a properly formatted URL with all necessary CGI arguments.
* You must send an HTTP referer header that accurately identifies your application.
* You must process the JSON-encoded response.

h3. Request format

{color:#003366}{*}URL base address{*}{color}

h4.

The standard URL for the IET Middleware Online Directory Bulk Load API is:

https://iet-ws.ucdavis.edu/directory/load

h4. *URL arguments*

This section describes the arguments that can be used for Bulk Load requests.

The value of a CGI argument must always be properly escaped. This can be done via the functional equivalent of JavaScript's&nbsp;encodeURIComponent()&nbsp;method.

h5. *{_}{+}Required URL arguments{+}{_}*

The following table lists the required URL arguments.
|| *Argument* || *Example* || *Description* ||
| key | key=your-key | This argument supplies the application's key. You can sign up for an API key&nbsp;[on the sign-up page|http://code.google.com/apis/loader/signup.html].\\
If specified, it must be a valid key associated with your site. The key must be validated against the passed referer header. The advantage of supplying a key is so that we can identify and contact you should something go wrong with your application. Without a key, we will still take the same appropriate measures on our side, but we will not be able to contact you. It is definitely best for you to pass a key. |
| v | v=1.0 | This argument supplies protocol version number. The only valid value at this point in time is&nbsp;1.0. |

h5. *{_}{+}Optional URL arguments{+}{_}*

The following table lists the optional URL arguments.
|| *Argument* || *Example* || *Description* ||
| start | start=500 | This argument supplies the starting record index of the first search result. Each successful response contains a&nbsp;cursorobject (see below) which includes an array of&nbsp;pages. The&nbsp;start&nbsp;property for a page may be used as a valid value for this argument. For reference, a sample cursor object is shown below: "cursor" : {
               "estimatedResultCount": "20102",
               "currentIndex": 0,
               "moreResultsUrl": "https://iet-ws.ucdavis.edu/ondir...."
               }\\ |
| userip | userip=192.168.0.1 | This argument supplies the IP address of the end-user on whose behalf the request is being made. Requests that include it are less likely to be mistaken for abuse. In choosing to utilize this parameter, please be sure that you're in compliance with any local laws, including any laws relating to disclosure of personal information being sent. |

h3. Response format

Each response follow this general format:
{code:lang=xml}
{
  "responseData" : {
    "results" : [],
    "cursor" : {}
  },
  "responseDetails" : null | string-on-error,
  "responseStatus" : 200 | error-code
}
Trouble shooting
{code}

h2. Trouble shooting