Zimki Documentation
https://docs.zimki.com
zimki.session
https://docs.zimki.com/zimki.session
<p>Provides access to properties and methods about the current Zimki session. Zimki Session objects are also <a href="http://service.zimki.com/u/fisible/?thing=Zimki%20Class">Persistable</a>.</p>
<p>The session can be used to store data between requests made from the same browser:</p>
<pre> zimki.session.fish = "trout";
zimki.session.save(); </pre>
<p>The session will be restored automatically on the next request from that web browser (based on the cookie that it sends)</p>
<pre>
var seafood = zimki.session.fish; </pre>2006-06-26T16:47:33.627+00:00undefinedzimki.session.user
https://docs.zimki.com/zimki.session.user
<p>The zimki_user object of the user (if any) currently logged into the session. Can be set using <a href="zimki.session.login">zimki.session.login</a>.</p>2007-04-05T19:44:29.208+00:00undefinedzimki.session.login
https://docs.zimki.com/zimki.session.login
<p>Logs a session in. Requires a valid username and password for the current realm. If the username and password combination is invalid an error is thrown.</p>
<p>Example:</p>
<pre>
function login ( args ) {
try {
zimki.session.login( args.username, args.password );
}
catch (e) {
return "could not log in";
}
return "logged in";
}
zimki.publishPath( '/login', login );
</pre>2006-06-26T16:51:06.706+00:00undefinedXML API
https://docs.zimki.com/XML API
<p>Moved to <a href="ZimkiExternalAPI">ZimkiExternalAPI</a></p>2006-09-20T13:28:51.592+00:00[object Object]zimki
https://docs.zimki.com/zimki
<p>For those new to Zimki, check out the Zimki <a href="CookBook">CookBook</a>. Find out how to set up your realms and use the various functions within Zimki. The Zimki documentation will continue to improve over the coming weeks and months.
</p><ul>
<li class="u"><a href="Libraries">Libraries</a></li>
<li class="u"><a href="ExternalAPI">External API Reference</a></li>
<li class="u"><a href="WebDAV">WebDAV Access</a></li>
<li class="u"><a href="http://service.zimki.com/u/documentation/Frequently%20Asked%20Questions">Frequently Asked Questions</a></li>
<li class="u"><a href="CookBook">Zimki CookBook</a></li>
<li class="u"><a href="ZimkiClientLibraries">Zimki Client Libraries</a></li></ul>
<p>The 'zimki' variable contains most of the zimki-specific parts of the zimki server platform.
</p>
<h1> Classes </h1>
<ul>
<li class="u"><a href="Zimki%20Class">Zimki Persistable</a></li>
<li class="u"><a href="File">File</a></li></ul>2006-06-23T16:36:29.161+00:00undefinedFile
https://docs.zimki.com/File
<p>File represents a file in the <a href="zimki">Zimki</a> file store.</p>
<p>Many of the properties of the file objects are changable, but you must call save() afterwards, similarly to the persistency engine. Prior to Zimki 1.10 you could not set arbitrary properties on them, but as of 1.10 we have lifted this restriction; files are now full-blown first class citizens, and every file is actually a 'zimki_file' instance.</p>
<p>Files can be added to your domain via the Portal interface, or by accepting <a href="Upload">file uploads</a> using a server-side JavaScript method. You can also create them from JavaScript.</p>
<p>The publish and unpublish methods can be used to add/remove publication paths corresponding to the file.</p>2006-06-27T16:51:59.638+00:00undefinedExternalAPI
https://docs.zimki.com/ExternalAPI
<h1>Overview</h1>
<p>
Zimki has an external RESTian API that currently supports 2 response types - XML and <em>standards-compliant</em> <a href="http://www.json.org/">JSON</a>.</p>
<p>The API is broken down into two sections:
</p>
<h2>Zimki External API</h2>
<p>The <a href="ZimkiExternalAPI">Zimki External API</a> is an extensible API that allows <em>customers</em> and their <em>users</em> to access core services available in a realm such as user authentication, session management, manipulating instances and files, creating Captchas, and more.</p>
<p>Default API Endpoint:</p><ul>
<li class="u"><a href="http://your-api-key.realm.zimki.com/zimki">http://your-api-key.realm.zimki.com/zimki</a></li>
<li class="u"><a href="http://your-api-key-alias/zimki">http://your-api-key-alias/zimki</a>
</li></ul>
<h2>Customer External API</h2>
<p>The <a href="CustomerExternalAPI">Customer External API</a> is an <em>authenticated</em> API that allows <em>customers</em> to manipulate their realms, updating instances, setting API keys, looking at billing data, and more.</p>
<p>Default API Endpoint:</p><ul>
<li class="u"><a href="https://www.zimki.com/api">https://www.zimki.com/api</a>
</li></ul>
<h1>Setting the Response Type</h1>
<p>To choose a response type you need to pass in a _<em>type</em> parameter to the request:</p>
<p><code>http://docs.realm.zimki.com/zimki?method=zimki.session.create&_type=json</code>
<code>
{"data":{"salt":"63305","group":[],"id":"741d88ee-d6d9-11db-b1dc-92c77c5d54ec","expires":"2007-03-20T12:52:18.290+00:00"},"stat":"ok"}
</code></p>
<p>XML is the default response type. An unrecognized _<em>type</em> will default to XML.
</p>
<h1>See Also</h1>
<p>
<a href="ZimkiClientLibraries">Zimki Client Libraries</a>
</p>2007-03-16T16:38:00.763+00:00undefinedZimkiExternalAPI
https://docs.zimki.com/ZimkiExternalAPI
<h1> zimki.captcha.create </h1>
<p>Generate a CAPTCHA image for the currently logged in user. The image will be stored in the local file repository, and published using zimki publication calls, so will count towards any quota you have. The url returned is the url under which the captcha will be available.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<captcha url="/relative/url/to/capcha/UUID.png"
id="0508B9CF-12BB-4C2C-9DB7-E45A03755501" expires="date"/>
</rsp>
</pre>
<h1> zimki.captcha.verify </h1>
<p>Verify that a captcha is correct. Pass the ID of the generated captca, and the code that you are guessing. Will return an error if the guess fails, or an empty response if the guess succeeds.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">captcha_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The ID of the captcha to verify </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">code </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The code to verify </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
empty response
</pre>
<h1> zimki.file.create </h1>
<p>Upload a file into zimki. This won't make the file visible to the outside world, however - you'll need to explicitly publish it to achieve that. Uploaded files will be owned by the user that uploaded them, and by default will only be editable and publishable by that user.</p>
<p>The description field is the only human-readable way you will be able to identify this file after upload, other than remembering the ID returned from this method. It will default to the filename of the upload, but you can set it if you prefer something else.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">description </td><td style="text-align:center;"> text </td><td style="text-align:center;"> A human-readable text description for the file. </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the group_id to give to the file, defaults to the current user's first group </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">mimetype </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Set if you want to force the mimetype of the uploaded file to something in particular </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the permissions to give to the file. Defaults to 0xFF0101 </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">upload </td><td style="text-align:center;"> multipart </td><td style="text-align:center;"> The file to upload, as an HTTP upload </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<file permissions="0x765" owner_id="owner"
mimetype="image/jpeg" id="0F4E8148-107F-408C-972B-D2451600A553"
group_id="group" filesize="1234" expires="2005-04-01T12:00"
created="2004-05-01T12:00">
<description>a description of the file.</description>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</rsp>
</pre>
<h1> zimki.file.delete </h1>
<p>Delete an uploaded file. Only root and users with the 'delete' ability on a file can do this - by default this is only the owner of the file.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the file to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
empty response
</pre>
<h1> zimki.file.search </h1>
<p>Lists the files uploaded. If you are logged in as root, it will list all files on the system, otherwise it will list only files that have been uploaded by the currently logged-in user.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> optional</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<resultset per_page="2" pages="4" page="1">
<file permissions="0x765" owner_id="owner" mimetype="image/jpeg"
id="0F4E8148-107F-408C-972B-D2451600A553" group_id="group"
filesize="1234" expires="2005-04-01T12:00"
created="2004-05-01T12:00">
<description>a description of the file.</description>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
<file permissions="0x765" owner_id="owner" mimetype="image/jpeg"
id="0F4E8148-107F-408C-972B-D2451600A553" group_id="group"
filesize="1234" expires="2005-04-01T12:00"
created="2004-05-01T12:00">
<description/>
<location created="2004-05-01T12:00"/>
<location>a description of the file.</location>
</file>
</resultset>
</rsp>
</pre>
<h1> zimki.file.unpublish </h1>
<p>Unpublish a file - it will no longer be available from the passed url, assuming it was to begin with. Only a file's owner, and root users, can do this.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the file to unpublish </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">url </td><td style="text-align:center;"> text </td><td style="text-align:center;"> if given, should be the url of the publication you want to remove. Otherwise removes all publications. </td><td style="text-align:right;"> optional</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<file permissions="0x765" owner_id="owner" mimetype="image/jpeg"
id="0F4E8148-107F-408C-972B-D2451600A553" group_id="group"
filesize="1234" expires="2005-04-01T12:00"
created="2004-05-01T12:00">
<description>a description of the file.</description>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</rsp>
</pre>
<h1> zimki.file.update </h1>
<p>Change the description, group, or permissions of an already-upload file. Only root or the file's owner can change these properties.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">description </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new description for the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the file to update </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new group_id of the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">mimetype </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Set if you want to force the mimetype of the uploaded file to something in particular </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new permissions for the file </td><td style="text-align:right;"> optional</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<file permissions="0x765" owner_id="owner" mimetype="image/jpeg"
id="0F4E8148-107F-408C-972B-D2451600A553" group_id="group"
filesize="1234" expires="2005-04-01T12:00"
created="2004-05-01T12:00">
<description>a description of the file.</description>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</rsp>
</pre>
<h1> zimki.instance.create </h1>
<p>Creates an instance of a persisted class. Instances can have any number of keys with any (with some exceptions) names - a class provides no checking of types, etc, beyond the initial permissions of the instance. Instances have an owner, a group, and rights of that owner and group to it's properties.</p>
<p>Any arguments provided to the method beyond those listed below are used as the initial state of the object's attributes.</p>
<p>An object has a special attribute 'expires', which may be set here. After this time, the object will no longer be accessible to API calls.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> trim </td><td style="text-align:center;"> the name of the class you are creating an instance of </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the group owner of the new instance </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the initial permissions of the object, assuming you are able to set them </td><td style="text-align:right;"> optional</td></tr></table>
<p>remaining arguments are passed to the method directly
</p>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<instance permissions="1248753" owner_id="foo"
id="5BAA65C6-AE60-4194-B075-0899B64E39DD"
group_id="bar" class="classname">
<attribute type="string" name="foo">fooo</attribute>
<attribute type="string" name="bar">baaaar</attribute>
</instance>
</rsp>
</pre>
<h1> zimki.instance.delete </h1>
<p>Delete an instance of a class</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want to delete </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you wish to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
empty response
</pre>
<h1> zimki.instance.deleteAttributes </h1>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">delete </td><td style="text-align:center;"> csv </td><td style="text-align:center;"> the attributes to delete. Pass many times to delete many attributes </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you wish to change </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<instance permissions="1248753" owner_id="foo"
id="5BAA65C6-AE60-4194-B075-0899B64E39DD" group_id="bar"
class="classname">
<attribute type="string" name="foo">fooo</attribute>
<attribute type="string" name="bar">baaaar</attribute>
</instance>
</rsp>
</pre>
<h1> zimki.instance.deleteWhere </h1>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> trim </td><td style="text-align:center;"> </td><td style="text-align:right;"> required</td></tr></table>
<p>remaining arguments are passed to the method directly
</p>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<deleted>3</deleted>
</rsp>
</pre>
<h1> zimki.instance.retrieve </h1>
<p>Returns the instance of the given class and ID, as XML.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want the details of </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you want the details of </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<instance permissions="1248753" owner_id="foo"
id="5BAA65C6-AE60-4194-B075-0899B64E39DD" group_id="bar"
class="classname">
<attribute type="string" name="foo">fooo</attribute>
<attribute type="string" name="bar">baaaar</attribute>
</instance>
</rsp>
</pre>
<h1> zimki.instance.search </h1>
<p>Find instances of a class. Arguments to this method beyond those listed below are interpreted as searches on the attributes of the persisted objects.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> trim </td><td style="text-align:center;"> </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> optional</td></tr></table>
<p>remaining arguments are passed to the method directly
</p>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<resultset per_page="2" pages="4" page="1">
<instance permissions="1248753" owner_id="foo"
id="5BAA65C6-AE60-4194-B075-0899B64E39DD" group_id="bar"
class="classname">
<attribute type="string" name="foo">fooo</attribute>
<attribute type="string" name="bar">baaaar</attribute>
</instance>
<instance permissions="1248753" owner_id="foo"
id="5BAA65C6-AE60-4194-B075-0899B64E39DD" group_id="bar"
class="classname">
<attribute/>
<attribute/>
</instance>
</resultset>
</rsp>
</pre>
<h1> zimki.instance.update </h1>
<p>Change the properties of an instance of a class. Currently, you can only add and set properties.</p>
<p>All arguments to this method beyond those listed below are set as properties of the object.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new group of the instance </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you wish to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new permissions of the instance </td><td style="text-align:right;"> optional</td></tr></table>
<p>remaining arguments are passed to the method directly
</p>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<instance permissions="1248753" owner_id="foo"
id="5BAA65C6-AE60-4194-B075-0899B64E39DD" group_id="bar"
class="classname">
<attribute type="string" name="foo">fooo</attribute>
<attribute type="string" name="bar">baaaar</attribute>
</instance>
</rsp>
</pre>
<h1> zimki.session.create </h1>
<p>Creates a new session. To log into zimki, you'll need salt, and salt lives in a session, so you'll need to create a session first.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">api_key </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the API key </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<session id="12345">
<expires>2005-10-05 16:02:38Z</expires>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<salt>12345678</salt>
<user username="foo" last_login="2005-01-34T12:00"
id="2471880F-8B7C-428B-8590-343D00484096"
created="2005-01-34T12:00"/>
<username>foo</username>
</session>
</rsp>
</pre>
<h1> zimki.session.delete </h1>
<p>This is as close as you'll get to a 'logout' call. It'll make the session you call it on invalid. Don't try to re-use the session_id after this call, it won't work.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">api_key </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the API key </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">session_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The session id </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
empty response
</pre>
<h1> zimki.session.login </h1>
<p>This is the login method. You'll need to know your username, a shared secret, and the salt of your current session. The shared secret should be the md5sum of the utf-8 encoded version of your password. This means that you must have created a session before making this call.</p>
<p>The 'hash' parameter here should be</p>
<p>md5( salt + secret )</p>
<p>which is probably</p>
<p>md5( salt + md5( password ) )</p>
<p>As a user, you have an ID, can can be in one or more groups, the details of which are returned by this call. Groups can affect your permissions to verious objects.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">api_key </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the API key </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">hash </td><td style="text-align:center;"> text </td><td style="text-align:center;"> a hash of the session's salt and your shared secret </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">session_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The session id </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">username </td><td style="text-align:center;"> text </td><td style="text-align:center;"> your user's username </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<session id="12345">
<expires>2005-10-05 16:02:38Z</expires>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<salt>12345678</salt>
<user username="foo" last_login="2005-01-34T12:00"
id="2471880F-8B7C-428B-8590-343D00484096"
created="2005-01-34T12:00"/>
<username>foo</username>
</session>
</rsp>
</pre>
<h1> zimki.session.retrieve </h1>
<p>If you have an existing session, but you're forgotten who you are, what groups you're in, or what your user_id or salt is, this method will remind you.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">api_key </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the API key </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">session_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The session id </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<session id="12345">
<expires>2005-10-05 16:02:38Z</expires>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<salt>12345678</salt>
<user username="foo" last_login="2005-01-34T12:00"
id="2471880F-8B7C-428B-8590-343D00484096"
created="2005-01-34T12:00"/>
<username>foo</username>
</session>
</rsp>
</pre>
<h1> zimki.user.retrieve </h1>
<p>Returns the details of the currently logged in user.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
get a user's details
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<user username="foo" last_login="2005-01-34T12:00"
id="2471880F-8B7C-428B-8590-343D00484096" created="2005-01-34T12:00">
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
</user>
</rsp>
</pre>
<h1> zimki.user.update </h1>
<p>Update the logged-in user's details.</p>
<p>Changing your username will not log you out, and it will not change your user_id, but the old username will no longer work.</p>
<p>This method takes implicit and required api<em>key and session</em>id parameters.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">secret </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new secret </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">username </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new requested username </td><td style="text-align:right;"> optional</td></tr></table>
<h2> Example response </h2>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok">
<user username="foo" last_login="2005-01-34T12:00"
id="2471880F-8B7C-428B-8590-343D00484096" created="2005-01-34T12:00">
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
<group name="foo" id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A"/>
</user>
</rsp>
</pre>2007-03-16T16:11:25.454+00:00undefinedCustomerExternalAPI
https://docs.zimki.com/CustomerExternalAPI
<p><a href="#customer-apikey-create"> customer.apikey.create</a><br/>
<a href="#customer-apikey-update"> customer.apikey.update</a><br/>
<a href="#customer-billing-chargesByDay"> customer.billing.chargesByDay</a><br/>
<a href="#customer-billing-chargesByHour"> customer.billing.chargesByHour</a><br/>
<a href="#customer-billing-pendingPurchases"> customer.billing.pendingPurchases</a><br/>
<a href="#customer-billing-purchases"> customer.billing.purchases</a><br/>
<a href="#customer-class-create"> customer.class.create</a><br/>
<a href="#customer-class-delete"> customer.class.delete</a><br/>
<a href="#customer-class-search"> customer.class.search</a><br/>
<a href="#customer-class-update"> customer.class.update</a><br/>
<a href="#customer-file-create"> customer.file.create</a><br/>
<a href="#customer-file-delete"> customer.file.delete</a><br/>
<a href="#customer-file-publish"> customer.file.publish</a><br/>
<a href="#customer-file-search"> customer.file.search</a><br/>
<a href="#customer-file-unpublish"> customer.file.unpublish</a><br/>
<a href="#customer-file-update"> customer.file.update</a><br/>
<a href="#customer-group-create"> customer.group.create</a><br/>
<a href="#customer-group-delete"> customer.group.delete</a><br/>
<a href="#customer-group-retrieve"> customer.group.retrieve</a><br/>
<a href="#customer-group-search"> customer.group.search</a><br/>
<a href="#customer-group-update"> customer.group.update</a><br/>
<a href="#customer-instance-create"> customer.instance.create</a><br/>
<a href="#customer-instance-delete"> customer.instance.delete</a><br/>
<a href="#customer-instance-deleteAttributes"> customer.instance.deleteAttributes</a><br/>
<a href="#customer-instance-deleteWhere"> customer.instance.deleteWhere</a><br/>
<a href="#customer-instance-retrieve"> customer.instance.retrieve</a><br/>
<a href="#customer-instance-search"> customer.instance.search</a><br/>
<a href="#customer-instance-update"> customer.instance.update</a><br/>
<a href="#customer-javascript-run"> customer.javascript.run</a><br/>
<a href="#customer-realm-copy"> customer.realm.copy</a><br/>
<a href="#customer-realm-create"> customer.realm.create</a><br/>
<a href="#customer-realm-delete"> customer.realm.delete</a><br/>
<a href="#customer-realm-restore"> customer.realm.restore</a><br/>
<a href="#customer-realm-retrieve"> customer.realm.retrieve</a><br/>
<a href="#customer-realm-search"> customer.realm.search</a><br/>
<a href="#customer-realm-update"> customer.realm.update</a><br/>
<a href="#customer-session-create"> customer.session.create</a><br/>
<a href="#customer-session-login"> customer.session.login</a><br/>
<a href="#customer-unittest-run"> customer.unittest.run</a><br/>
<a href="#customer-unittest-runAll"> customer.unittest.runAll</a><br/>
<a href="#customer-user-create"> customer.user.create</a><br/>
<a href="#customer-user-delete"> customer.user.delete</a><br/>
<a href="#customer-user-retrieve"> customer.user.retrieve</a><br/>
<a href="#customer-user-search"> customer.user.search</a><br/>
<a href="#customer-user-update"> customer.user.update</a><br/></p>
<p><h1 id="customer-apikey-create">customer.apikey.create</h1></p>
<p> Create a new API key in a realm.</p>
<p> The api key alias must be unique across the whole of Zimki.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<p> Returns XML describing the new api key</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm to create the key for </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> A name for the api key </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">alias </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The alias for the new api key. </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<api_key revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</response>
</pre>
<p><h1 id="customer-apikey-update">customer.apikey.update</h1></p>
<p> Update an existing api key in a realm.</p>
<p> The api key alias must be unique across the whole of Zimki.</p>
<p> A revoked api key can't be used to access your realm, but does maintain it's alias, effectively reserving it.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<p> Returns XML describing the new api key</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">api_key </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The API key. </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> change the name to something else </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">revoked </td><td style="text-align:center;"> text </td><td style="text-align:center;"> revoke the key\? </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">alias </td><td style="text-align:center;"> text </td><td style="text-align:center;"> change the alias </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<api_key revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</response>
</pre>
<p><h1 id="customer-billing-chargesByDay">customer.billing.chargesByDay</h1></p>
<p> Return billing data for the period between 'start' and 'finish', broken down by day. Both these parameters should be ISO8601 datetimes - the 'start' time will be truncated to the midnight before or at the passed time, and the 'finish' time will be extended to the end of the day containing the passed date.</p>
<p> If 'realm_id' is passed, billing data for only that realm will be returned, otherwise all realms' data will be returned.</p>
<p> The call list can become long, so if 'min_count' is passed, only paths that have been visited at least min_count times will be returned in the data.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm to limit the report to </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">start </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the beginning of the period </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">finish </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the end of the period </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">min_count </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Limit returned call data to only paths visited at least this many times </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">aggregate </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Combine data from all realms into one 'day' node per day </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<data>
<day realm_id="id" time="2006-09-01T12:00:00+00:00" jsops="1" storage="2" bandwidth="3" special="4" total="10" burn="4">
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
</day>
<day realm_id="id" time="2006-09-01T12:00:00+00:00" jsops="1" storage="2" bandwidth="3" special="4" total="10" burn="4">
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
</day>
</data>
</response>
</pre>
<p><h1 id="customer-billing-chargesByHour">customer.billing.chargesByHour</h1></p>
<p> Return billing data for the period between 'start' and 'finish', broken down by hour. Both these parameters should be ISO8601 datetimes - the 'start' time will be truncated to the hour boundary before or at the passed time, and the 'finish' time will be extended to the end of the hour passed.</p>
<p> If 'realm_id' is passed, billing data for only that realm will be returned, otherwise all realms' data will be returned.</p>
<p> The call list can become long, so if 'min_count' is passed, only paths that have been visited at least min_count times will be returned in the data.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">start </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the beginning of the period </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">finish </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the end of the period </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm to limit the report to </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">min_count </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Limit returned call data to only paths visited at least this many times </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">aggregate </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Combine data from all realms into one 'hour' node per hour </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<data>
<hour realm_id="id" time="2006-09-01T12:00:00+00:00" jsops="1" storage="2" bandwidth="3" special="4" total="10">
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
</hour>
<hour realm_id="id" time="2006-09-01T12:00:00+00:00" jsops="1" storage="2" bandwidth="3" special="4" total="10">
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
<call type="publishPath" info="/foo/bar/baz.html" count="34"/>
</hour>
</data>
</response>
</pre>
<p><h1 id="customer-billing-pendingPurchases">customer.billing.pendingPurchases</h1></p>
<p> returns a list of all purchases that have been asked for by the user, but have yet to be approved.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">start </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the beginning of the period </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">finish </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the end of the period </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<data>
<pendingPurchase id="uuid" time="2006-09-01T12:00:00+00:00" tokens="" paid="" source="" note="" rejected=""/>
<pendingPurchase id="uuid" time="2006-09-01T12:00:00+00:00" tokens="" paid="" source="" note="" rejected=""/>
</data>
</response>
</pre>
<p><h1 id="customer-billing-purchases">customer.billing.purchases</h1></p>
<p> Returns a list of all token purchases made by the user that have been approved, between the passed times.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">start </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the beginning of the period </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">finish </td><td style="text-align:center;"> text </td><td style="text-align:center;"> timestamp at the end of the period </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<data>
<purchase id="uuid" time="2006-09-01T12:00:00+00:00" tokens="32545" paid="" source="" note=""/>
<purchase id="uuid" time="2006-09-01T12:13:00+00:00" tokens="76546745" paid="" source="" note=""/>
</data>
</response>
</pre>
<p><h1 id="customer-class-create">customer.class.create</h1></p>
<p> Create a new class. All persisted object must be instances of a class.</p>
<p> The security model is very simple - the permissions on a class define which users / groups can create instances of these classes. The 'instance_permissions' attribute defines the default permissions of objects created by these users.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the new class </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the permissions for the new class </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> permissions to give to new instances of this class </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">owner_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The classes owner </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The group the class will belong to </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<class name="classname" permissions="0xffffff" instance_permissions="0xffffff" owner_id="452273BC-712F-4EBD-B791-0AF2BD77401D" group_id="51108C86-6BCF-4187-A14D-53441DF5BA07"/>
</response>
</pre>
<p><h1 id="customer-class-delete">customer.class.delete</h1></p>
<p> Deletes a defined class. Will alse delete all instances of this class.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the class to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response></response>
</pre>
<p><h1 id="customer-class-search">customer.class.search</h1></p>
<p> Searches for classes in a realm. If no search arguments are passed, all classes are returned. If a 'name' argument is passed, classes whose name is the same as the passed value are returned. You can also pass 'name__startswith' or 'name__notstartswith' arguments to return classes whose name starts or doesn't start with the passed value.</p>
<p> This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The page number (defaults to 1) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Number of entries per page </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">__other </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Search args (e.g. name__startswith or name__notstartswith) </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<resultset pages="4" page="1" per_page="2">
<class name="classname" permissions="0xffffff" instance_permissions="0xffffff" owner_id="452273BC-712F-4EBD-B791-0AF2BD77401D" group_id="51108C86-6BCF-4187-A14D-53441DF5BA07"/>
<class name="classname" permissions="0xffffff" instance_permissions="0xffffff" owner_id="452273BC-712F-4EBD-B791-0AF2BD77401D" group_id="51108C86-6BCF-4187-A14D-53441DF5BA07"/>
</resultset>
</response>
</pre>
<p><h1 id="customer-class-update">customer.class.update</h1></p>
<p> This method lets you change the permissions and instance_permissions of an existing class. Class names cannot be changed.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the class to update </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new class permissions </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">instance_permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new class instance permissions </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">owner_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The new owner of the class </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The group the class will belong to </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<class name="classname" permissions="0xffffff" instance_permissions="0xffffff" owner_id="452273BC-712F-4EBD-B791-0AF2BD77401D" group_id="51108C86-6BCF-4187-A14D-53441DF5BA07"/>
</response>
</pre>
<p><h1 id="customer-file-create">customer.file.create</h1></p>
<p> Upload a file into zimki. This won't make the file visible to the outside world, however - you'll need to explicitly publish it to achieve that.</p>
<p> The name field is the only human-readable way you will be able to identify this file after upload, other than remembering the ID returned from this method. It will default to the filename of the upload, but you can set it if you prefer something else.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The file to upload, as an HTTP upload </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm that will own this file </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">owner_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the owner_id to give to the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the group_id to give to the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the permissions to give to the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> A human-readable text name for the file. Defaults to the upload filename. </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">mimetype </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Set if you want to force the mimetype of the uploaded file to something in particular. Autodetected otherwise. </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">expires </td><td style="text-align:center;"> text </td><td style="text-align:center;"> When the file should expire, if at all. Use an ISO8601 datetime, or a string like '+1h' for 'in one hour' </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<file id="0F4E8148-107F-408C-972B-D2451600A553" filesize="1234" mimetype="image/jpeg" created="2004-05-01T12:00" expires="2005-04-01T12:00" owner_id="owner" group_id="group" permissions="0x765" dent_url="for internal use only">
<name>a description of the file.</name>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</response>
</pre>
<p><h1 id="customer-file-delete">customer.file.delete</h1></p>
<p> Delete an uploaded file.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm owning these files </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the file to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response></response>
</pre>
<p><h1 id="customer-file-publish">customer.file.publish</h1></p>
<p> Publish a file. This will make the file with the given ID available on the zimki endpoint by a combination of the current realm_id and the url you pass. Specifically, the url of a file published at <img src="/foo.jpg" alt="/foo.jpg"/> will be something like</p>
<p> <pre>http://{alias}<img src=".realm.zimki.com/foo.jpg" alt=".realm.zimki.com/foo.jpg"/></pre> </p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm owning these files </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the file to publish </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">url </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the relative url to publish to </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<file id="0F4E8148-107F-408C-972B-D2451600A553" filesize="1234" mimetype="image/jpeg" created="2004-05-01T12:00" expires="2005-04-01T12:00" owner_id="owner" group_id="group" permissions="0x765" dent_url="for internal use only">
<name>a description of the file.</name>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</response>
</pre>
<p><h1 id="customer-file-search">customer.file.search</h1></p>
<p> Lists the files uploaded.</p>
<p> If pased, the 'glob' argument will restrict the search to only files published to paths that match the argument, using unix glob semantics ('*' matches any number of characters, '\?' matches one).</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The page number (defaults to 1) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Number of entries per page </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm owning these files </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">glob </td><td style="text-align:center;"> text </td><td style="text-align:center;"> return only files published to a path that matches the given glob </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<resultset pages="4" page="1" per_page="2">
<file id="0F4E8148-107F-408C-972B-D2451600A553" filesize="1234" mimetype="image/jpeg" created="2004-05-01T12:00" expires="2005-04-01T12:00" owner_id="owner" group_id="group" permissions="0x765" dent_url="for internal use only">
<name>a description of the file.</name>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
<file id="0F4E8148-107F-408C-972B-D2451600A553" filesize="1234" mimetype="image/jpeg" created="2004-05-01T12:00" expires="2005-04-01T12:00" owner_id="owner" group_id="group" permissions="0x765" dent_url="for internal use only">
<name>a description of the file.</name>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</resultset>
</response>
</pre>
<p><h1 id="customer-file-unpublish">customer.file.unpublish</h1></p>
<p> Unpublish a file - it will no longer be available from the passed url, assuming it was to begin with.</p>
<p> Both file_id and url are optional - but you must pass one of them. If you pass only file_id, all publications of that file will be removed. If you pass only url, any file published to that url will be unpublished.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm owning these files </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the file to unpublish. Can be left blank to just unpublish whetever is at the given url </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">url </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the url of the publication you want to remove. Can be left blank to unpublish all urls of the given file. </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<file id="0F4E8148-107F-408C-972B-D2451600A553" filesize="1234" mimetype="image/jpeg" created="2004-05-01T12:00" expires="2005-04-01T12:00" owner_id="owner" group_id="group" permissions="0x765" dent_url="for internal use only">
<name>a description of the file.</name>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</response>
</pre>
<p><h1 id="customer-file-update">customer.file.update</h1></p>
<p> Change the name, group, owner or permissions of an already-uploaded file.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm owning these files </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">file_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the file to update </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">owner_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new owner_id of the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new group_id of the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">permissions </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new permissions for the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new name for the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">mimetype </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new mime type for the file </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">expires </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new expires time of the file </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<file id="0F4E8148-107F-408C-972B-D2451600A553" filesize="1234" mimetype="image/jpeg" created="2004-05-01T12:00" expires="2005-04-01T12:00" owner_id="owner" group_id="group" permissions="0x765" dent_url="for internal use only">
<name>a description of the file.</name>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
<location url="/some/publish/url" created="2004-05-10T12:00"/>
</file>
</response>
</pre>
<p><h1 id="customer-group-create">customer.group.create</h1></p>
<p> Create a group.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the requested groupname </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo" users="12845">
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
</group>
</response>
</pre>
<p><h1 id="customer-group-delete">customer.group.delete</h1></p>
<p> Delete a group.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The ID of the group to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response></response>
</pre>
<p><h1 id="customer-group-retrieve">customer.group.retrieve</h1></p>
<p> This returns the details of a group. The optional 'want_users' parameter, if true, will include in the returned XML a list of every user in this group.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the group id </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">want_users </td><td style="text-align:center;"> text </td><td style="text-align:center;"> do we want the full userlist returned\? </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo" users="12845">
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
</group>
</response>
</pre>
<p><h1 id="customer-group-search">customer.group.search</h1></p>
<p> Returns a list of groups. If the 'want_users' parameter is passed, the users that are in those groups will be returned as well, otherwise only the groups will be returned.</p>
<p> This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the realm to search in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The page number (defaults to 1) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Number of entries per page </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">want_users </td><td style="text-align:center;"> text </td><td style="text-align:center;"> return user information as well </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<resultset pages="4" page="1" per_page="2">
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo" users="12845">
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
</group>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo" users="12845">
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
</group>
</resultset>
</response>
</pre>
<p><h1 id="customer-group-update">customer.group.update</h1></p>
<p> Update the details of a group.</p>
<p> This call will also let you set a list of user_ids that are in the group. _If_ a list of userids is passed, then any users that are already in the group but _aren't_ in the passed list will be removed from the group.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the group id </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> new name </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">want_users </td><td style="text-align:center;"> text </td><td style="text-align:center;"> do we want the full userlist returned\? </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">user_ids </td><td style="text-align:center;"> text </td><td style="text-align:center;"> new list of users </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo" users="12845">
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00"/>
</group>
</response>
</pre>
<p><h1 id="customer-instance-create">customer.instance.create</h1></p>
<p> Creates an instance of a persisted class. Instances can have any number of keys with any (with some exceptions) names - a class provides no checking of types, etc, beyond the initial permissions of the instance.</p>
<p> Any arguments provided to the method beyond those listed below are used as the initial state of the object's attributes.</p>
<p> An object has a special attribute 'expires', which may be set here. After this time, the object will no longer be accessible to API calls. The expires attribute can be set to either an ISO8601 datetime string, or a string such as '+1h', in which case the object will expire in one hour's time.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the class you are creating an instance of </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">__other </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The initial state of the created object </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<instance class="classname" id="5BAA65C6-AE60-4194-B075-0899B64E39DD" owner_id="foo" group_id="bar" permissions="1248753">
<attribute name="foo" type="string">fooo</attribute>
<attribute name="bar" type="string">baaaar</attribute>
</instance>
</response>
</pre>
<p><h1 id="customer-instance-delete">customer.instance.delete</h1></p>
<p> Delete an instance of a class</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want to delete </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you wish to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response></response>
</pre>
<p><h1 id="customer-instance-deleteAttributes">customer.instance.deleteAttributes</h1></p>
<p> Deletes attributes from an instance. The 'delete' param should be a comma-seperated list of attributes to delete. You can't (as-yet) delete arguments with commas in their names.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you wish to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">delete </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the attributes to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<instance class="classname" id="5BAA65C6-AE60-4194-B075-0899B64E39DD" owner_id="foo" group_id="bar" permissions="1248753">
<attribute name="foo" type="string">fooo</attribute>
<attribute name="bar" type="string">baaaar</attribute>
</instance>
</response>
</pre>
<p><h1 id="customer-instance-deleteWhere">customer.instance.deleteWhere</h1></p>
<p> Delete instances of a class. Arguments to this method beyond those listed below are interpreted as searches on the attributes of the persisted object. Returns the number of instances deleted.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">__other </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<deleted>3</deleted>
</response>
</pre>
<p><h1 id="customer-instance-retrieve">customer.instance.retrieve</h1></p>
<p> Returns the instance of the given class and ID, as XML.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want the details of </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you want the details of </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<instance class="classname" id="5BAA65C6-AE60-4194-B075-0899B64E39DD" owner_id="foo" group_id="bar" permissions="1248753">
<attribute name="foo" type="string">fooo</attribute>
<attribute name="bar" type="string">baaaar</attribute>
</instance>
</response>
</pre>
<p><h1 id="customer-instance-search">customer.instance.search</h1></p>
<p> Find instances of a class. Arguments to this method beyond those listed below are interpreted as searches on the attributes of the persisted objects.</p>
<p> See the docs for the JavaScript persist method 'search' for documentation on the search parameter format.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<p> This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The page number (defaults to 1) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Number of entries per page </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">__other </td><td style="text-align:center;"> text </td><td style="text-align:center;"> search terms </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<resultset pages="4" page="1" per_page="2">
<instance class="classname" id="5BAA65C6-AE60-4194-B075-0899B64E39DD" owner_id="foo" group_id="bar" permissions="1248753">
<attribute name="foo" type="string">fooo</attribute>
<attribute name="bar" type="string">baaaar</attribute>
</instance>
<instance class="classname" id="5BAA65C6-AE60-4194-B075-0899B64E39DD" owner_id="foo" group_id="bar" permissions="1248753">
<attribute name="foo" type="string">fooo</attribute>
<attribute name="bar" type="string">baaaar</attribute>
</instance>
</resultset>
</response>
</pre>
<p><h1 id="customer-instance-update">customer.instance.update</h1></p>
<p> Change the properties of an instance of a class. Currently, you can only add and set properties using this method. Use customer.instance.deleteAttributes to remove properties of an object.</p>
<p> All arguments to this method beyond those listed below are set as properties of the object. Any existing properties of the object not sent as arguments will not be changed.</p>
<p> This method takes implicit and required api_key and session_id parameters.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">class </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the class of the instance you want to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">instance_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the instance you wish to change </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">__other </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<instance class="classname" id="5BAA65C6-AE60-4194-B075-0899B64E39DD" owner_id="foo" group_id="bar" permissions="1248753">
<attribute name="foo" type="string">fooo</attribute>
<attribute name="bar" type="string">baaaar</attribute>
</instance>
</response>
</pre>
<p><h1 id="customer-javascript-run">customer.javascript.run</h1></p>
<p> run some arbitrary JS code in the context. Useful for creating classes, doing initial setup, etc</p>
<p> Returns the result returned from the JavaScript call, formatted as JSON.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">code </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the code to evaluate </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<return>the return value of the code</return>
</response>
</pre>
<p><h1 id="customer-realm-copy">customer.realm.copy</h1></p>
<p> Copy the realm specified by the source_realm_id argument. If target_realm_id is specified, the source realm will be copied into the target realm, otherwise a new realm (named with the 'target_name' argument) will be created, and the source will be copied into it.</p>
<p> The 'classes' argument should be a comma-seperated list of clasnames to copy, if you want to restrict your copy to a subset of the domain. Likewise, the 'files' argument should be '1' to copy the files in the domain, and '0' to not. If the 'all_classes' argument is set, all the classes in the source domain will be copied.</p>
<p> As a special case, if none of the optional arguments <em>classes</em>, <em>files</em>, or <em>all_classes</em> are specified all files, users, classes and instances will be copied.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<p> Returns XML describing the target realm.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">source_realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the realm to be copyd </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">target_realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the realm to copy to - if omitted, a new realm will be created </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">target_name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The name to use for the target realm. If not specified, will keep the existing. </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">all_classes </td><td style="text-align:center;"> text </td><td style="text-align:center;"> copy all classes, instead of just those listed </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">classes </td><td style="text-align:center;"> text </td><td style="text-align:center;"> list of classes to copy </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">files </td><td style="text-align:center;"> text </td><td style="text-align:center;"> 1 if we should copy files\; 0 (the default) otherwise </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
</response>
</pre>
<p><h1 id="customer-realm-create">customer.realm.create</h1></p>
<p> Create a new realm. You are limited to a maximum of 50 realms per account.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<p> Returns XML describing the new realm.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the realm </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">public </td><td style="text-align:center;"> text </td><td style="text-align:center;"> whether the realm should be public (cloneable) or not (default 0) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">copy_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> copy an existing realm with this ID (must be either marked public, or owned by the currently logged-in customer. </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
</response>
</pre>
<p><h1 id="customer-realm-delete">customer.realm.delete</h1></p>
<p> Delete a realm. This can't be undone - the realm and all the data in it will be removed.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the realm to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response></response>
</pre>
<p><h1 id="customer-realm-restore">customer.realm.restore</h1></p>
<p> Restore a realm from a backup. If a realm_id is given the restore happens into that realm, merging the data, otherwise a new realm is created and the restoration happens into that. Returns XML describing the new realm.</p>
<p> The file parameter should be a HTTP POST form upload of a previously-downloaded backup zipfile.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the realm, if one is created. </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the ID of the target realm, if you want to restore into an existing realm. </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">file </td><td style="text-align:center;"> text </td><td style="text-align:center;"> a backup containing the realm to restore </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
</response>
</pre>
<p><h1 id="customer-realm-retrieve">customer.realm.retrieve</h1></p>
<p> Retrieves information associated with a realm. This call just returns data about a realm - it changes nothing.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the realm </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
</response>
</pre>
<p><h1 id="customer-realm-search">customer.realm.search</h1></p>
<p> Searches the realms owned by the current customer. Searches can only be performed on the 'name' attribute of a realm - if this argument is passed, only realms with that name are returned, otherwise all realms are returned.</p>
<p> Results are paginated - use the page and per_page arguments to control the maximum number of results returned from a single call, and the page of results to return.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The page number </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Number of entries per page </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">deleted </td><td style="text-align:center;"> text </td><td style="text-align:center;"> If true, return deleted realms as well </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<resultset pages="4" page="1" per_page="2">
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
</resultset>
</response>
</pre>
<p><h1 id="customer-realm-update">customer.realm.update</h1></p>
<p> Update information about a realm.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<p> Returns XML describing the updated realm.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the realm's id </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">name </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the name of the realm </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">public </td><td style="text-align:center;"> text </td><td style="text-align:center;"> whether the argument should be public or not </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<realm id="1148215D-2F88-42DE-86B2-6BFDF46BEEA7" name="Test" public="1" storage_quota="100" storage_used="1" deleted="0">
<tokens allowance="3000" today="123" yesterday="1234" sevenDayAverage="2345" todayBurn="0" yesterdayBurn="0" sevenDayAverageBurn="0"/>
<suspended date="iso8601 date" reason="suspended reason"/>
<api_key active="1" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
<api_key active="0" revoked="0" issue_date="2005-10-31T14:49:47" name="name goes here" alias="alias" id="987331AC-4A1D-11DA-98F1-DDB51046DF9C" url="http://realm.url"/>
</realm>
</response>
</pre>
<p><h1 id="customer-session-create">customer.session.create</h1></p>
<p> Creates a new session. To log into the customer API, you'll need salt, and salt lives in a session, so you'll need to create a session first.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<session id="12345">
<salt>12345678</salt>
<expires>2005-10-05 16:02:38Z</expires>
</session>
</response>
</pre>
<p><h1 id="customer-session-login">customer.session.login</h1></p>
<p>Authenticates a customer session. This method requires a hash of the customer
password and the session salt generated as follows:</p>
<pre>
hash = md5_hex(salt + md5_hex(password))
</pre>
<p>Where <em>md5_hex</em> is a function that returns an MD5 digest in hexidecimal form.
</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">username </td><td style="text-align:center;"> text </td><td style="text-align:center;"> customer username (email address) </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">hash </td><td style="text-align:center;"> text </td><td style="text-align:center;"> password hash as described above </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">session_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> an authenticated session id </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<session id="12345">
<salt>12345678</salt>
<login id="2471880F-8B7C-428B-8590-343D00484096" email="foo" customer_id="cid"/>
<expires>2005-10-05 16:02:38Z</expires>
</session>
</response>
</pre>
<p><h1 id="customer-unittest-run">customer.unittest.run</h1></p>
<p> run the unit test with the given id</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The realm we're working in </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">test_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the test to run </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<unittest id="452273BC-712F-4EBD-B791-0AF2BD77401D" name="My test" planned="4" ran="4" failed="0">
<test pass="1" comment="about this assertion" error="error message"/>
<test pass="1" comment="about this assertion" error="error message"/>
</unittest>
</response>
</pre>
<p><h1 id="customer-unittest-runAll">customer.unittest.runAll</h1></p>
<p> run all unit tests in the current realm</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The domain we're working in </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<unittests>
<unittest id="452273BC-712F-4EBD-B791-0AF2BD77401D" name="My test" planned="4" ran="4" failed="0">
<test pass="1" comment="about this assertion" error="error message"/>
<test pass="1" comment="about this assertion" error="error message"/>
</unittest>
<unittest id="452273BC-712F-4EBD-B791-0AF2BD77401D" name="My test" planned="4" ran="4" failed="0">
<test pass="1" comment="about this assertion" error="error message"/>
<test pass="1" comment="about this assertion" error="error message"/>
</unittest>
</unittests>
</response>
</pre>
<p><h1 id="customer-user-create">customer.user.create</h1></p>
<p> Register a new user. The secret you pass should be the md5hex of the new user's password. This is no more secure than sending the plain text of the password, of course, so try to do this method over https if you care about security.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">username </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the requested login </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">secret </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the secret for the new user </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">group_ids </td><td style="text-align:center;"> text </td><td style="text-align:center;"> group_ids of groups to register the user into </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00">
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
</user>
</response>
</pre>
<p><h1 id="customer-user-delete">customer.user.delete</h1></p>
<p> Delete a user. Any objects they own will not be deleted.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">user_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the user you want to delete </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response></response>
</pre>
<p><h1 id="customer-user-retrieve">customer.user.retrieve</h1></p>
<p> Return the details for a particular user, including their group membership.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">user_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the user you want details for </td><td style="text-align:right;"> required</td></tr></table>
<h2> response </h2>
<pre>
<response>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00">
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
</user>
</response>
</pre>
<p><h1 id="customer-user-search">customer.user.search</h1></p>
<p> Returns a list of users for a realm. If the 'want_groups' argument is '1', then the user information returned will include XML describing each of the groups those users are in, otherwise only the users will be returned.</p>
<p> This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> The page number (defaults to 1) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">per_page </td><td style="text-align:center;"> text </td><td style="text-align:center;"> Number of entries per page </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">want_groups </td><td style="text-align:center;"> text </td><td style="text-align:center;"> whether to include group memberships </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<resultset pages="4" page="1" per_page="2">
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00">
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
</user>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00">
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
</user>
</resultset>
</response>
</pre>
<p><h1 id="customer-user-update">customer.user.update</h1></p>
<p> Update a user's details. This includes changing the groups that a user is in.</p>
<p> This method takes an implicit and required session_id parameter.</p>
<h2> arguments </h2>
<table><tr><td style="text-align:left;">name </td><td style="text-align:center;"> type </td><td style="text-align:center;"> description </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">realm_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the target realm </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">user_id </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the id of the user you want to update </td><td style="text-align:right;"> required</td></tr>
<tr><td style="text-align:left;">username </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new requested login </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">secret </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new secret (md5hex hash of the user's password) </td><td style="text-align:right;"> optional</td></tr>
<tr><td style="text-align:left;">group_ids </td><td style="text-align:center;"> text </td><td style="text-align:center;"> the new groups for the user </td><td style="text-align:right;"> optional</td></tr></table>
<h2> response </h2>
<pre>
<response>
<user id="2471880F-8B7C-428B-8590-343D00484096" username="foo" created="2005-01-34T12:00" last_login="2005-01-34T12:00">
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
<group id="8361EF97-3DBC-44DE-A33B-F6E99C3EFE7A" name="foo"/>
</user>
</response>
</pre>2007-03-16T16:38:08.005+00:00undefinedZimkiClientLibraries
https://docs.zimki.com/ZimkiClientLibraries
<h1>Supported Zimki Client Libraries</h1>
<ul>
<li class="u"><a href="Zimki.NET">Zimki Client library for .NET and mono</a></li></ul>
<h1>Coming soon</h1>
<p>Zimki Client libraries for:</p><ul>
<li class="u">JavaScript</li>
<li class="u">Java</li></ul>2007-03-16T16:28:01.299+00:00undefinedzimki.publishPath
https://docs.zimki.com/zimki.publishPath
<p>The 'publishPath' method attaches a function to a URL. It can take either a regex or a string as the URL. In the case that a string is provided as the first parameter to 'publishPath' the handler function is called with one parameter, an Object containing the CGI parameters that the URL is been called with. When 'publishPath' is provided with regex the handler function is also passed the actual path called as its second parameter, and the return value of the regular expression match.</p>
<p>For example:</p>
<pre>
function helloWorld ( args ) {
return "Hello World";
}
function helloPath ( args, path, match ) {
return "Hello " + match[1];
}
zimki.publishPath( "/hello", helloWorld );
zimki.publishPath( /^hello_(.+)/, helloPath );
</pre>
<p>If a file object is published to the same path as a a JavaScript function (via the <a href="File.publish">File.publish</a> method) the File object takes <a href="misc.urlBindingPrecedence">priority</a>.</p>
<p>The return value from the function will be returned as the contents of the requested page. Return a string or E4X object to just return content. You can return an instance of a <a href="zimki.file">zimki.file</a> object to return the contents of that file as the contents of the page. Finally, if you want more control over the mime-type and character set of the returned data, return an Object:</p>
<pre>
zimki.publishPath('/complex', function() {
return {
content: "that page is not found",
mimetype: "text/plain",
charset: "iso-8859-1",
status: 404
};
});
</pre>
<p>zimki.publishPath can also publish a simple string to a path:</p>
<pre>
zimki.publishPath('/static', 'This string will be published');
</pre>2006-06-26T12:32:43.831+00:00undefinedCookBook.E4X
https://docs.zimki.com/CookBook.E4X
<h1> E4X: JavaScript for XML </h1>
<p>The Zimki JavaScript engine fully supports using E4X, meaning that
you can use XML as first class data types. This allows you to write things like this:</p>
<pre>
function hello() {
return <html>
<head>
<title>hello</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
}
zimki.publishPath('/', hello);
</pre>
<p>Notice that there's no quotes around that chunk of HTML (JavaScript doesn't have multi-line strings; we'll get to that in a bit), meaning that the 'hello' function is <em>not</em> returning a string of HTML but an XML object (which happens to be valid HTML). We then publish the return value to the path '/', but you might want to play around in the <strong>JavaScript Console</strong> and just evaluate the return value of the 'hello' function instead.
</p>
<h2> Autovivification for the lazy typist </h2>
<p>E4X allows you to do more interesting things than typing out multi-line blocks of XML though. For example, here's a different way to write the 'hello' function above:</p>
<pre>
function hello() {
var ret = <html/>;
ret.head.title = 'hello';
ret.body.h1 = 'Hello World';
return ret;
}
</pre>
<p>Not only does this involve less typing, it also involves less manual syntax checking; any autovivified nodes are automatically terminated properly so you don't have to worry about it.
</p>
<h2> Multiline strings </h2>
<p>One thing E4X allows you to do is to fake multi-line strings. You can do something like this, for example (copy and paste this into the <strong>JavaScript Console</strong> in the Zimki Portal):</p>
<pre>
'' + <text>
We come in peace;
lay down your weapons and take me to your leader.
And take that finger out of your nose when facing an officer.
</text>;
</pre>
<h2> Accessing attributes of an XML object </h2>
<p>We saw above how to access element values of an XML object: we simply access the attribute. However, XML can have attributes too, and using E4X you can access these values too. Let's say we have a table, like so:</p>
<pre>
var hiscore = <table>
<tr width="100%">
<th>Team</th>
<th>Score</th>
</tr>
<tr>
<td>Arsenal</td>
<td>10</td>
</tr>
</table>;
</pre>
<p>We find that the table is too wide, and want to resize it to take only 50% of the width. Additionally, we want the header row to be 50px high. We can do that by directly manipulating the hiscore object like so:</p>
<pre>
hiscore.tr.@width = '50%';
hiscore.tr.@height = '50px';
</pre>2006-07-24T08:21:14.141+00:00undefinedBilling Overview
https://docs.zimki.com/Billing Overview
<h1> What are the fees and when do I have to pay them? </h1>
<p>The following sets out how billing will work in zimki. We are currently refining our models according to average usage in order to make the service as attractive as possible to potential customers. During this interim period we will not be charging. We will make an announcement to all users confirming when charges will be introduced.</p>
<p>Zimki is a service aimed at making your life less complicated, and that goes for our billing system too. Zimki's charging agreement is based on a 'token per unit' billing structure; there are no set-up or upfront charges; you simply pay for usage. </p>
<p>Further information on the pricing structure can be located <a href="https://portal.zimki.com/common/chargeable_events.html">here</a></p>
<h2> Here is how it works </h2>
<p>In a nutshell, this is what we're going to charge for:
</p><ul>
<li class="u">JavaScript Operations <ul>
<li class="uu">Every request that you make to the Zimki service will consume JavaScript Operations. The number of operations consumed per request will be converted into tokens. </li></ul></li>
<li class="u">Storage <ul>
<li class="uu">This is calculated as the maximum amount of megabytes stored during a day. The storage space used will calculated each day and converted to tokens.</li></ul></li>
<li class="u">Bandwidth <ul>
<li class="uu">This is calculated as megabytes transferred. Each time data is transferred between one of your realms or a third party the total megabytes transferred will be converted to tokens.</li></ul></li>
<li class="u">Premium services <ul>
<li class="uu">There is an additional charge for certain services, such as sending email. This is levied on a per unit basis.</li></ul></li></ul>
<p>Pay only for what you use. There is no minimum fee, and no start-up cost. You simply purchase tokens in blocks of 100,000. You will be able to buy tokens in advance which can be used to consume your JavaScript Operations, Storage, Bandwidth and any Premium services used.</p>
<p>The tokens can be consumed by any realm that you have created. If you run out of tokens, you may have a 'grace period', which will take the form of a number of tokens that can be consumed over a certain number of days before you must purchase new tokens.
</p>
<h3> Question </h3>
<p>How do I find out how much my realms have cost in a month? I want to monitor my usage to see how many units of each service have been consumed.
</p>
<h3> Answer </h3>
<p>The Zimki server adds up the tokens consumed for each service and displays the cumulative total graphically. The total number of paid for tokens as well as the remaining balance is also displayed. You will also be able produce a report on each of your realms (domains).
</p>
<h2> Quotas and Limitations </h2>
<p>There are a few quotas and limitations that you need to be aware of, these include:
</p><ul>
<li class="u">The amount of operations you can request in JavaScript </li>
<li class="u">There is a limit to the storage available. </li>
<li class="u">A maximum of 50 domains/realms per customer
</li></ul>2006-08-21T16:10:12.630+00:00undefinedCookBook.StaticFiles
https://docs.zimki.com/CookBook.StaticFiles
<p>In addition to publishing JavaScript functions to paths, you can also publish static files to paths. To upload a file using the portal, go to the <strong>Files</strong> section under <strong>REALMS</strong> in the left-hand menu. Click <strong>Choose File</strong> and pick a file you want to upload, then click on the <strong>Upload new file</strong> button.</p>
<p>A new line will appear in the table under the upload form, with basic details about the file you just uploaded. Your realm now knows about your file, but it is not publicly visible anywhere yet. To do that, you have to publish it to a path.</p>
<p>To publish a file click on the word "No" in the <strong>Publications</strong> column of the file list table. Enter '/' in the textbox that appears and click <strong>Publish</strong>. If you now visit your realm, you should see the file that you uploaded; I chose to upload an image, but you're free to upload a text file, a small movie or anything else. </p>
<p>Go back to the <strong>Files</strong> view and see that our file now has "Yes" listed under publications. This means it has been published to at least one path. Click on the word "Yes" to view or change the file's publication paths.</p>
<p><strong>You can publish a file to multiple paths without uploading the file again, to avoid burning more of your storage quota than you really need to.</strong>
</p>
<h1> See also </h1>
<ul>
<li class="u"><a href="zimki.file">zimki.file</a> provides a javascript api for dealing with files (creation, search)</li>
<li class="u"><a href="File">File</a> provides operations on files (publication, deletion)
</li></ul>2006-07-19T10:13:52.305+00:00undefinedFile.contents
https://docs.zimki.com/File.contents
<p>See <a href="/File.content">the content method</a>.</p>2006-06-27T16:52:38.773+00:00undefinedFile.content
https://docs.zimki.com/File.content
<p>Gets and sets the contents of the file.</p>
<p>Example:
</p><pre>
var files = zimki.file.search();
var theFile = files[0];
var data = theFile.content();
</pre>2007-01-24T10:34:02.097+00:00undefinedzimki.log.warn
https://docs.zimki.com/zimki.log.warn
<p>Writes a line into the zimki log at the warn level.</p>
<p>For example:</p>
<p><code>zimki.log.warn("there is a good chance that something may be going wrong")</code></p>2006-06-26T12:27:40.526+00:00undefinedzimki.log.error
https://docs.zimki.com/zimki.log.error
<p>Writes a line into the zimki log at the error level.</p>
<p>For example:</p>
<p><code>zimki.log.error("its all going wrong!")</code></p>2006-06-26T12:27:59.752+00:00undefinedzimki.log.debug
https://docs.zimki.com/zimki.log.debug
<p>Writes a line into the zimki log at the debug level.</p>
<p>For example:</p>
<p><code>zimki.log.debug("isn't it nice that this information is logged")</code></p>2006-06-26T12:27:07.664+00:00undefinedZimki Class
https://docs.zimki.com/Zimki Class
<p>Instances of Zimki classes are persistable in the <a href="http://service.zimki.com/user/documentation/">Zimki</a> object store. These classes have names, and top-level objects are created in your JavaScript context for each class. These object will have methods defined on them to allow you to create, delete and search for instances of these classes. For instance, suppose that I have used the portal to create a new persistable class called MyClass. I can <a href="Zimki%20Class.create">create an instance</a> in JavaScript space, then change it's properties, and <a href="Zimki%20Class.save">save it</a>:</p>
<pre>
var instance = MyClass.create();
instance.my_name = "Rapunzel";
instance.save();
</pre>
<p>Likewise, there are calls to <a href="Zimki%20Class.search">search for instances</a>:</p>
<pre>
// search for all instances called 'Rapunzel':
var results = MyClass.search({ my_name:'Rapunzel' });
// get the first one
var first = results[0];
</pre>
<p>You can also <a href="Zimki%20Class.get">retrieve an instance directly by it's ID</a>:</p>
<pre>
var rapunzel = MyClass.get( first.id );
</pre>
<p>And you can use the search terms in the <a href="Zimki%20Class.get">get call</a>:</p>
<pre>
// get the first instance called Rapunzel
var rapunzel = MyClass.get({ my_name:'Rapunzel' });
</pre>
<p>To <a href="Zimki%20Class.deleteInstance">delete a class</a>:</p>
<pre>
// delete poor old Rapunzel
rapunzel.deleteInstance();
</pre>
<p>New persistable classes can be created by using <a href="zimki.persist">zimki.persist</a>.</p>
<pre>
zimki.persist.create("AnotherClass");
var anotherInstance = AnotherClass.create();
</pre>
<p>Calls to <a href="zimki.persist.create">zimki.persist.create</a> will fail if the class already exists.
</p>2006-06-27T16:54:24.615+00:00undefined