Staff
Permissions
Permission to view, create, edit and delete staff members is governed by the group a staff member is a part of.
cb_createStaff
Create a new staff member and return the ID of the newly created staff member. If no password is set, one with be generated automatically.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| string | $first_name | A staff member's first name |
| string | $last_name | A staff member's last name |
| string | A valid email address that does not already exist in the Clientbill database | |
| string | $password | A password for the new account. If left blank a password will automatically be generated. |
| boolean | $send_email | If set to true, sends an account created email to the staff member |
| array | $info | optional; An associative array of additional information that can be filled in during the staff member creation process.
The valid labels for this array are:
[string] country
[string] address1 [string] address2 [string] city [string] state [string] postal_code [string] title [string] office_phone [string] mobile_phone [string] home_phone [string] fax [string] im_name [string] im_type [string] notes [int] group_id [float] hourly_date |
Response
cb_editStaff
Edit a staff member account using a given staff_id. Any value specified in cb_createStaff, except password, can be used to update the staff member's information.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $staff_id | The staff_id of the account information to be updated |
| array | $updated_values |
An associative array of fields to update. All valid labels to use in this array are:
[string] first_name
[string] last_name [string] email [string] country [string] address1 [string] address2 [string] city [string] state [string] postal_code [string] title [string] office_phone [string] mobile_phone [string] home_phone [string] fax [string] im_name [string] im_type [string] notes [int] group_id [float] hourly_rate |
Response
cb_deleteStaff
Delete a staff account using the given staff_id. Invalid staff IDs will be ignored.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $staff_id | The staff_id of the account information to be updated |
Response
cb_getStaffMember
Retrieve account information for a single staff member using a givent staff_id.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $staff_id | The staff_id of the account information to be updated |
Response
(
[user_id] => 1
[create_date] => 5/1/2008 12:45PM
[last_login] => 7/2/2008 9:33AM
[first_name] => John
[last_name] => Administrator
[email] => johnadmin@email.com
[password] => john_admin_pass
[country] => United States
[address1] => 102 Doe Avenue
[address2] => Apartment #1
[city] => New York
[state] => New York
[postal_code] => 10004
[title] => Administrator
[office_phone] => 555-555-5545
[mobile_phone] => 555-555-5546
[home_phone] => 555-555-5547
[fax] => 555-555-5548
[im_name] => JohnAdmin
[im_type] => MSN
[notes] => Staff member notes
[group_id] => 2
[hourly_rate] => 0
)
cb_getStaffMembers
Return an ordered list of staff data. Each entry in the list will be an array similar to the one returned by cb_getStaffMember().
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| string | $sort_column | The column to sort the return staff members list on. This can be any field specified in the cb_createStaff or cb_editStaff functions. |
Response
[0] => Array(
[user_id] => 1
[create_date] => 5/1/2008 12:45PM
[last_login] => 7/2/2008 9:33AM
[first_name] => John
[last_name] => Administrator
[email] => johnadmin@email.com
[password] => john_admin_pass
[country] => United States
[address1] => 102 Doe Avenue
[address2] => Apartment #1
[city] => New York
[state] => New York
[postal_code] => 10004
[title] => Administrator
[office_phone] => 555-555-5545
[mobile_phone] => 555-555-5546
[home_phone] => 555-555-5547
[fax] => 555-555-5548
[im_name] => JohnAdmin
[im_type] => MSN
[notes] => Staff member notes
[group_id] => 2
[hourly_rate] => 0
),
[1] => Array(
[user_id] => 2
[create_date] => 5/2/2008 1:00PM
[last_login] => 7/1/2008 5:36PM
[first_name] => Jane
[last_name] => Support
[email] => janesupport@email.com
[password] => jane_support_pass
[country] => United States
[address1] => 102 Doe Avenue
[address2] => Apartment #2
[city] => New York
[state] => New York
[postal_code] => 10004
[title] => Support
[office_phone] => 555-555-5535
[mobile_phone] => 555-555-5536
[home_phone] => 555-555-5537
[fax] => 555-555-5538
[im_name] => JaneAdmin
[im_type] => MSN
[notes] => Staff member notes
[group_id] => 3
[hourly_rate] => 10.00
)
)
cb_exportStaffCSV
Return account information for all staff members in a comma separated format. Entries in the returned string are separated by a newline character.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $limit | optional; Limit the number of results that are returned. |
| int | $offset | optional; By default Clientbill will start with staff_id = 1. This paramater allows a different starting staff_id to be used. |
Response
cb_exportStaffXML
Return account information for all staff members in XML format.
Request
| string | $auth_string | Your authentication token returned from cb_setAuthCredentials() |
| int | $limit | optional; Limit the number of results that are returned. |
| int | $offset | optional; By default Clientbill will start with staff_id = 1. This paramater allows a different starting staff_id to be used. |
Response
<cbExportData>
<staff>
<user_id>1</user_id>
<create_date>5/1/2008 12:45PM</create_date>
<last_login>7/2/2008 9:33AM</last_login>
<first_name>John</first_name>
<last_name>Administrator</last_name>
<email>johnadmin@email.com</email>
<password>john_admin_pass</password>
<country>United States</country>
<address1>102 Doe Avenue</address1>
<address2>Apartment #1</address2>
<city>New York</city>
<state>New York</state>
<postal_code>10004</postal_code>
<title>Administrator</title>
<office_phone>555-555-5545</office_phone>
<mobile_phone>555-555-5546</mobile_phone>
<home_phone>555-555-5547</home_phone>
<fax>555-555-5548</fax>
<im_name>JohnAdmin</im_name>
<im_type>MSN</im_type>
<notes>Staff member notes</notes>
<group_id>2</group_id>
<hourly_rate>0</hourly_rate>
</staff>
<staff>
<user_id>2</user_id>
<create_date>5/2/2008 1:00PM</create_date>
<last_login>7/1/2008 5:36PM</last_login>
<first_name>Jane</first_name>
<last_name>Support</last_name>
<email>janesupport@email.com</email>
<password>jane_support_pass</password>
<country>United States</country>
<address1>102 Doe Avenue</address1>
<address2>Apartment #2</address2>
<city>New York</city>
<state>New York</state>
<postal_code>10004</postal_code>
<title>Support</title>
<office_phone>555-555-5535</office_phone>
<mobile_phone>555-555-5536</mobile_phone>
<home_phone>555-555-5537</home_phone>
<fax>555-555-5538</fax>
<im_name>JaneAdmin</im_name>
<im_type>MSN</im_type>
<notes>Staff member notes</notes>
<group_id>3</group_id>
<hourly_rate>10.00</hourly_rate>
</staff>
</cbExportData>