webBooks-System Configuration-APIs

From Cliquesoft
Jump to: navigation, search

System Configuration

In order to process any of these API's, all requests should be directed to the 'modules/webbooks/system_configuration.php' file. The type of request will be specified per section below.


Load the interface

To load the modules default HTML interface (themes/default/webbooks.system_configuration.html), the below parameters should be passed to the appropriate php file via a GET request. Loading an alternative screen relies on the symlinks set in the users data directory (e.g. data/_guest/_theme/{images|layout|styles}).

action=init
target=screen
username=(the username for the account)
SID=(the security identifier for the account)

This will return the raw contents as it is found in the file, replacing all occurrences of the variable ${UN} anywhere.


Populate the form

To populate all the various values of the interface form objects, the below parameters will need to be passed via a GET request:

action=init
target=values
username=(the username for the account)
SID=(the security identifier for the account)

This will return all the information in the following XML layout:

   <general>
      <admin id="INTEGER" name="STRING" type="{provider|vendor|employee}" email="STRING" phone="INTEGER" ext="INTEGER" mobile="INTEGER" sms="{0|1}" mail="{0|1}" />
      <system socialURI="STRING" [accessURI="STRING" logins="INTEGER" support="STRING" balance="DECIMAL" prefix="STRING"] />
      <module update="STRING" install="STRING" />
      <dirs data="STRING" logs="STRING" cron="STRING" temp="STRING" />
      <update module="STRING" />

      ...repeated for each update available...
   </general>
   <people>
      <person id="INTEGER" name="STRING" />

      ...repeated for each account that can become the administrator...
   </people>
   <groups>
      <group id="INTEGER" name="STRING" icon="STRING">
         <module id="INTEGER" name="STRING" icon="STRING" />

         ...repeated for each module associated with the group...
      </group>

      ...repeated for each defined group...
      <installed id="INTEGER" name="STRING" icon="STRING" />

      ...repeated for each installed module...
   </groups>

NOTE: The <system> tag has only one mandatory value (socialURI) when the software is not working in a HOSTED mode, otherwise all the other values will be returned as well.


Save the configuration

To save all the various values of the interface form objects, the below parameters will need to be passed via a POST request:

action=save
target=system
username=(the username for the account)
SID=(the security identifier for the account)
decrypt=(the decryption string for the account)

This will return all the information in the following XML layout:

   <s><msg>The system configuration has been updated successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Load the admin accounts

To load all the associated accounts based on the admin type, the below parameters will need to be passed via a GET request:

action=load
target=admins
username=(the username for the account)
SID=(the security identifier for the account)
type={employee|provider|vendor}

This will return all the information in the following XML layout:

   <admins>
      <admin id="INTEGER" name="STRING" />

      ...repeated for each account...
   </admins>


Load the admin information

To load all the information associated with the selected admin account, the below parameters will need to be passed via a GET request:

action=load
target=admin
username=(the username for the account)
SID=(the security identifier for the account)
type={employee|provider|vendor}
id=(the ID of the admin account)

This will return all the information in the following XML layout:

   <admins>
      <admin id="INTEGER" name="STRING" type="{employee|provider|vendor}" email="STRING" phone="INTEGER" ext="INTEGER" mobile="INTEGER" sms="{0|1}" mail="{0|1}" />
   </admins>


Check for updates

To check for updates to the software, the below parameters will need to be passed via a GET request:

action=check
target=updates
username=(the username for the account)
SID=(the security identifier for the account)
decrypt=(the decryption string for the account)

This will return all the information in the following XML layout:

   <update module="STRING" />
   ...repeated for each update found...


Install updates

To install downloaded updates for the software, the below parameters will need to be passed via a POST request:

action=install
target=updates
username=(the username for the account)
SID=(the security identifier for the account)
decrypt=(the decryption string for the account)
nUpdatesList_SystemConfiguration=(the list of updates to install)

This will return all the information in the following XML layout:

   <update module="STRING" />
   ...repeated for each update that was successfully installed...


Load the group

To load all the modules associated with the selected group, the below parameters will need to be passed via a GET request:

action=load
target=group
username=(the username for the account)
SID=(the security identifier for the account)
groupID=(the ID of the group)

This will return all the information in the following XML layout:

   <groups>
      <group id="INTEGER" name="STRING" icon="STRING">
         <module id="INTEGER" name="STRING" icon="STRING" />

         ...repeated for each module associated with the group...
      </group>
   </groups>


Create a group

To create a new group on the dashboard, the below parameters will need to be passed via a GET request:

action=new
target=group
username=(the username for the account)
SID=(the security identifier for the account)
name=(the name of the new group)
icon=(the name of the icon associated with the new group)

This will return all the information in the following XML layout:

   <s><msg>The group has been created successfully!</msg><data id="INTEGER"></data></s>

   OR

   <f><msg>...</msg></f>


Delete a group

To delete an existing group from the dashboard, the below parameters will need to be passed via a GET request:

action=delete
target=group
username=(the username for the account)
SID=(the security identifier for the account)
groupID=(the ID of the existing group to delete)

This will return all the information in the following XML layout:

   <s><msg>The group has been deleted successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Update a group

To update an existing group on the dashboard, the below parameters will need to be passed via a GET request:

action=update
target=group
username=(the username for the account)
SID=(the security identifier for the account)
groupID=(the ID of the existing group to delete)
name=(the new name of the existing group)
icon=(the new name of the icon associated with the existing group)

This will return all the information in the following XML layout:

   <s><msg>The group has been updated successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Add a module to a group

To add a module to an existing group, the below parameters will need to be passed via a GET request:

action=add
target=module
username=(the username for the account)
SID=(the security identifier for the account)
groupID=(the ID of the existing group to add to)
moduleID=(the ID of an installed module to add)

This will return all the information in the following XML layout:

   <s><msg>The module has been added to the group successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Delete a module from a group

To delete a module from an existing group, the below parameters will need to be passed via a GET request:

action=delete
target=module
username=(the username for the account)
SID=(the security identifier for the account)
groupID=(the ID of the group to remove the module from)
moduleID=(the ID of the module to delete)

This will return all the information in the following XML layout:

   <s><msg>The module has been deleted from the group successfully!</msg></s>

   OR

   <f><msg>...</msg></f>