Revision as of 19:51, 27 February 2012 by
Philipc (Talk)
The Timecard SOAP API
The Timecard SOAP API is similar to the EService Soap API, in that it provides methods for retrieving, updating, and deleting data stored on the server.
The API is published separately at the moment, as another interface for linking into the Timecard server, although there is some progress on integrating the two products together in a future release.
The Interface Definition
Below is a summary of the important functions that make up the Timecard API (a full java doc style specification can be found here). Each function is called, passing in at least one parameter, a UserIDBean. This bean contains the user name and password of a previously registered Timecard User, with administrative rights. This ensures only authorised users are able to access the interface.
Timecard User Management Functions
Method |
Summary |
createUser |
Creates a new user based on the user data passed in. |
getUserDetail |
Gets all the details of a specified user. |
updateUser |
Updates a particular user with new details. |
updateUserPassword |
Updates a user's password. |
deleteUser |
Deletes an existing user. |
getUnsynchronisedUsers |
Retrieves all users who have not previously been synchronised and acknowledged, and all users that have changed since their last synchronisation. |
ackUserSynchronisation |
Acknowledges that synchronisation has been performed on the selected users. |
Timecard Field Device Management Functions
Timecard functions to Retrieve Raw Event Data
Methods to Retrieve Processed Data
Returns |
Method |
Parameters |
Description |
HourBreakdownBean |
getUserHoursSummary |
UserIDBean, UserPrimaryKey, start, end |
Gets the hourly breakdown for a single user. |
Array of HourBreakdownBean |
getHourSummaries |
UserIDBean, start, end |
Hourly breakdowns for all users in the given time period. |
Array of DetailedHourBreakdownBean |
getDetailedUserHourSummary |
UserIDBean, UserPrimaryKey, start, end, showUserTZFlag |
Gets the hourly breakdown, adhering to the IDI specification, for a single user. |
Array of DetailedHourBreakdownBean |
getDetailedHourSummaries |
UserIDBean, start, end, showUserTZFlag |
Hourly breakdowns, adhering to the IDI specification, for all users in the given time period. |
Array of Strings |
getUserTypes |
UserIDBean |
Returns array of UserType Names. |
Array of OverTimeRuleBean |
getOvertimeRulesBean |
UserIDBean |
Returns array of OverTimeRuleBean. |
Retrieving and updating Organisation Details
Various Maintenance Functions
Returns |
Method |
Parameters |
Description |
sendMessageToUserResult |
sendMessageToUser |
UserIDBean, userPrimaryKey, messageString |
Sends a string message to the specified user. |
wakeFieldDeviceResult |
wakeFieldDevice |
UserIDBean, userPrimaryKey |
Sends a message to the phone, which forces the application to start and connect to the server. |
createNewTeamResult |
createNewTeam |
UserIDBean, teamName, teamLeaderUserPrimaryKey |
Creates a new team with the specified user as the team leader. |
deleteTeamResult |
deleteTeam |
UserIDBean, teamName |
Deletes the specified team. Members of this team should be reallocated to existing teams. |
addUserToTeamResult |
addUserToTeam |
UserIDBean, teamName, userPrimaryKey |
Adds the specified user to the specified team. Note that each user can only belong to one team. |
removeUserFromTeamResult |
removeUserFromTeam |
UserIDBean, teamName, userPrimaryKey |
Removes the user from the team specified. |
sendMessageToTeamResult |
sendMessageToTeam |
UserIDBean, teamName, messageString |
Sends a string message to all users in the specified team. |
wakeTeamFieldDevicesResult |
wakeTeamFieldDevices |
UserIDBean, teamName |
Sends a message to all phone devices, which forces the application to start and connect to the server. |
Array of strings |
getTaskList |
UserIDBean |
Gets the tasks/customers list from the server. |
addNewTaskResult |
addNewTask |
UserIDBean, taskName |
Adds a new task/customer to the server list. |
removeTaskResult |
removeTask |
UserIDBean, taskName |
Remove task/customer from the server. |
addSubtaskToTask |
addSubtaskToTask |
UserIDBean, taskName, subTaskName |
Add a new subtask to an existing task in the server list. |
addSubtasksToTask |
addSubtasksToTask |
UserIDBean, taskName, subTaskNames |
Add new list of subtasks to an existing task in the server list. |
deleteSubtask |
deleteSubtask |
UserIDBean, taskName, subTaskName |
Remove subtask with the provided name from the task with the name provided from the server list. |
getSubtaskList |
getSubtaskList |
UserIDBean, taskName |
Get a list of subtasks for the task with the provided name from the server list. |
Main Data Type Definitions
EventBean
Name |
Type |
Size |
Required |
Description |
whenOccured |
Calendar |
N/A |
N/A |
The date and time at which a clock in, clock out, start break, end break start task or end task event occurred |
eventID |
String |
9 |
N/A |
Unique identifier for the event |
eventType |
Enumerated String |
9 |
N/A |
One of the following: CLOCK_IN, CLOCK_OUT, TASK_START, TASK_END, BREAK_START, BREAK_END. |
userName |
String |
25 |
N/A |
The name of the user who generated the event. |
deviceID |
String |
30 |
N/A |
Device ID of the user who generated the event (unique identifier for the device). |
userPK |
String |
9 |
N/A |
Unique identifier for the user. |
userType |
String |
50 |
N/A |
Describes the type of user. |
TaskEventBean extends EventBean
Name |
Type |
Size |
Required |
Description |
taskName |
String |
50 |
N/A |
The task name associated with the TASK_START or TASK_END event. |
HourBreakdownBean
Name |
Type |
Size |
Required |
Description |
userType |
String |
50 |
N/A |
Describes the type of user. |
userName |
String |
25 |
N/A |
The name of the user who generated the event. |
deviceID |
String |
30 |
N/A |
Device ID of the user who generated the event (unique identifier for the device). |
userName |
String |
25 |
N/A |
The name of the user who generated the event. |
normalHours |
Int |
0-24 |
N/A |
The hours component of a normal working day. |
normalMinutes |
Int |
0-59 |
N/A |
The minutes component of a normal working day. |
normalSeconds |
Int |
0-59 |
N/A |
The seconds component of a normal working day. |
overTimeHours |
Int |
0-24 |
N/A |
The hours component of overtime in excess of a normal working day. |
overTimeMinutes |
Int |
0-59 |
N/A |
The minutes component of overtime in excess of a normal working day. |
overTimeSeconds |
Int |
0-59 |
N/A |
The seconds component of overtime in excess of a normal working day. |
extraHours |
Int |
0-24 |
N/A |
The hours component of extra time in excess of overtime and the normal working day. |
extraMinutes |
Int |
0-59 |
N/A |
The minutes component of overtime in excess of overtime and the normal working day. |
extraSeconds |
Int |
0-59 |
N/A |
The seconds component of overtime in excess of overtime and the normal working day. |
DetailedHourBreakdownBean
Name |
Type |
Size |
Required |
Description |
userPrimaryKey |
String |
9 |
N/A |
User Primary Key in Timecard. |
userType |
String |
50 |
N/A |
Describes the type of user. |
userName |
String |
25 |
N/A |
The name of the user who generated the event. |
deviceID |
String |
30 |
N/A |
Device ID of the user who generated the event (unique identifier for the device). |
dateStart |
Date |
N/A |
N/A |
The date/time of the start event. |
dateEnd |
Date |
N/A |
N/A |
The date/time of the end event. |
timezone |
String |
25 |
N/A |
The timezone of the user who generated the event. |
startEvent |
String |
25 |
N/A |
The start event type. |
endEvent |
String |
25 |
N/A |
The end event type. |
teamName |
String |
50 |
No |
The team name that the user belongs to. |
taskName |
String |
50 |
No |
The task that the event belongs to. |
subtaskName |
String |
50 |
No |
The subtask that the event belongs to. |
normalHours |
Int |
0-24 |
N/A |
The hours component of a normal working day. |
normalMinutes |
Int |
0-59 |
N/A |
The minutes component of a normal working day. |
normalSeconds |
Int |
0-59 |
N/A |
The seconds component of a normal working day. |
overTimeHours |
Int |
0-24 |
N/A |
The hours component of overtime in excess of a normal working day. |
overTimeMinutes |
Int |
0-59 |
N/A |
The minutes component of overtime in excess of a normal working day. |
overTimeSeconds |
Int |
0-59 |
N/A |
The seconds component of overtime in excess of a normal working day. |
extraHours |
Int |
0-24 |
N/A |
The hours component of extra time in excess of overtime and the normal working day. |
extraMinutes |
Int |
0-59 |
N/A |
The minutes component of overtime in excess of overtime and the normal working day. |
extraSeconds |
Int |
0-59 |
N/A |
The seconds component of overtime in excess of overtime and the normal working day. |
customFields |
Array of CustomField |
N/A |
N/A |
The custom fields that are belong to this task. |
OverTimeRuleBean
Name |
Type |
Size |
Required |
Description |
userTypeAppliedTo |
String |
50 |
N/A |
User type this is applied to. |
startDate |
Calendar |
N/A |
N/A |
When the overtime rule starts |
endDate |
Calendar |
N/A |
N/A |
When the overtime rule ends. This may be null if there is no definite end date for the rule. |
includeBreakInTimeWorked |
boolean |
N/A |
N/A |
Defines if break time should be included in time worked calulations |
overTimeRule |
OverTimeBean |
N/A |
N/A |
Which overtime rule |
extraTimeRule |
OverTimeBean |
N/A |
N/A |
Which extratime rule |
OverTimeBean
Name |
Type |
Size |
Required |
Description |
applicable |
boolean |
N/A |
N/A |
Determines if this overtime information is applicable or not. |
hoursPerDay |
HoursPeriodBean |
N/A |
N/A |
Defines the limit of normal work per day (anything over this is considered as a form of overtime or extratime). |
hoursPerWeek |
HoursPeriodBean |
N/A |
N/A |
Defines the limit of normal work per week (anything over this is considered as a form of overtime or extratime). |
HoursPeriodBean
Name |
Type |
Size |
Required |
Description |
applicable |
boolean |
N/A |
N/A |
Determines if this hours period information is applicable or not. |
hours |
Int |
0-168 |
N/A |
Number of hours in this period. |
minutes |
Int |
0-59 |
N/A |
Numberof minutes in this period. |
OrganisationDetailsBean
Name |
Type |
Size |
Required |
Description |
name |
String |
25 |
N/A |
The name of the organisation. |
description |
String |
50 |
N/A |
The description of the organisation. |
accountNumber |
String |
25 |
N/A |
The account number of the organisation. |
contactName |
String |
30 |
N/A |
The name of the contact person for the organisation. |
contactWorkPhone |
String |
30 |
N/A |
The contact person's work number. |
contactMobilePhone |
String |
30 |
N/A |
The contact person's mobile number. |
contactEmailAddress |
String |
30 |
N/A |
The contact person's email address. |
address1 |
String |
200 |
N/A |
Address line 1 for the organisation (street address) |
address2 |
String |
30 |
N/A |
Address line 2 for the organisation (suburb/town) |
address3 |
String |
30 |
N/A |
Address line 3 for the organisation (city) |
address4 |
String |
30 |
N/A |
Address line 4 for the organisation (state/region) |
locale |
String |
10 |
N/A |
Locale of the organisation (made up of language, country and variant codes - see java doc for more info) |
CustomField
Name |
Type |
Size |
Required |
Description |
name |
String |
25 |
N/A |
Name of the custom field set up in timecard. |
value |
String |
500 |
N/A |
Value entered for the custom field. |