Wiki Markup |
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:OverviewThese 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 ].
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.
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 curl command line tool to execute sample queries.
{code:title=Sample JSON Request}. 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 requirementsEach 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 interfaceThe 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 |
---|
| 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 {color:#339966}Content-Type of text/javascript{color}.
{code:lang=xml|title=Sample JSON Response}has a Content-Type of text/javascript. Code Block |
---|
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
}
{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:
|
JSON referenceUnlike 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.
URL base address 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 encodeURIComponent() 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 [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 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 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:URL argumentsThis 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 argumentsThe 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 <INSERT LINK HERE>. It must be a valid key associated with your application. The key is required for this API to implement quality of service rules for this API. If your application is making too many requests it will be throttled to ensure resources are not overloaded during times of peak usage. Also, by supplying a key we can identify and contact you should something go wrong with your application. | v | v=1.0 | This argument supplies protocol version number. The only valid value at this point in time is 1.0. |
Optional URL argumentsThe 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: |
"estimatedResultCount": "20102",
|
|
"moreResultsUrl": "https://iet-ws.ucdavis.edu/ondir...." |
|
\\ || | | |
h3. Response format
Each response follow this general format:
{code:lang=xml}Each response follow this general format: Code Block |
---|
|
{
"responseData" : {
"results" : [],
"cursor" : {}
},
"responseDetails" : null | string-on-error,
"responseStatus" : 200 | error-code
}
{code}
h2. Trouble shooting
|
Trouble shooting |