Go to Demo page
Include this script, and a recent jQuery.

"Corpo Accounts Management" Javascript API:

When corporate accounts are managed by a third party application, the corpo accounts management API can be used to create/modify/delete accounts and to define profiles by allocation to Group Entities.
Each Enterprise's super admin can still manually create accounts and profiles but the API will overwritte them when applied.
SparkomCorpoAccountApi.setCorpo(corpoId, apiKey)
It is Mandatory to invoke this method prior to any other API method.
It sets global parameters used for all other methods.
SparkomCorpoAccountApi.createAccount(emailLogin, password, displayName, profileSpec, callback)
Creates a new Corpo Account. All parameters are mandatory.
The profileSpec is a list of Entity Group Names, separated by spaces.

The callback function is invoked asynchronously with a single argument "data", that contains the following fields:
- "ret": Numeric Return code, 0=0K.
- "msg": "OK" or an error message.
SparkomCorpoAccountApi.updateAccount(emailLogin, password, displayName, profileSpec, callback)
Updates an existing Corpo Account. The "emailLogin" parameter is mandatory.
The password, displayName and/or profileSpec fields will be updated IF THE GIVEN VALUE IS NOT null or "".
The profileSpec is a list of Entity Group Names, separated by spaces. It fully replaces the previously set one.

The callback function is invoked asynchronously with a single argument "data", that contains the following fields:
- "ret": Numeric Return code, 0=0K.
- "msg": "OK" or an error message.
SparkomCorpoAccountApi.deleteAccount(emailLogin, callback)
Deletes an existing Corpo Account. The "emailLogin" parameter is mandatory.

The callback function is invoked asynchronously with a single argument "data", that contains the following fields:
- "ret": Numeric Return code, 0=0K.
- "msg": "OK" or an error message.
SparkomCorpoAccountApi.auditAccount(emailLogin, password, displayName, profileSpec, callback)
Audit an existing Corpo Account. The "emailLogin" parameter is mandatory.
The password, displayName and/or profileSpec fields will be verified IF THE GIVEN VALUE IS NOT null or "".
If the specified account exists, and if the given value(s) match the ones stored on the Server, OK will be returned.

The callback function is invoked asynchronously with a single argument "data", that contains the following fields:
- "ret": Numeric Return code, 0=0K.
- "msg": "OK" or an error message.
SparkomCorpoAccountApi.retrieveAllGroups(callback)
Retrieves all Defined "Corpo Entities Groups".

The callback function is invoked asynchronously with a single argument "data", that contains the following fields:
- "ret": Numeric Return code, 0=0K.
- "msg": "OK" or an error message.
- "groups": An Array of Entities Group Names.
SparkomCorpoAccountApi.listGroupMembers(group, firstResult, maxResults, callback)
Retrieves the Helper Accounts associated with an "Entity Group Name". The "group" parameter is mandatory, it is the name of the Entity Group.
The firstResult and maxResults parameters are optional, and taken into account only if not null and not 0.
The Accounts are ordered by EmailLogin. Within the available accounts, the ones between the (firstResult+1)-th and the (firstResult + maxResults)-th, inclusive, are returned. 0 = First Account.
If maxResults=0, there is no limit to the number of returned Accounts.

The callback function is invoked asynchronously with a single argument "data", that contains the following fields:
- "ret": Numeric Return code, 0=0K.
- "msg": "OK" or an error message.
- "numaccounts": Total Numeric count of Accounts associated with this Group.
- "accounts": Array of returned accounts, each is an Object with the fields:
  - "eml": The EmailLogin of the Account
  - "dname": The DisplayName of the Account