This library makes use of jQuery to perform the HTTP calls to the server and to encode and decode the JSON messages.
Library Call Reference
The first function, the success call-back, is called if the operation was successful and is passed a single parameter containing the payload object returned by the server (the Reply envelope is stripped off by the library).
Register a call-back with the API that will be called if any API call returns an ‘AUTH’ status, indicating that the session has timed out. Typically this call-back should prompt to user to log in.
Returns (via the success call-back) the current public RSA session key.
Returns (via the success call-back) the current public JSessionId and sets the JSESSIONID cookie.
login(username, encryptedPassword, success_callback, failure_callback)
Given the user name and an encrypted password establishes a secure, authenticated session with the server.
Instructs the server to destroy the current session and discard the currently held credentials.
getClips(query, success_callback, failure_callback)
Returns (via the success call-back) a PartialResultSet containing the clips that match the filter in the query.
The query parameter is an object with the following fields
|filter||String||Standard clip query as described in “Clip Query Filter Syntax”|
|skip||Integer||Skip the first N results in the result set|
|take||Integer||Return the N results after the skipped results.|
|asc*||String||Column name to sort by in ascending order|
|desc*||String||Column name to sort by in descending order|
* only one of ‘asc’ or ‘desc’ can be used in one call
getClip(clipId, success_callback, failure_callback)
Returns (via the success call-back) the clip with the specified id.
updateClip(clip, success_callback, failure_callback)
Takes a partially populated clip object, whose populated fields must include the ID, and updates those fields of the clip with that id on the server. Currently only a small number of fields are supported, but this will increase over time.