Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

DRAFT * DRAFT * DRAFT

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

In this Section

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 middleware-api@ucdavis.edu.

Audience

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.

Sample JSON Request
curl -i -H "Accept: application/json" https://iet-ws-test/directory/load?key=JPO3Dkljsd3Skjkdxxo3SJK00&v=1.0

This command performs a bulk load request (/directory/load). The response has a Content-Type of text/javascript.

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

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:

  • 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.

Request format

URL base address

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

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

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 encodeURIComponent() method.

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 on the sign-up page.
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 1.0.

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 cursorobject (see below) which includes an array of pages. The start property for a page may be used as a valid value for this argument. For reference, a sample cursor object is shown below: "cursor" :

Unknown macro: { "estimatedResultCount"}


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.

Response format

Each response follow this general format:

{
  "responseData" : {
    "results" : [],
    "cursor" : {}
  },
  "responseDetails" : null | string-on-error,
  "responseStatus" : 200 | error-code
}

Trouble shooting

  • No labels