Difference between revisions of "webBooks-Employees-APIs"

From Cliquesoft
Jump to: navigation, search
(Created page with "==Employees== In order to process any of these API's, all requests should be directed to the 'modules/webbooks/employees.php' file. The type of request will be specified per sec...")
(No difference)

Revision as of 12:55, 26 March 2015

Employees

In order to process any of these API's, all requests should be directed to the 'modules/webbooks/employees.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.employees.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)
decrypt=(the decryption string for the account)

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

   <general>
      <employee id="INTEGER" name="STRING" OPoID="STRING" homePhone="INTEGER" homeMobile="INTEGER" homeMobileSMS="{0|1}" homeMobileEmail="{0|1}" homeEmail="STRING" workPhone="INTEGER" workExt="INTEGER" workMobile="INTEGER" workMobileSMS="{0|1}" workMobileEmail="{0|1}" workEmail="STRING" location="INTEGER" department="INTEGER" supervisor="INTEGER" position="INTEGER" payTerms="{part-time|full-time|contractor|call|internship|volunteer}" payType="{hourly|salary|salary+ot|commission|commission+base|job}" basePay="DECIMAL" OTRate="DECIMAL" PTORate="DECIMAL" SickRate="DECIMAL" payCOLA="DECIMAL" payMileage="DECIMAL" payPerDiem="DECIMAL" hired="DATE" driversLicense="STRING" gender="{male|female}" ssn="INTEGER" dob="DATE" race="{african|asian|caucasian|hispanic|indian|me|na|mr|pi|other}" married="{single|married}" withholdings="DECIMAL" additional="INTEGER" dependents="INTEGER" manager="{0|1}" status="{verifying|active|locked|suspended}" attempts="INTEGER" username="STRING" created="EPOCH" updated="EPOCH" login="EPOCH" logout="EPOCH" />
      <address type="home" addr1="STRING" addr2="STRING" city="STRING" state="STRING" zip="STRING" country="STRING" />
      <address type="work" addr1="STRING" addr2="STRING" city="STRING" state="STRING" zip="STRING" country="STRING" />
      <payments PPPAP="DECIMAL" YTDAP="DECIMAL" PPPAC="DECIMAL" YTDAC="DECIMAL" PPPPR="DECIMAL" YTDPR="DECIMAL" />
      <leave PPPAP="DECIMAL" YTDAP="DECIMAL" PPPUP="DECIMAL" YTDUP="DECIMAL" PPPAS="DECIMAL" YTDAS="DECIMAL" PPPUS="DECIMAL" YTDUS="DECIMAL" />
      <donated PPPDP="DECIMAL" YTDDP="DECIMAL" PPPDS="DECIMAL" YTDDS="DECIMAL" />
   </general>
   <locations>
      <location id="INTEGER" name="STRING" />

      ...repeated for each additional location of the organization...
   </locations>
   <departments>
      <dept id="INTEGER" name="STRING" />

      ...repeated for each department created for the organization...
   </departments>
   <supervisors>
      <supervisor id="INTEGER" name="STRING" />

      ...repeated for each employee of the organization that can become someone else's supervisor...
   </supervisors>
   <positions>
      <pos id="INTEGER" name="STRING" />

      ...repeated for each position created for the organization...
   </positions>
   <people>
      <person id="INTEGER" name="STRING" />

      ...repeated for each employee that can have time donated to...
   </people>
   <modules>
      <module id="INTEGER" name="STRING" />

      ...repeated for each module that is currently installed...
   </modules>
   <looks>
      <look skin="STRING" theme="STRING" icons="STRING" />
      <skin>STRING</skin>

      ...repeated for each installed skin...
      <theme>STRING</theme>

      ...repeated for each installed theme...
      <image>STRING</image>

      ...repeated for each install image set...
   </looks>
   <time>
      <record id="INTEGER" type="{in|out|pto|sick|unpaid}" occurred="EPOCH" createdID="INTEGER" createdBy="STRING" />

      ...repeated for each time record for the employee...
   </time>
   <notes>
      <note id="INTEGER" type="{employee|customer|wo}" creator="STRING" created="EPOCH" updated="EPOCH">STRING</note>

      ...repeated for each note associated with the employee...
   </notes>
   <data>
      <entry id="INTEGER" title="STRING" filename="STRING" />
      ...repeated for each custom data field on the 'Data' tab...

      <file filename="STRING" />
      ...repeated for each file uploaded through the 'Data' tab...
   </data>

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>