zimki | documentation | search
 
Zimki Documentation - CustomerExternalAPI

customer.apikey.create
customer.apikey.update
customer.billing.chargesByDay
customer.billing.chargesByHour
customer.billing.pendingPurchases
customer.billing.purchases
customer.class.create
customer.class.delete
customer.class.search
customer.class.update
customer.file.create
customer.file.delete
customer.file.publish
customer.file.search
customer.file.unpublish
customer.file.update
customer.group.create
customer.group.delete
customer.group.retrieve
customer.group.search
customer.group.update
customer.instance.create
customer.instance.delete
customer.instance.deleteAttributes
customer.instance.deleteWhere
customer.instance.retrieve
customer.instance.search
customer.instance.update
customer.javascript.run
customer.realm.copy
customer.realm.create
customer.realm.delete
customer.realm.restore
customer.realm.retrieve
customer.realm.search
customer.realm.update
customer.session.create
customer.session.login
customer.unittest.run
customer.unittest.runAll
customer.user.create
customer.user.delete
customer.user.retrieve
customer.user.search
customer.user.update

customer.apikey.create

Create a new API key in a realm.

The api key alias must be unique across the whole of Zimki.

This method takes an implicit and required session_id parameter.

Returns XML describing the new api key

arguments

name type description required
realm_id text The realm to create the key for required
name text A name for the api key optional
alias text The alias for the new api key. optional

response

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

customer.apikey.update

Update an existing api key in a realm.

The api key alias must be unique across the whole of Zimki.

A revoked api key can't be used to access your realm, but does maintain it's alias, effectively reserving it.

This method takes an implicit and required session_id parameter.

Returns XML describing the new api key

arguments

name type description required
api_key text The API key. required
name text change the name to something else optional
revoked text revoke the key\? optional
alias text change the alias optional

response

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

customer.billing.chargesByDay

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.

If 'realm_id' is passed, billing data for only that realm will be returned, otherwise all realms' data will be returned.

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.

arguments

name type description required
realm_id text The realm to limit the report to optional
start text timestamp at the beginning of the period required
finish text timestamp at the end of the period required
min_count text Limit returned call data to only paths visited at least this many times optional
aggregate text Combine data from all realms into one 'day' node per day optional

response

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

customer.billing.chargesByHour

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.

If 'realm_id' is passed, billing data for only that realm will be returned, otherwise all realms' data will be returned.

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.

arguments

name type description required
start text timestamp at the beginning of the period required
finish text timestamp at the end of the period required
realm_id text The realm to limit the report to optional
min_count text Limit returned call data to only paths visited at least this many times optional
aggregate text Combine data from all realms into one 'hour' node per hour optional

response

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

customer.billing.pendingPurchases

returns a list of all purchases that have been asked for by the user, but have yet to be approved.

arguments

name type description required
start text timestamp at the beginning of the period required
finish text timestamp at the end of the period required

response

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

customer.billing.purchases

Returns a list of all token purchases made by the user that have been approved, between the passed times.

arguments

name type description required
start text timestamp at the beginning of the period required
finish text timestamp at the end of the period required

response

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

customer.class.create

Create a new class. All persisted object must be instances of a class.

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
name text the name of the new class required
permissions text the permissions for the new class required
instance_permissions text permissions to give to new instances of this class required
owner_id text The classes owner optional
group_id text The group the class will belong to optional

response

<response>
  <class name="classname" permissions="0xffffff" instance_permissions="0xffffff" owner_id="452273BC-712F-4EBD-B791-0AF2BD77401D" group_id="51108C86-6BCF-4187-A14D-53441DF5BA07"/>
</response>

customer.class.delete

Deletes a defined class. Will alse delete all instances of this class.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
name text the name of the class to delete required

response

<response></response>

customer.class.search

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.

This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
page text The page number (defaults to 1) optional
per_page text Number of entries per page optional
realm_id text The realm we're working in required
__other text Search args (e.g. name__startswith or name__notstartswith) required

response

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

customer.class.update

This method lets you change the permissions and instance_permissions of an existing class. Class names cannot be changed.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
name text the name of the class to update required
permissions text the new class permissions optional
instance_permissions text the new class instance permissions optional
owner_id text The new owner of the class optional
group_id text The group the class will belong to optional

response

<response>
  <class name="classname" permissions="0xffffff" instance_permissions="0xffffff" owner_id="452273BC-712F-4EBD-B791-0AF2BD77401D" group_id="51108C86-6BCF-4187-A14D-53441DF5BA07"/>
</response>

customer.file.create

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.

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
file text The file to upload, as an HTTP upload required
realm_id text The realm that will own this file required
owner_id text the owner_id to give to the file optional
group_id text the group_id to give to the file optional
permissions text the permissions to give to the file optional
name text A human-readable text name for the file. Defaults to the upload filename. optional
mimetype text Set if you want to force the mimetype of the uploaded file to something in particular. Autodetected otherwise. optional
expires text When the file should expire, if at all. Use an ISO8601 datetime, or a string like '+1h' for 'in one hour' optional

response

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

customer.file.delete

Delete an uploaded file.

arguments

name type description required
realm_id text The realm owning these files required
file_id text the ID of the file to delete required

response

<response></response>

customer.file.publish

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 /foo.jpg will be something like

http://{alias}.realm.zimki.com/foo.jpg

arguments

name type description required
realm_id text The realm owning these files required
file_id text the id of the file to publish required
url text the relative url to publish to required

response

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

customer.file.search

Lists the files uploaded.

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

arguments

name type description required
page text The page number (defaults to 1) optional
per_page text Number of entries per page optional
realm_id text The realm owning these files required
glob text return only files published to a path that matches the given glob optional

response

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

customer.file.unpublish

Unpublish a file - it will no longer be available from the passed url, assuming it was to begin with.

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.

arguments

name type description required
realm_id text The realm owning these files required
file_id text the id of the file to unpublish. Can be left blank to just unpublish whetever is at the given url optional
url text the url of the publication you want to remove. Can be left blank to unpublish all urls of the given file. optional

response

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

customer.file.update

Change the name, group, owner or permissions of an already-uploaded file.

arguments

name type description required
realm_id text The realm owning these files required
file_id text the id of the file to update required
owner_id text the new owner_id of the file optional
group_id text the new group_id of the file optional
permissions text the new permissions for the file optional
name text the new name for the file optional
mimetype text the new mime type for the file optional
expires text the new expires time of the file optional

response

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

customer.group.create

Create a group.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text the target realm required
name text the requested groupname required

response

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

customer.group.delete

Delete a group.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text the target realm required
group_id text The ID of the group to delete required

response

<response></response>

customer.group.retrieve

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text the target realm required
group_id text the group id required
want_users text do we want the full userlist returned\? optional

response

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

customer.group.search

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.

This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the realm to search in required
page text The page number (defaults to 1) optional
per_page text Number of entries per page optional
want_users text return user information as well optional

response

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

customer.group.update

Update the details of a group.

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text the target realm required
group_id text the group id required
name text new name optional
want_users text do we want the full userlist returned\? optional
user_ids text new list of users optional

response

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

customer.instance.create

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.

Any arguments provided to the method beyond those listed below are used as the initial state of the object's attributes.

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
class text the name of the class you are creating an instance of required
__other text The initial state of the created object optional

response

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

customer.instance.delete

Delete an instance of a class

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
class text the class of the instance you want to delete required
instance_id text the ID of the instance you wish to delete required

response

<response></response>

customer.instance.deleteAttributes

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.

arguments

name type description required
realm_id text The realm we're working in required
class text the class of the instance you want to change required
instance_id text the ID of the instance you wish to change required
delete text the attributes to delete required

response

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

customer.instance.deleteWhere

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
class text required
__other text required

response

<response>
  <deleted>3</deleted>
</response>

customer.instance.retrieve

Returns the instance of the given class and ID, as XML.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
class text the class of the instance you want the details of required
instance_id text the ID of the instance you want the details of required

response

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

customer.instance.search

Find instances of a class. Arguments to this method beyond those listed below are interpreted as searches on the attributes of the persisted objects.

See the docs for the JavaScript persist method 'search' for documentation on the search parameter format.

This method takes implicit and required api_key and session_id parameters.

This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.

arguments

name type description required
realm_id text The realm we're working in required
class text required
page text The page number (defaults to 1) optional
per_page text Number of entries per page optional
__other text search terms required

response

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

customer.instance.update

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.

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.

This method takes implicit and required api_key and session_id parameters.

arguments

name type description required
realm_id text The realm we're working in required
class text the class of the instance you want to change required
instance_id text the ID of the instance you wish to change required
__other text required

response

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

customer.javascript.run

run some arbitrary JS code in the context. Useful for creating classes, doing initial setup, etc

Returns the result returned from the JavaScript call, formatted as JSON.

arguments

name type description required
realm_id text The realm we're working in required
code text the code to evaluate required

response

<response>
  <return>the return value of the code</return>
</response>

customer.realm.copy

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.

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.

As a special case, if none of the optional arguments classes, files, or all_classes are specified all files, users, classes and instances will be copied.

This method takes an implicit and required session_id parameter.

Returns XML describing the target realm.

arguments

name type description required
source_realm_id text the realm to be copyd required
target_realm_id text the realm to copy to - if omitted, a new realm will be created optional
target_name text The name to use for the target realm. If not specified, will keep the existing. optional
all_classes text copy all classes, instead of just those listed optional
classes text list of classes to copy optional
files text 1 if we should copy files\; 0 (the default) otherwise optional

response

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

customer.realm.create

Create a new realm. You are limited to a maximum of 50 realms per account.

This method takes an implicit and required session_id parameter.

Returns XML describing the new realm.

arguments

name type description required
name text the name of the realm optional
public text whether the realm should be public (cloneable) or not (default 0) optional
copy_id text copy an existing realm with this ID (must be either marked public, or owned by the currently logged-in customer. optional

response

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

customer.realm.delete

Delete a realm. This can't be undone - the realm and all the data in it will be removed.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the id of the realm to delete required

response

<response></response>

customer.realm.restore

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.

The file parameter should be a HTTP POST form upload of a previously-downloaded backup zipfile.

This method takes an implicit and required session_id parameter.

arguments

name type description required
name text the name of the realm, if one is created. optional
realm_id text the ID of the target realm, if you want to restore into an existing realm. optional
file text a backup containing the realm to restore required

response

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

customer.realm.retrieve

Retrieves information associated with a realm. This call just returns data about a realm - it changes nothing.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the id of the realm required

response

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

customer.realm.search

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.

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.

This method takes an implicit and required session_id parameter.

arguments

name type description required
page text The page number optional
per_page text Number of entries per page optional
deleted text If true, return deleted realms as well optional
name text optional

response

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

customer.realm.update

Update information about a realm.

This method takes an implicit and required session_id parameter.

Returns XML describing the updated realm.

arguments

name type description required
realm_id text the realm's id required
name text the name of the realm optional
public text whether the argument should be public or not optional

response

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

customer.session.create

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.

arguments

name type description required

response

<response>
  <session id="12345">
    <salt>12345678</salt>
    <expires>2005-10-05 16:02:38Z</expires>
  </session>
</response>

customer.session.login

Authenticates a customer session. This method requires a hash of the customer password and the session salt generated as follows:

hash = md5_hex(salt + md5_hex(password))

Where md5_hex is a function that returns an MD5 digest in hexidecimal form.

arguments

name type description required
username text customer username (email address) required
hash text password hash as described above required
session_id text an authenticated session id required

response

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

customer.unittest.run

run the unit test with the given id

arguments

name type description required
realm_id text The realm we're working in required
test_id text the id of the test to run required

response

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

customer.unittest.runAll

run all unit tests in the current realm

arguments

name type description required
realm_id text The domain we're working in required

response

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

customer.user.create

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.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the target realm required
username text the requested login required
secret text the secret for the new user required
group_ids text group_ids of groups to register the user into optional

response

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

customer.user.delete

Delete a user. Any objects they own will not be deleted.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the target realm required
user_id text the user you want to delete required

response

<response></response>

customer.user.retrieve

Return the details for a particular user, including their group membership.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the target realm required
user_id text the id of the user you want details for required

response

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

customer.user.search

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.

This call returned paged data. Use the 'per_page' and 'page' arguments to control the paging.

This method takes an implicit and required session_id parameter.

arguments

name type description required
page text The page number (defaults to 1) optional
per_page text Number of entries per page optional
realm_id text the target realm required
want_groups text whether to include group memberships optional

response

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

customer.user.update

Update a user's details. This includes changing the groups that a user is in.

This method takes an implicit and required session_id parameter.

arguments

name type description required
realm_id text the target realm required
user_id text the id of the user you want to update required
username text the new requested login optional
secret text the new secret (md5hex hash of the user's password) optional
group_ids text the new groups for the user optional

response

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