{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 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: "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
}
|