How to use JC360® API
This is the help site of JC360® API which shows - through examples - how to use each webservice function. Example codes are written in C# .NET.
To use JC360® API you should do the following:
- Get an Authorization code (AuthCode) for your company. This AuthCode will authenticate your company, so it must be passed to each webservice function. Ask your AuthCode from JC360® support.
- Add webservice reference (https://JobCTRL.com/API/api.asmx?wsdl) to your project.
DictionaryAutoRules
DictionaryAutoRules and DictionaryAutoRuleSamples (samples) are a representation of Rules that change the user's pc client's behaviour. Each
DictionaryAutoRule that is assigned to a sample(and its parameter) will generate one rule that pc client uses. Between these rules the relation
will be always "OR" => the order of the rules are important, because the first rule that the client evaluates to true wins, and the processing of
the other rules will be stopped. The order of the rules depends on the priority of the sample.
Samples are:
- Start works (when a condition evaluates to true force the client switch to a specific task), or
- Stop works (when a condition evaluates to true force the client to go offline (pc jc icon is red))
Samples contain one parameter (simple sample) or more parameters (complex sample).
- Lets assume there is a simple stop work sample named "Outlook Addressee based stop work" and there is another one named "Outlook Sender based stop
work". Both of them have got only 1 parameter, the first one with an "Addressee", the second one with "Sender". As mentioned before, each sample
generates one rule, and between these rules the relation is "OR". If you assign "word1" to Addressee and "word2" to Sender => "rule1 OR rule2" =>
if "(address contains word1) OR (the sender contains word2)". It is also possible to add more than one word, and choose the relation between them =>
if "(address contains word1 and/or address contains word11) OR (sender contains word2 and/or sender contains word22)".
- Lets assume there is a complex stop work sample named "Addressee and Sender based stop work", it has got two parameters, Addressee and Sender, but it is
one sample, meaning it will generate one rule only. Between the parameters the relation will always be "AND". If we assign word1 to the first
parameter, and word2 to the second parameter, the condition will evaluate to true only if the "(Addressee contains word1) AND (sender contains word2)".
You can also add more than one words here like "(Addresse contains word1 and/or Addresse contains word11) AND (Sender contains word2 and/or Sender
contains word22)"
Additional info:
- If you create a new dictionaryautorule, one new rule will be inserted next to the existing rules with "OR" relation as mentioned before.
- If there are only one word assigned to a sample's parameter, relation must be null. If there are more than one words, relation cannot be null.
- The pc client's rule are not updated always instantly, but maximum in 5 minutes.
- If there are no sample assigned to a company, ask for our support team's help.
Description:
Creates a holiday for a specific user.
Signature:
public AddHolidayForUserRet AddHolidayForUser(Guid CompanyAuthCode, int userId, DateTime startDate, DateTime endDate, int dailyDurationInMins, int? holidayCategoryId, out int createdHolidayId)
Return values:
public enum AddHolidayForUserRet { OK, AccessDenied, UnknownError, AuthCodeNotValid, SubscriptionExpired, TimeIntervalIsOutdated, InvalidTimeInterval, IntervalIsNotEmpty, InvalidDailyDuration, InvalidHolidayCategory }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
This is the Id of the specified user. |
| DateTime |
startDate |
In |
The first day of the holiday. |
| DateTime |
endDate |
In |
The last day of the holiday. When holiday is only for single day then startDate equals to endDate. |
| int |
dailyDurationInMins |
In |
Duration of holiday per day given in minutes. (e.g. 8 hours per day = 480 minutes). |
| int? |
holidayCategoryId |
In |
Type of the holiday. For the default "Annual Holiday" leave this field NULL. Otherwise enter a valid categoryId returned by GetHolidayCategories function. |
| int |
createdHolidayId |
Out |
This is the identifier of the newly created object. You can use this Id to find or delete this object later. |
Example code (C#):
var userId = 1234567; var startDate = DateTime.UtcNow.Date; var endDate = startDate.AddDays(6); int holiday1Id;
using (API api = new API()) { api.AddHolidayForUser(AuthCode, userId, startDate, endDate, 480, null, out holiday1Id); }
Description:
Creates a holiday for a specific user.
Signature:
public AddHolidayForUserRet AddHolidayForUser_v2(Guid CompanyAuthCode, int userId, DateTime startDate, DateTime endDate, bool isWholeDay, int? dailyDurationInMins, int? holidayCategoryId, out int createdHolidayId)
Return values:
public enum AddHolidayForUserRet_v2 { OK, AccessDenied, UnknownError, AuthCodeNotValid, SubscriptionExpired, TimeIntervalIsOutdated, InvalidTimeInterval, IntervalIsNotEmpty, InvalidDailyDuration, InvalidHolidayCategory, IsWholeDayMustBeTrueIfDailyDurationInMinsIsNull, IsWholeDayMustBeFalseWhenDailyDurationInMinsIsNotNull }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
This is the Id of the specified user. |
| DateTime |
startDate |
In |
The first day of the holiday. |
| DateTime |
endDate |
In |
The last day of the holiday. When holiday is only for single day then startDate equals to endDate. |
| bool |
isWholeDay |
In |
If set to true, system will automatically create holidays with expected worktime for the affected days. If there are changes in expected worktime in the interval of the holiday, multiple parts of holidays will be created each with homogenous expected worktime. If not set, holiday is guaranteed to be not split and and will have the same expected worktime for all days of the holiday. |
| int? |
dailyDurationInMins |
In |
Duration of holiday per day given in minutes. (e.g. 8 hours per day = 480 minutes). Required only when isWholeDay parameter is set to false. |
| int? |
holidayCategoryId |
In |
Type of the holiday. For the default "Annual Holiday" leave this field NULL. Otherwise enter a valid categoryId returned by GetHolidayCategories function. |
| int |
createdHolidayId |
Out |
This is the identifier of the newly created object. You can use this Id to find or delete this object later. |
Example code (C#):
var userId = 1234567; var startDate = DateTime.UtcNow.Date; var endDate = startDate.AddDays(6); int holiday1Id;
using (API api = new API()) { api.AddHolidayForUser(AuthCode, userId, startDate, endDate, true, null, null, out holiday1Id); }
Description:
Creates a holidaylimit for a specific user's year.
Signature:
public AddHolidayLimitsForUserRet AddHolidayLimitsForUser(Guid CompanyAuthCode, <a href="#HolidayLimit">HolidayLimit</a> holidayLimit)
Return values:
public enum AddHolidayLimitsForUserRet { OK, UnknownError, AuthCodeNotValid, ValueForEveryCategoryMustBeProvided, HolidayLimitAlreadyExistsForUser, InvalidYear }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| HolidayLimit |
holidayLimit |
In |
This object describes the limits for a user's year. |
Example code (C#):
var holidayCategoryId1 = 100; var holidayCategoryId2 = 101; var holidayCategoryId3 = 102; var holidayLimitToUpload = new HolidayLimit { UserId = 1234567, Year = 2013, CategoryLimits = new CategoryLimit[] { new CategoryLimit{ CategoryId = holidayCategoryId1, LimitInMins = 200}, new CategoryLimit{ CategoryId = holidayCategoryId2, LimitInMins = 300}, new CategoryLimit{ CategoryId = holidayCategoryId3, LimitInMins = 400} } }; using (API api = new API()) { api.AddHolidayLimitsForUser(AuthCode, holidayLimitToUpload); }
Description:
Adds worktime for the user via creating a new manual workitem for the user.
Signature:
public AddManualWorkitemRet AddManualWorkitem(Guid companyAuthCode, int targetUserId, DateTime startDateInUtc, DateTime endDateInUtc, int taskId, string comment)
Return values:
public enum AddManualWorkitemRet { OK, UnknownError, AuthCodeInvalid, SubscriptionExpired, AccessDenied, TimeIntervalIsOutdated, CorrectionTypeIsNotValid, TaskIdIsNotGiven, InvalidTimeInterval, TaskNotExistsOrNotAssignedToUser, TimeIntervalIsTooLong, BothDatesMustBeSetToNullOrToValue }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user. |
| DateTime |
startDateInUtc |
In |
Start date of the manualworkitem in UTC. |
| DateTime |
endDateInUtc |
In |
End date of the manualworkitem in UTC. |
| int |
taskId |
In |
Id of the task. |
| string |
comment |
In |
Comment for the manualworkitem. |
Example code (C#):
using (var api = new API()) { var targetUserId = 123; var authCode = Guid.NewGuid(); var startDate = DateTime.UtcNow; var endDate = DateTime.UtcNow.AddHours(1); var taskId = 123456; var comment = "comment";
var ret = api.AddManualWorkitem(authCode, targetUserId, startDate, endDate, taskId, comment);
if (ret != AddManualWorkitemRet.OK) Console.WriteLine("Error getting adding manualworkitem for the user"); }
Description:
Creates a sick-leave for a specific user.
Signature:
public AddSickLeaveForUserRet AddSickLeaveForUser(Guid CompanyAuthCode, int userId, DateTime startDate, DateTime endDate, int dailyDurationInMins, out int createdSickleaveId)
Return values:
public enum AddSickLeaveForUserRet { OK, AccessDenied, UnknownError, AuthCodeNotValid, SubscriptionExpired, TimeIntervalIsOutdated, InvalidTimeInterval, IntervalIsNotEmpty, InvalidDailyDuration }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
This is the Id of the specified user. |
| DateTime |
startDate |
In |
The first day of the sick-leave. |
| DateTime |
endDate |
In |
The last day of the sick-leave. When sick-leave is only for single day then startDate equals to endDate. |
| bool |
isWholeDay |
In |
If set to true, system will automatically create holidays with expected worktime for the affected days. If there are changes in expected worktime in the interval of the holiday, multiple parts of holidays will be created with homogenous expected worktime. If not set, holiday is guaranteed to be not split and |
| int? |
dailyDurationInMins |
In |
Duration of sick-leave per day given in minutes. (e.g. 8 hours per day = 480 minutes). |
| int |
createdSickleaveId |
Out |
This is the identifier of the newly created object. You can use this Id to find or delete this object later. |
Example code (C#):
var userId = 1234567; var startDate = DateTime.UtcNow.Date; var endDate = startDate.AddDays(6); int sickLeave1Id;
using (API api = new API()) { api.AddSickLeaveForUser(AuthCode, userId, startDate, endDate, 480, out sickLeave1Id); }
Description:
Creates a sick-leave for a specific user.
Signature:
public AddSickLeaveForUserRet_v2 AddSickLeaveForUser_v2(Guid CompanyAuthCode, int userId, DateTime startDate, DateTime endDate, bool isWholeDay, int? dailyDurationInMins, out int createdSickleaveId)
Return values:
public enum AddSickLeaveForUserRet_v2 { OK, AccessDenied, UnknownError, AuthCodeNotValid, SubscriptionExpired, TimeIntervalIsOutdated, InvalidTimeInterval, IntervalIsNotEmpty, InvalidDailyDuration, IsWholeDayMustBeTrueIfDailyDurationInMinsIsNull, IsWholeDayMustBeFalseWhenDailyDurationInMinsIsNotNull }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
This is the Id of the specified user. |
| DateTime |
startDate |
In |
The first day of the sick-leave. |
| DateTime |
endDate |
In |
The last day of the sick-leave. When sick-leave is only for single day then startDate equals to endDate. |
| bool |
isWholeDay |
In |
If set to true, system will automatically create sick-leaves with expected worktime for the affected days. If there are changes in expected worktime in the interval of the sick-leave, multiple parts of sick-leaves will be created each with homogenous expected worktime. If not set, sick-leave is guaranteed to be not split and and will have the same expected worktime for all days of the sick-leave. |
| int? |
dailyDurationInMins |
In |
Duration of sick-leave per day given in minutes. (e.g. 8 hours per day = 480 minutes). Required only when isWholeDay parameter is set to false. |
| int |
createdSickleaveId |
Out |
This is the identifier of the newly created object. You can use this Id to find or delete this object later. |
Example code (C#):
var userId = 1234567; var startDate = DateTime.UtcNow.Date; var endDate = startDate.AddDays(6); int sickLeave1Id;
using (API api = new API()) { api.AddSickLeaveForUser(AuthCode, userId, startDate, endDate, true, null, out sickLeave1Id); }
Description:
Applies a Task template to a project
Signature:
public ApplyTemplateRet ApplyTemplate(Guid CompanyAuthCode, int TemplateId, int ProjectId, bool AssignToProjectUsers)
Return values:
public enum ApplyTemplateRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, ApplyToProjectOnly }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TemplateId |
In |
The id of the task template to be assigned |
| int |
ProjectId |
In |
The id of the project that the template should be assigned to |
| bool |
AssignToProjectUsers |
In |
Set whether the project members should be assigned to the new task structure under the project |
Example code (C#):
using (API api = new API()) { var ret = api.ApplyTemplate(AuthCode, template1Id, project1, true);
if (ret != ApplyTemplateRet.OK) Console.WriteLine("Error applying template (id: {0}) to project (id: {1}), error code: {2}", template1Id, project1, ret); }
Description:
Assigns one or more users to one or more works
Signature:
public AssignUsersToTasksRet_v4 AssignUsersToTasks_v4(Guid CompanyAuthCode, int[] TaskIdList, int[] UserIdList, int? PlannedWorktimeInMinutes, DateTime? StartDate, DateTime? EndDate)
Return values:
public enum AssignUsersToTasksRet_v4 { OK, UnknownError, AuthCodeNotValid, AccessDenied, InvalidTimeInterval, BothDatesMustBeSetToNullOrToValue, PlannedWorktimeInMinutesIsInvalid, PlannedWorktimeInMinutesIsGreaterThanAllowedByStartdateAndEnddate, CannotAssignToClosedTask, CannotStartBeforeParentTask, CannotFinishAfterParentTask, TotalAssignmentPlannedTimeGreaterThanWorkPlannedTime }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
TaskIdList |
In |
One or more task id to be assigned to users |
| int[] |
UserIdList |
In |
One or more user id to be assigned to tasks |
| int? |
PlannedWorktimeInMinutes |
In |
The planned time of each assigment (the set value will appear at each assignment) |
| DateTime? |
StartDate |
In |
The start date of the assignment |
| DateTime? |
EndDate |
In |
The end data of the assingment |
Example code (C#):
int[] TaskIdList = { Work1Id, Work2Id }; int[] UserIdList = { Worker1UserId, Worker2UserId };
using (API api = new API()) { var ret = api.AssignUsersToTasks_v4(AuthCode, TaskIdList, UserIdList, 200, new DateTime(2013, 1, 1), new DateTime(2013, 1, 1));
if (ret != AssignUsersToTasksRet_v4.OK) Console.WriteLine("Error assigning users to tasks, error code: {0}", ret); }
Description:
Assigns a user to worker groups as supervisor.
Signature:
public AssignUserToWorkerGroupsRet AssignUserToWorkerGroups(Guid companyAuthCode, int userId, int[] groupIds)
Return values:
public enum AssignUserToWorkerGroupsRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
Id of the user to be supervisor. |
| int[] |
groupIds |
In |
The IDs of user groups. |
Example code (C#):
using (var api = new API()) { var userId = 123; var groupId = 123; var authCode = Guid.NewGuid();
var ret = api.AssignUserToWorkerGroups(authCode, userId, new[] { groupId })
if (ret != AssignUserToWorkerGroupsRet.OK) Console.WriteLine("Error assigning user to workergroups"); }
Description:
Closes a task or project
Signature:
public CloseTaskRet CloseTask(Guid CompanyAuthCode, int TaskId)
Return values:
public enum CloseTaskRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, CloseReasonLimitReachedForATask }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
The id of the task to be closed |
Example code (C#):
using (var api = new API()) { var ret = api.CloseTask(AuthCode, task1Id);
if (ret != CloseTaskRet.OK) Console.WriteLine("Error closing task (id: {0}), error code: {1}", task1Id, ret); }
Description:
Create cost center for the cost center base operation, only for sync operations
Signature:
public CostCenterCreateError CreateCostCenter_v2(Guid companyAuthCode, CostCenter_v2 costCenter)
Return values:
public enum CostCenterCreateError { OK = 0, UnknownError = 999, AuthCodeNotValid, AccessDenied = 106, InvalidName = -200, InvalidBillingInformationCompanyRegistry = -100, InvalidBillingInformationCity = -101, InvalidBillingInformationCountry = -102, InvalidBillingInformationName = -103, InvalidBillingInformationNumber = -104, InvalidBillingInformationStreetType = -105, InvalidBillingInformationStreetName = -106, InvalidBillingInformationZip = -107, InvalidBillingInformationTaxNumber = -108 }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| CostCenter_v2 |
costCenter |
In |
Class for holding the cost center information |
Example code (C#):
var billingInformation = new BillingInformation_v2 { CostCenterId = 1, CompanyName = "TestCompanyName", TaxNumber = "87654321", City = "City", Zip = "Zip", StreetName = "StreetName", StreetType = "StreetType", Number = "11", Floor = "22", Door = "33", ExtId = "TC5698", };
var costCenter = new CostCenter_v2 { Id = 1, Description = "Default cost center", Name = "Default", IsDefault = true, BillingInformation = billingInformation, };
using (var api = new API()) { var ret = api.CreateCostCenter_v2(AuthCode, costCenter);
if (ret != CostCenterCreateError.OK) { Console.WriteLine("Error creating cost center, error code: {0}", ret); } }
Description:
Creates an issue for the issue manager
Signature:
public CreateIssueRet CreateIssue(Guid CompanyAuthCode, string issueCode, string company, string subject, IssueState issueState, DateTime createdAt, int? createdBy, DateTime modifiedAt, int? modifiedBy)
Return values:
public enum CreateIssueRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| string |
issueCode |
In |
The code for unique identification of the issue |
| string |
company |
In |
Name to identify the company in the issue manager |
| enum |
issueState |
In |
The state of the issue ("Opened", "Closed", "WaitingForCustomer") |
| DateTime |
createdAt |
In |
Timestamp of creation |
| int |
createdBy |
In |
Id of the user who created the issue |
| DateTime |
modifiedAt |
In |
Timestamp of modification |
| int |
modifiedBy |
In |
Id of the user who made the last modification to the issue |
Example code (C#):
using (var api = new API()) { var ret = api.CreateIssue(AuthCode, "issueCode", "company", "subject", IssueState.Opened, new DateTime(2018, 1, 15, 15, 0, 0), 1, new DateTime(2018, 1, 15, 16, 0, 0), 1);
if (ret != CreateIssueRet.OK) Console.WriteLine("Error creating issue, error code: {0}", ret); }
Description:
Creates a new project under the given project or under the root. Project participants can be automatically assigned to the created project.
Signature:
public CreateProjectRet_v2 CreateProject_v2(Guid CompanyAuthCode, int ParentId, string Name, ProjectParticipant[] ParticipantList, string Description, int? TargetPlannedWorktimeInMinutes, DateTime? TargetStartDate, DateTime? TargetEndDate, decimal? TargetCost, string taxId, int? priority, out int CreatedProjectId)
Return values:
public enum CreateProjectRet_v2 { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid AccessDenied, // Parent must be a project or root of your company or does not exist ParentMustBeAProjectOrRoot , // Parent must be Project or Root EmptyNameIsNotValid, // Project's name must be given TargetPlannedWorktimeInMinutesIsInvalid, // Planned worktime is invalid InvalidTimeInterval, // Startdate and Enddate interval is invalid (e.g. negative interval, exactly one of them was not defined) InvalidTargetCost, // Target cost is invalid. Must be greater or equal to zero. ParentTargetCostIsExceeded, // Given target cost is too high. The cumulated target cost for one of the parents exceeds the target cost given for the parent. ParentTargetPlannedWorkTimeIsExceeded, // Given estimated time is too high. The cumulated estimated time for one of the parents exceeds the estimated time given for the parent. CannotStartBeforeParentTask, // StartDate cannot be lesser than StartDate defined for one of the parent projects. CannotFinishAfterParentTask, // EndDate cannot be lesser than EndDate defined for one of the parent projects. }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
ParentId |
In |
This is the Id of the parent (project or root) which will contain the newly created project. |
| string |
Name |
In |
This is the name of the project. |
| array |
ParticipantList |
In |
You can set specific users as project participant for the newly created project. Leave parameter null or empty otherwise. |
| string |
Description |
In |
This is the description of the project. Leave null by default. |
| int? |
TargetPlannedWorktimeInMinutes |
In |
This is the Planned worktime of the in minutes. Must be greater of equal to zero. Leave null by default. |
| DateTime? |
TargetStartDate |
In |
This is the Start date for the period. Must be lesser than End date. Leave null by default. |
| DateTime? |
TargetEndDate |
In |
This is the End date for the period. Must be greater than Start date. Leave null by default. |
| decimal? |
TargetCost |
In |
This is the target cost of the project. Must be greater of equal to zero. Leave null by default. |
| string |
taxId |
In |
A legacy field. Leave null by default. |
| int? |
priority |
In |
This is the priority of the project. Must be between 0 and 10000. Leave null by default. |
| int |
CreatedProjectId |
Out |
Id of the newly created project. |
Example code (C#):
int RootTaskID = 1111; // get your own from GetTaskHierarchy call
// Create a project and not assigning to anyone int project1Id; using (API api = new API()) { api.CreateProject_v2(AuthCode, RootTaskID, "Project1", null, null, null, null, null, null, null, null, out project1Id); }
// Create a project under the newly created project and assigning to someone var participants = new ProjectParticipant[] { new ProjectParticipant { UserId = Worker1UserId, IsLeader = true }, new ProjectParticipant { UserId = Worker2UserId, IsLeader = false } };
int project2Id; using (API api = new API()) { api.CreateProject_v2(AuthCode, project1Id, "Project2", participants, null, null, null, null, null, null, null, out project2Id); } // Create a project with all values set int project3Id; using (API api = new API()) { api.CreateProject_v2(AuthCode, project1Id, // create project under "Project1" project "Project3", // project's name participants, "description", 2 * 60, // estimated time is 2 hours new DateTime(2013, 1, 1), // Project should start in 2013. Jan. 01 new DateTime(2013, 2, 1), // Project's deadline is 2013. Feb. 01 1000, // project's estimated cost should be 1000 unit (e.g. usd, eur) null, // taxId, legacy field, leave null by default 150, // set priority 150 for project out project3Id); }
Description:
Add project members to a project as a leader or member
Signature:
public CreateProjectMembershipRet CreateProjectMembership(Guid CompanyAuthCode, int ProjectId, int UserId, bool IsLeader)
Return values:
public enum CreateProjectMembershipRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, OnlyProjectIdAllowed, UserIsAlreadyAdded, UserWasDeleted }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
ProjectId |
In |
Id of the project |
| int |
UserId |
In |
Id of the user who should be assigned to the project |
| bool |
IsLeader |
In |
The assignment should be a project leader or a project member assignment |
Example code (C#):
using (API api = new API()) { var ret = api.CreateProjectMembership(AuthCode, 2, 456, false); }
if (ret != CreateProjectMembershipRet.OK) { Log("Create project membership error: " + ret); }
Description:
Creates a user (if domain login is going to be used, domain users are upserted every 12 hours.) The following will result in error: !autoActivate && sendActivationEmail / autoActivate && !sendActivationEmail && String.IsNullOrWhiteSpace(activeDirectoryUserPrincipalName)
Signature:
public CreateUserRet CreateUser(Guid CompanyAuthCode, int parentUserGroupId, string firstName, string lastName, string email, UserAccessLevel accessLevel, string cultureId, bool autoActivate, bool sendActivationEmail, out int createdUserId, string extId = null, string activeDirectoryUserPrincipalName = null, string password = null)
Return values:
public enum CreateUserRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, CannotCreateGroupInThisNode, EmailAddressIsAlreadyInUse, ExtIdMustBeUnique, ActiveDirectoryUserPrincipalNameMustBeUnique, NameCannotBeEmpty, EmailCannotBeEmpty, InvalidAccessLevel, OnlyAdminsCanManageSupervisorsAndAdmins, PasswordAndConfirmationMustMatch, CultureNotSupported, PasswordMustMeetPolicy, TargetNodeHasNoUserSpecified, RoleIdDoesNotBelongToCompany, CannotSendEmailWithoutUserActivation, //Only if: !autoActivate && sendActivationEmail MissingActiveDirectoryUserPrincipalName //Only if autoActivate && !sendActivationEmail && String.IsNullOrWhiteSpace(activeDirectoryUserPrincipalName) }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
parentUserGroupId |
In |
Target user group id (parent id) where the user has to be created |
| string |
firstName |
In |
First name of the user |
| string |
lastName |
In |
Last name of the user |
| string |
email |
In |
Email of the user, must be unique in a company |
| UserAccessLevel |
accessLevel |
In |
Access level of the user. Enum: Worker = 0, Supervisor = 1, Administrator = 2 |
| string |
cultureId |
In |
Culture of the user. Possible values are: en-US (English), hu-HU (Hungarian), ko-KR (Korean), ja-JP (Japanese), pt-BR (Portuguese), es-MX (Spanish) |
| bool |
autoActivate |
In |
Activate the user or not |
| bool |
sendActivationEmail> |
In |
Send activation email or not |
| string |
extId |
In |
Optional. External id of the user (for external systems) |
| string |
activeDirectoryUserPrincipalName |
In |
Optional. Active directory user principal name (UPN) |
| string |
password |
In |
Optional. Password of the user. By default the system generated the user a long random password. |
| int |
createdUserId |
Out |
Returns the userId of the newly created user. |
Example code (C#):
using (var api = new API()) { int createdUserId; var ret = api.CreateUser(AuthCode, 123, "firstname", "lastname", "test@test.com", UserAccessLevel.Administrator, "en-US", true, true, null, null, null, out createdUserId); if (ret != CreateUserRet.OK) Console.WriteLine("Error creating User") }
Description:
Creates a user group.
Signature:
public CreateUserGroupRet CreateUserGroup(Guid CompanyAuthCode, int parentUserGroupId, string name, out int createdGroupId, string extId = null)
Return values:
public enum CreateUserGroupRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, CannotCreateGroupInThisGroup, NameCannotBeEmpty, ExtIdMustBeUnique }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
parentUserGroupId |
In |
Id of the user group the given user group is going to be created in. |
| string |
name |
In |
Name of the user group. |
| string |
extId |
In |
Optional. External id of the user group (for external systems) |
| int |
createdGroupId |
Out |
Id of the newly created user group. |
Example code (C#):
using (var api = new API()) { var companyRootGroupId = 123; var authCode = Guid.NewGuid();
int createdUserGroupId; var ret = api.CreateUserGroup(authCode, companyRootGroupId, "Group1", null, out createdUserGroupId); if (ret != CreateUserGroupRet.OK) Console.WriteLine("Error creating Group"); }
Description:
Creates a new work under the given project. Users can be automatically assigned to the created work.
Signature:
public CreateWorkRet_v4 CreateWork_v4(Guid CompanyAuthCode, int ParentProjectId, string Name, string Description, bool AutoAssignParticipants, int[] UserIdsToAssign, short? Priority, DateTime? AssignmentStartDate, DateTime? AssignmentEndDate, int? AssignmentPlannedWorktimeInMinutes, short? closeAfterInactiveHours, RequiredCloseReasons_v4 requiredClosedReasons, out int CreatedWorkId)
Return values:
public enum CreateWorkRet_v4 { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid AccessDenied, // Parent must be a project of your company or does not exist ParentMustBeProject, // Parent must be Project EmptyNameIsNotValid // Work's name must be given InvalidTimeInterval, // Interval defined by StartDate and EndDate is Invalid BothDatesMustBeSetToNullOrToValue, // StartDate and EndDate must be both null or must both have a value PriorityIsInvalid, // Priority is out of range PlannedWorktimeInMinutesIsInvalid, // PlannedWorktimeInMinutes is out of range PlannedWorktimeInMinutesIsGreaterThanAllowedByStartdateAndEnddate, // PlannedWorktimeInMinutes exceeds the maximum possible value (24 hour per day) CloseReasonRequiredTimeIsInvalid, // CloseReasonRequiredTime is out of range CannotStartBeforeParentTask, // StartDate must be greater or equal to its parent's StartDate CannotFinishAfterParentTask // EndDate must be lesser or equal than parent's EndDate }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
ParentProjectId |
In |
This is the Id of the parent project which will contain the newly created work. |
| string |
Name |
In |
This is the name of the project. |
| string |
Description |
In |
This is the description of the project. |
| bool |
AutoAssignParticipants |
In |
You can set whether work should be automatically assigned to project participants. |
| int[] |
UserIdsToAssign |
In |
You can set specific users who will be automatically assigned to work. Leave parameter null or empty otherwise. |
| short? |
Priority |
In |
You can set priority for assignments. Priority must be between 0 and 10000. Leave null by default. |
| DateTime? |
AssignmentStartDate |
In |
You can set StartDate for assignments. StartDate mustn't be greater than EndDate and both of them must be null or must have a value. Leave null by default. |
| DateTime? |
AssignmentEndDate |
In |
You can set EndDate for assignments. StartDate mustn't be greater than EndDate and both of them must be null or must have a value. Leave null by default. |
| int? |
AssignmentPlannedWorktimeInMinutes |
In |
You can set a planned worktime for assignments in minutes. Values must be between 0 and 600000 minutes. Leave null by default. |
| short? |
closeAfterInactiveHours |
In |
You can set whether the task assignment should be automatically closed after the assigned user didn't work on it. Leave null by default. |
| RequiredCloseReasons_v4 |
requiredClosedReasons |
In |
You can set the attributes of close reasoning. Leave null by default. The information is stored in the RequiredCloseReasons_v4 class. |
| int |
CreatedWorkId |
Out |
Id of the newly created work. |
Example code (C#):
int Project1Id = 1111; // Get your ProjectId from GetTaskHierarchy or from a preceeding CreateProject call
// Create a work and not assigning to anyone int work1Id; using (API api = new API()) { api.CreateWork_v4(AuthCode, Project1Id, "Work1", null, false, null, null, null, null, null, null, null, out work1Id); }
// Create a work and assigning to someone int work2Id; using (API api = new API()) { api.CreateWork_v4(AuthCode, Project1Id, "Work2", "Description", false, // should not assign to existing project participants new int[] { Worker1UserId }, // assign to a worker 200, // assignment priority should be 200 new DateTime(2013, 1, 1), // StartDate should be the same day as EndDay, so user has only 1 day to finish with its task new DateTime(2013, 1, 1), 4 * 60, // Planned time is 4 hours 72, // Close task automatically after worker didn't work on it for 72 hours new RequiredCloseReasons_v4 { AfterTimeInMins = 5 * 60, AfterDate = new DateTime(2013, 1, 2), RepeatIntervalInMins = 60, RepeatingTimes = 3 }; out work2Id); }
Description:
Creates a worktimeschedule
Signature:
public CreateWorktimeScheduleRet CreateWorktimeSchedule(Guid CompanyAuthCode, WorktimeSchedule worktimeSchedule, out int createdId)
Return values:
public enum CreateWorktimeScheduleRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, ScheduleIsEmpty, //Items of the WorktimeSchedule is null or empty ItemIsTooLong, //StartDate EndDate interval is bigger than 24hours NegativeItemInterval, //StartDate is later than EndDate InvalidTaskId, ItemIsOutOfIntervalRange, //Intervals are allowed for yesterday, today, and for tomorrow OverlappingItemIntervals, //ScheduledItem overlaps another one OverlappingItemIntervalAlreadyExist //ScheduledItem overlap conflict between the parameters and database ExtendedPropertyNameCannotBeEmpty, //Name fields of ExtendedProperty items must not be empty ExtendedPropertyNameIsNotUnique, //Name fields of ExtendedProperty items must be unique inside an item IsWorkDayAndIsInOfficeConflict //Office work on a non-workday cannot be required }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| WorktimeSchedule |
worktimeSchedule |
In |
Id of the WorktimeSchedule |
| int |
createdId |
In |
Id of the created WorktimeSchedule |
Example code (C#):
var targetUserId = 123;
var schedule = new WorktimeSchedule { Id = 0, LocalDay = new DateTime(2018, 10, 19), UserId = targetUserId, IsInOffice = false };
var items = new List<WorktimeScheduleItem>() { new WorktimeScheduleItem { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, } };
schedule.Items = items.ToArray();
int createdId; using (API api = new API()) { var ret = api.CreateWorktimeSchedule(AuthCode, schedule, out createdId); if (ret != CreateWorktimeScheduleRet.OK) Console.WriteLine("Error creating WorktimeSchedule") }
Description:
Creates a worktimeschedule
Signature:
public CreateWorktimeScheduleRet_v2 CreateWorktimeSchedule_v2(Guid CompanyAuthCode, WorktimeSchedule_v2 worktimeSchedule, out int createdId)
Return values:
public enum CreateWorktimeScheduleRet_v2 { OK, UnknownError, AuthCodeNotValid, AccessDenied, ScheduleIsEmpty, //Items of the WorktimeSchedule is null or empty ItemIsTooLong, //StartDate EndDate interval is bigger than 24hours NegativeItemInterval, //StartDate is later than EndDate InvalidTaskId, ItemIsOutOfIntervalRange, //Intervals are allowed for yesterday, today, and for tomorrow OverlappingItemIntervals, //ScheduledItem overlaps another one OverlappingItemIntervalAlreadyExist //ScheduledItem overlap conflict between the parameters and database ExtendedPropertyNameCannotBeEmpty, //Name fields of ExtendedProperty items must not be empty ExtendedPropertyNameIsNotUnique, //Name fields of ExtendedProperty items must be unique inside an item IsWorkDayAndIsInOfficeConflict //Office work on a non-workday cannot be required ItemsShouldBeEmptyOnNonWorkdays, //Items make no sense on non-working days CannotRequestInTheFuture, //Corresponding default setting doesn't let recording schedules in the future that much ahead ScheduleAlreadyExistsForTheGivenDay, //A schedule already exists for the day InvalidCategoryId //Category does not exist }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| WorktimeSchedule_v2 |
worktimeSchedule |
In |
Id of the WorktimeSchedule_v2 |
| int |
createdId |
In |
Id of the created WorktimeSchedule_v2 |
Example code (C#):
var targetUserId = 123;
var schedule = new WorktimeSchedule_v2 { Id = 0, LocalDay = new DateTime(2018, 10, 19), UserId = targetUserId, IsInOffice = false, IsWorkDay = true };
var items = new List<WorktimeScheduleItem_v2>() { new WorktimeScheduleItem_v2 { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, CategoryId = 5678 } };
schedule.Items = items.ToArray();
int createdId; using (API api = new API()) { var ret = api.CreateWorktimeSchedule_v2(AuthCode, schedule, out createdId); if (ret != CreateWorktimeScheduleRet_v2.OK) Console.WriteLine("Error creating WorktimeSchedule") }
Description:
Deassigns a user from worker groups as supervisor.
Signature:
public DeassignUserFromWorkerGroupsRet DeassignUserFromWorkerGroups(Guid companyAuthCode, int userId, int[] groupIds)
Return values:
public enum DeassignUserFromWorkerGroupsRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
Id of the user not to be supervisor anymore. |
| int[] |
groupIds |
In |
The IDs of user groups. |
Example code (C#):
using (var api = new API()) { var userId = 123; var groupId = 123; var authCode = Guid.NewGuid();
var ret = api.DeassignUserFromWorkerGroups(authCode, userId, new[] { groupId })
if (ret != DeassignUserFromWorkerGroups.OK) Console.WriteLine("Error deassigning user from workergroups"); }
Description:
Delete user assignments from tasks
Signature:
public DeassignUsersFromTasksRet DeassignUsersFromTasks(Guid CompanyAuthCode, int[] TaskIdList, int[] UserIdList)
Return values:
public enum DeassignUsersFromTasksRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, CloseReasonLimitReachedForATask }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
TaskIdList |
In |
List of task ids which takes part in the operation |
| int[] |
UserIdList |
In |
List of user ids which takes part in the operation |
Example code (C#):
int[] TaskIdList = new int[] { Work1Id, Work2Id }; int[] UserIdList = new int[] { Worker1UserId, Worker2UserId };
using (API api = new API()) { var ret = api.DeassignUsersFromTasks(AuthCode, TaskIdList, UserIdList) if (ret != DeassignUsersFromTasksRet.OK) { Log("Remove assignment error: " + ret); } }
Description:
Deletes a DictionaryAutoRule
Signature:
public DeleteDictionaryAutoRuleRet DeleteDictionaryAutoRule(Guid CompanyAuthCode, int dictionaryAutoRuleId)
Return values:
public enum DeleteDictionaryAutoRuleRet { OK, UnknownError, AccessDenied, //dictionaryautorules are turned off at this company //workers cannot delete dictionaryautorules //dictionaryautorule is not in the current company //non-admins can access start work dictionary autorules only if projectleaders //only admins can access stopwork dictionary autorules AuthCodeNotValid, AtLeastOneSampleIsInactiveError, DictionaryAutoRuleIdDoesNotExist }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
dictionaryAutoRuleId |
In |
Id of the DictionaryAutoRule |
Example code (C#):
using (API api = new API()) { var result = api.DeleteDictionaryAutoRule(AuthCode, dictionaryAutoRule.Id); }
Description:
Deletes a holiday entry of a user.
Signature:
public DeleteHolidayRet DeleteHoliday(Guid CompanyAuthCode, int holidayId)
Return values:
public enum DeleteHolidayRet { OK, AccessDenied, UnknownError, AuthCodeNotValid, SubscriptionExpired, TimeIntervalIsOutdated }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
holidayId |
In |
This is the Id of the holiday. This Id can be retrieved by using the GetHolidaysOfUser, GetHolidaysForCompany or AddHolidayForUser functions. |
Example code (C#):
var holiday1Id = 123; using (API api = new API()) { api.DeleteHoliday(AuthCode, holiday1Id); }
Description:
Deletes a manual workitem of the user.
Signature:
public DeleteManualWorkitemRet DeleteManualWorkitem(Guid companyAuthCode, int manualWorkitemId)
Return values:
public enum DeleteManualWorkitemRet { OK, UnknownError, AuthCodeInvalid, AccessDenied, CorrectionDoesNotExist, TimeIntervalIsOutdated, InvalidCorrectionType }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
manualWorkitemId |
In |
Id of the manualworkitem. |
Example code (C#):
using (var api = new API()) { var authCode = Guid.NewGuid(); var manualWorkitemId = 123456;
var ret = api.DeleteManualWorkitem(authCode, manualWorkitemId);
if (ret != DeleteManualWorkitemRet.OK) Console.WriteLine("Error deleting manualworkitem"); }
Description:
Deletes a sick-leave entry of a user.
Signature:
public DeleteSickLeaveRet DeleteSickLeave(Guid CompanyAuthCode, int sickLeaveId)
Return values:
public enum DeleteSickLeaveRet { OK, AccessDenied, UnknownError, AuthCodeNotValid, SubscriptionExpired, TimeIntervalIsOutdated }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
sickLeaveId |
In |
This is the Id of the sick-leave. This Id can be retrieved by using the GetSickLeavesOfUser, GetSickLeavesForCompany or AddSickLeaveForUser functions. |
Example code (C#):
var sickLeave1Id = 123; using (API api = new API()) { api.DeleteSickLeave(AuthCode, sickLeave1Id); }
Description:
Deletes a user
Signature:
public DeleteUserRet DeleteUser(Guid CompanyAuthCode, int targetUserId)
Return values:
public enum DeleteUserRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, UserCannotDeleteHimself, NodeDoesNotExist, NodeCannotBeDeleted, OnlyAdminsCanManageSupervisorsAndAdmins, TargetNodeHasNoUserSpecified, RoleIdDoesNotBelongToCompany }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user that needs to be deleted |
Example code (C#):
using (var api = new API()) { var ret = api.DeleteUser(AuthCode, 123); if (ret != DeleteUserRet.OK) Console.WriteLine("Error deleting User") }
Description:
Deletes a user group.
Signature:
public DeleteUserGroupRet DeleteUserGroup(Guid CompanyAuthCode, int targetGroupId)
Return values:
public enum DeleteUserGroupRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, UserCannotDeleteHimself, GroupDoesNotExist, GroupCannotBeDeleted }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetGroupId |
In |
Id of the user group about to be deleted. |
Example code (C#):
using (var api = new API()) { var groupId = 123; var authCode = Guid.NewGuid();
var ret = api.DeleteUserGroup(authCode, groupId); if (ret != DeleteUserGroupRet.OK) Console.WriteLine("Error deleting Group"); }
Description:
Deletes a worktimeschedule
Signature:
public DeleteWorktimeScheduleRet DeleteWorktimeSchedule(Guid companyAuthCode, int worktimeScheduleId)
Return values:
public enum DeleteWorktimeScheduleRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
worktimeScheduleId |
In |
Id of the WorktimeSchedule |
Example code (C#):
int worktimeScheduleId = 123; using (API api = new API()) { var ret = api.DeleteWorktimeSchedule(AuthCode, worktimeScheduleId); if (ret != DeleteWorktimeScheduleRet.OK) Console.WriteLine("Error deleting WorktimeSchedule") }
Description:
Downloads a datasource file used by custom reports. These files are in excel (.xlsx) format.
Signature:
public DownloadDataSourceFileRet DownloadDataSourceFile(Guid CompanyAuthCode, int dataSourceId, out byte[] fileContent)
Return values:
public enum DownloadDataSourceFileRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
dataSourceId |
In |
The id of the datasource. You can get it by using the UploadDataSourceFile() function or by asking it from the JC360 Support team. |
| byte[] |
fileContent |
Out |
Content of the datasource file. |
Example code (C#):
int dataSourceId = 123456789; byte[] fileContent; using (API api = new API()) { api.DownloadDataSourceFile(AuthCode, dataSourceId, out fileContent); }
ProcessExcelFile(fileContent);
Description:
Imports a leaves and schedules from a predefined excel workbook structure.
Signature:
public ImportLeavesAndSchedulesFromExcelRet ExportLeavesAndSchedulesToExcel(Guid CompanyAuthCode, UserIdentifierType userIdentifierType, DateTime? queryStartDate, DateTime? queryEndDate, out byte[] excel)
Return values:
public enum ImportLeavesAndSchedulesFromExcelRet { AuthCodeNotValid, SubscriptionExpired, AccessDenied, UserIdentifierTypeInvalid, ImportFailed, OK, UnknownError }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| UserIdentifierType |
userIdentifierType |
In |
Identifier type, possible values: UserId, ExtId, Email, ADName |
| DateTime? |
queryStartDate |
In |
Start date of the export. |
| DateTime? |
queryEndDate |
In |
End date of the export. |
| byte[] |
excel |
Out |
The exported data in a base64 string of the predefined excel format. |
Example code (C#):
using (var api = new API()) { var authCode = Guid.NewGuid(); var queryStartDate = new DateTime(2022,02,01); var queryEndDate = new DateTime(2022,02,28); byte[] excel; var ret = api.ImportLeavesAndSchedulesFromExcel(authCode, UserIdentifierType.ExtId, queryStartDate, queryEndDate, out excel);
if (ret != ImportLeavesAndSchedulesFromExcelRet.OK) Console.WriteLine("Error exporting leaves and schedules"); }
Description:
Gets a (sub)hierarchy of tasks and assignments, so you can modify and update them later by calling the ImportTaskSubTree function.
Signature:
public ExportTaskSubTreeRet ExportTaskSubTree(Guid CompanyAuthCode, int SubTreeRootTaskId, out Task_v4 SubTreeRoot)
Return values:
public enum ExportTaskSubTreeRet { OK, UnknownError, AuthCodeNotValid, RootTaskNotFound, }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
SubTreeRootTaskId |
In |
Id of the task which should be the root of the (sub)hierarchy. |
| Task_v4 |
SubTreeRoot |
Out |
This is the root of the returned hierarchy. It can be traversed by using the Children field. |
Example code (C#):
using (var api = new API()) { var projectId = 123; var authCode = Guid.NewGuid(); Task_v4 subTreeRoot; var ret = api.ExportTaskSubTree(authCode, projectId, out subTreeRoot); if (ret != ExportTaskSubTreeRet.OK) Console.WriteLine("Error querying the subhierarchy"); }
Description:
Gets all non-deleted user groups of the company
Signature:
public GetAllUserGroupsRet GetAllUserGroups(Guid companyAuthCode, bool includeDeleted, out List<WorkerGroup_v2> groups)
Return values:
public enum GetAllUserGroupsRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| bool |
includeDeleted |
In |
Sets whether groups with deleted status are returned or not. |
| List<WorkerGroup_v2> |
groups |
Out |
The list of user groups. Collection is empty when function fails, otherwise it always contains at least 2 user groups (the company root and the one that contains the registrator user). |
Example code (C#):
using (var api = new API()) { WorkerGroup_v2[] userGroups; var ret = api.GetAllUserGroups(authCode, false, out userGroups); if (ret != GetAllUserGroupsRet.OK) Console.WriteLine("Error getting user groups") }
Description:
Gets all non-deleted users of the company
Signature:
public GetAllUsersRet GetAllUsers(Guid companyAuthCode, bool includeDeleted, out List<Worker_v2> users)
Return values:
public enum GetAllUsersRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| bool |
includeDeleted |
In |
Sets whether users with deleted status are returned or not. |
| List<Worker_v2> |
users |
Out |
The list of users. Collection is empty when function fails, otherwise it always contains at least one user (the registrator). |
Example code (C#):
using (var api = new API()) { Worker_v2[] workers; var ret = api.GetAllUsers(AuthCode, false, out workers); if (ret != GetAllUsersRet.OK) Console.WriteLine("Error getting users") }
Description:
Gets the approvable holiday requests for specific users or for the whole company
Signature:
public GetApprovableHolidayRequestsRet GetApprovableHolidayRequests(Guid CompanyAuthCode, int[] UserIds, out Holiday[] holidays)
Return values:
public enum GetApprovableHolidayRequestsRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
UserIds |
In |
Scope of users, who should be included in the response, if set to null, the whole company is included |
| Holiday[] |
holidays |
Out |
Array of Holidays |
Example code (C#):
var userIds = new[] { Worker1UserId };
using (var api = new API()) { Holiday[] holidays; var ret = api.GetApprovableHolidayRequests(AuthCode, userIds, out holidays); if (ret != GetApprovableHolidayRequestsRet.OK) { Console.WriteLine("Get approvable holiday request error: {0}", ret); } else { foreach (var h in holidays) { Console.WriteLine(string.Format("UserId: {0}, StartDate: {1}, EndDate: {2}, CategoryId: {3}, Daily duration: {4}, Number of workdays: {5}, Approved by: {6}, LastChangedAt: {7}", h.UserId, h.StartDate, h.EndDate, h.HolidayCategoryId, h.DailyDurationInMins, h.NumberOfWorkDays, h.ApprovedBy, h.LastChangedAt)); } } }
Description:
Gets the worktime modification requests for specific users or for the whole company
Signature:
public GetApprovableWorktimeModificationRequestsRet GetApprovableWorktimeModificationRequests(System.Guid CompanyAuthCode, int[] UserIds, out WorktimeModification[] worktimeModifications)
Return values:
public enum GetApprovableWorktimeModificationRequestsRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
|
In |
Scope of users, who should be included in the response, if set to null, the whole company is included |
| WorktimeModification[] |
worktimeModifications |
Out |
Array of WorktimeModifications |
Example code (C#):
var userIds = new[] { Worker1UserId };
using (var api = new API()) { WorktimeModification[] worktimeModifications; var ret = api.GetApprovableWorktimeModificationRequests(AuthCode, userIds, out worktimeModifications); if (ret != GetApprovableWorktimeModificationRequestsRet.OK) { Console.WriteLine("Get approvable modification request error: {0}", ret); } else { foreach (var wm in worktimeModifications) { Console.WriteLine("Id: {0}, Type: {1}, TaskId: {2}, StartDate: {3}, EndDate: {4}, UserId: {5}, Comment: {6}, CreateDate: {7}", wm.Id, wm.Type, wm.WorkId.ToString() ?? "", wm.StartDate, wm.EndDate, wm.UserId, wm.Comment, wm.CreateDate); } } }
Description:
Gets user IDs assigned to a worker group as supervisor.
Signature:
public GetAssignedSupervisorsToWorkerGroupRet GetAssignedSupervisorsToWorkerGroup(Guid CompanyAuthCode, int workerGroupId, out int[] userIds)
Return values:
public enum GetAssignedSupervisorsToWorkerGroupRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
workerGroupId |
In |
Id of the worker group. |
| int[] |
userIds |
Out |
The IDs of users assigned to the worker group. |
Example code (C#):
using (var api = new API()) { var groupId = 123; var authCode = Guid.NewGuid();
int[] userIds; var ret = api.GetAssignedSupervisorsToWorkerGroup(authCode, groupId, out userIds);
if (ret != GetAssignedSupervisorsToWorkerGroupRet.OK) Console.WriteLine("Error getting users assigned to worker group"); }
Description:
You can get the list of the child tasks of the task with the given taskId. Optionally you can filter out the given task itself or closed tasks/assignments. Recursively returns sub-projects and works too.
Signature:
public GetChildrenForTaskRet GetChildrenForTask(Guid CompanyAuthCode, int taskId, bool includeItself, bool includeClosedTasks, out List<Task_v4> childTasks)
Return values:
public enum GetChildrenForTaskRet { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| List<Task_v4> |
childTasks |
Out |
This is the list of the child tasks of the task with the given taskId. The information is store in the Task class. |
| bool |
includeClosedTasks |
In |
You can set whether you want to retrieve the closed tasks (and assignments) or not. |
| bool |
includeItself |
In |
You can set whether you want to retrieve the task with the given taskId or not. |
Example code (C#):
// Get a project and its child works (include itself but without closed tasks/assignments) using (API api = new API()) { Assert.AreEqual(api.GetChildrenForTask(AuthCode, Project1Id, true, false, out childTasks), GetChildrenForTaskRet.OK); } var project1 = childTasks.FirstOrDefault(t => t.Id == Project1Id); var work1 = childTasks.FirstOrDefault(t => t.Id == Work1Id);
Description:
Signature:
public GetCompanyDataCollectorReportDefinitionsRet GetCompanyDataCollectorReportDefinitions(Guid CompanyAuthCode, out DataCollectorDefinition[] definitions)
Return values:
public enum GetCompanyDataCollectorReportDefinitionsRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DataCollectorDefinition[] |
definitions |
Out |
An array of data DataCollectorDefinitions available for the company |
Example code (C#):
using (var api = new API()) { DataCollectorDefinition[] definitions; var ret = api.GetCompanyDataCollectorReportDefinitions(AuthCode, out definitions);
if (ret != GetCompanyDataCollectorReportDefinitionsRet.OK) { Console.WriteLine("Error getting company data collector defintions: {0}", ret); } else { foreach (var definition in definitions) { Console.WriteLine("Id: {0}, Name: {1}, Description: {2}", definition.Id, definition.Name, definition.Description); } } }
Description:
Gets DictionaryAutoRuleSamples assigned to the company. These samples and its parameters are the base of DictionaryAutoRules.
DictionaryAutoRules must be assigned to these samples/parameters (they also must be assigned to a ((task) or (userid and/or roleids)) (For more details see the Feature descriptions)
Signature:
public GetCompanyDictionaryAutoRuleSamplesRet GetCompanyDictionaryAutoRuleSamples(Guid CompanyAuthCode, out List<DictionaryAutoRuleSample> dictionaryAutoRuleSamples)
Return values:
public enum GetCompanyDictionaryAutoRuleSamplesRet { OK, UnknownError, AuthCodeNotValid, AccessDenied //returns if the user is trying to get data from a different company }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DictionaryAutoRuleSample[] |
dictionaryAutoRuleSamples |
Out |
DictionaryAutoRuleSamples and its parameters assigned to the company |
Example code (C#):
DictionaryAutoRuleSample[] dictionaryAutoRuleSamples; using (API api = new API()) { var result = api.GetCompanyDictionaryAutoRuleSamples(AuthCode, out dictionaryAutoRuleSamples); }
Description:
Gets the cost centers for the company
Signature:
public CostCenter[] GetCostCenters(Guid companyAuthCode)
Return values:
CostCenter[]
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
Example code (C#):
using (var api = new API.API()) { var costCenters = api.GetCostCenters_v2(AuthCode);
foreach (var costCenter in costCenters) { Console.WriteLine("Cost center id: {0}, Cost center name: {1}, Cost center ext id: {2}, Default cost center: {3}, Description: {4}, Cost center billing information company name: {5}, Cost center billing information city: {6}", costCenter.Id, costCenter.Name, costCenter.ExtId, costCenter.IsDefault, costCenter.Description, costCenter.BillingInformation != null ? costCenter.BillingInformation.CompanyName : "", costCenter.BillingInformation != null ? costCenter.BillingInformation.City : ""); } }
Description:
Gets the native "Task time by day" report for users
Signature:
public GetDailyWorktimeReportRet GetDailyWorktimeReport(Guid CompanyAuthCode, DateTime StartDate, DateTime EndDate, int[] taskIdList, int[] userIdList, int[] workerGroupIds, out DailyWorktimeReport Report)
Return values:
public enum GetDailyWorktimeReportRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company |
| DateTime |
StartDate |
In |
Start date of the report |
| DateTime |
EndDate |
In |
End date of the report |
| int[] |
taskIdList |
In |
Array of task ids, that should be included in the report, if set to null, all tasks are included |
| int[] |
userIdList |
In |
Array of user ids, that should be included in the report, if set to null, all users are included |
| int[] |
workerGroupIds |
In |
Array of workgroup ids, that should be included in the report, if set to null, all workgroups are included |
| DailyWorktimeReport |
Report |
Out |
Report data, which is a class of DailyWorktimeReport |
Example code (C#):
DateTime startDate = new DateTime(2017, 1, 10); DateTime endDate = new DateTime(2017, 1, 11);
using (var api = new API()) { DailyWorktimeReport report; var ret = api.GetDailyWorktimeReport(AuthCode, startDate, endDate, null, null, null, out report);
if (ret != GetDailyWorktimeReportRet.OK) Console.WriteLine("Error getting daily worktime report, error code: {0}", ret); }
Description:
Gets a data collector report from the website
Signature:
public GetDataCollectorReportRet GetDataCollectorReport(Guid CompanyAuthCode, DateTime utcStartDate, DateTime utcEndDate, int[] userIdList, int[] workerGroupIds, int DefinitionId, int minimalTimeForIdleStatusInSec, out DataCollectorReport Report)
Return values:
public enum GetDataCollectorReportRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DateTime |
utcStartDate |
In |
The start date of the report is given in UTC. The "time" part of the date is respected as well, therefore you can query the report for only non-whole days as well (e.g. only for the last 5 minutes). We use this interval for every user regardless of their time zone settings. |
| DateTime |
utcEndDate |
In |
The end date of the report is given in UTC. The "time" part of the date is respected as well, therefore you can query the report for only non-whole days as well (e.g. only for the last 5 minutes). We use this interval for every user regardless of their time zone settings. |
| int[] |
userIdList |
In |
Array of user ids, that should be included in the report, if set to null, all users are included |
| int[] |
workerGroupIds |
In |
Array of workgroup ids, that should be included in the report, if set to null, all workgroups are included |
| int |
DefinitionId |
In |
The id of the data collector definition. You can see this Id on the website in the table on the "Custom report definitions" page. |
| int |
minimalTimeForIdleStatusInSec |
In |
Value for determining the idle time in the reports, only times over the given value will be considered as idle time |
| DataCollectorReport |
Report |
Out |
Report data, which is a class of DataCollectorReport |
Example code (C#):
var startDate = new DateTime(2015, 10, 1); var endDate = new DateTime(2015, 10, 2);
using (var api = new API()) { DataCollectorReport report; var ret = api.GetDataCollectorReport(AuthCode, startDate, endDate, null, null, definitionId, 120, out report);
if (ret != GetDataCollectorReportRet.OK) { Console.WriteLine("Error getting data collector report, Id {0}, error code: {1}", definitionId, ret); } else { Console.WriteLine("Listing report content information for {0} result sets:", report.ResultSet.Tables.Length); foreach (var dataTable in report.ResultSet.Tables) { Console.WriteLine("Result set name: {0}", dataTable.TableName); Console.WriteLine("The dataset has {0} column(s) and {1} row(s)", dataTable.Columns.Length, dataTable.Rows.Length);
if (dataTable.Hide.HasValue && dataTable.Hide.Value) Console.WriteLine("The dataset should be hidden when rendering the output for user"); else Console.WriteLine("The dataset should be shown when rendering the output for user");
Console.WriteLine(dataTable.Delete ? "The dataset should be deleted before rendering the output for user" : "The dataset should not be deleted when rendering the output for user"); } } }
Description:
Get the effective settings for one or more users, the effective settings are divided into section as it can be seen on the website
Signature:
public GetEffectiveSettingsForUsersRet GetEffectiveSettingsForUsers(Guid CompanyAuthCode, int[] userIds, out UserEffectiveSetting[] effectiveSettings)
Return values:
public enum GetEffectiveSettingsForUsersRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
userIds |
In |
Array of user ids, that should be included in the report, if set to null empty response is returned |
| UserEffectiveSetting[] |
effectiveSettings |
Out |
Effective settings list for the given users. The settings are stored in the UserEffectiveSetting class |
Example code (C#):
using (var api = new API()) { UserEffectiveSetting[] effectiveSettings; var ret = api.GetEffectiveSettingsForUsers(AuthCode, new[] { Worker1UserId }, out effectiveSettings);
if (ret != GetEffectiveSettingsForUsersRet.OK) { Console.WriteLine("Error getting effective settings, error code: {0}", ret); } else { foreach (var es in effectiveSettings) { Console.WriteLine("Effective settings for UserId: {0}\n", es.UserId);
var ces = es.CoreTime;
Console.WriteLine("Coretime settings:"); Console.WriteLine("Core time start: {0},\nCore time finish: {1},\nMinimum worktime during coretime: {2},\nLatest start: {3} (mins),\nEarliest finish: {4} (mins)\n", TimeSpan.FromMinutes(ces.StartTime), TimeSpan.FromMinutes(ces.EndTime), TimeSpan.FromMinutes(ces.MinimumWorkTime), ces.StartOffset, ces.EndOffset);
var cles = es.Client;
var ruleRestrictions = new List<string>();
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotOverrideRules)) ruleRestrictions.Add("RuleRestrictionsCannotOverrideRules");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotCreateOrModifyRules)) ruleRestrictions.Add("RuleRestrictionsCannotCreateOrModifyRules");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotCreateOrModifyRules) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanModifyRuleTitle)) ruleRestrictions.Add("RuleRestrictionsCanModifyRuleTitle");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule)) ruleRestrictions.Add("RuleRestrictionsCannotUseAnyOkValueForLearningRule");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkDefault)) ruleRestrictions.Add("RuleRestrictionsCanUseOkDefault");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkUntilWindowClosed)) ruleRestrictions.Add("RuleRestrictionsCanUseOkUntilWindowClosed");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkForOneHour)) ruleRestrictions.Add("RuleRestrictionsCanUseOkForOneHour");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkForOneDay)) ruleRestrictions.Add("RuleRestrictionsCanUseOkForOneDay");
Console.WriteLine("Client settings:"); Console.WriteLine("Business hours: {0} - {1},\nLongest inactivity during business hours: {2},\nLongest inactivity outsider business hours: {3},\n" + "Longest offline work triggered by inactivity: {4}\nAd-hoc offline work maximum length: {5}\n" + "Rule restrictions: {6}\nScreenshot quality: {7},\n" + "Microsoft Internet Explorer® waiting time threshold: {8} (ms),\nMax offline workitems: {9}\nMultiple device login: {10},\n" + "Default task: {11},\n" + "Use email subjects for generating unique mail identifier into the incoming and outgoing mails: {12}\n", TimeSpan.FromMinutes(cles.WorktimeStartInMins), TimeSpan.FromMinutes(cles.WorktimeEndInMins), TimeSpan.FromMinutes(cles.DuringWorkTimeIdleInMins), TimeSpan.FromMinutes(cles.AfterWorktimeIdleInMins), TimeSpan.FromMilliseconds(cles.DuringWorkTimeIdleManualIntervalInMilisec), TimeSpan.FromMilliseconds(cles.MaxManualMeetingIntervalInMilisec), ruleRestrictions.Count > 0 ? string.Join(", ", ruleRestrictions) : "Not set", cles.ScreenshotQuality, cles.BusyTimeThreshold, cles.MaxOfflineWorkItems, cles.CoincidentalClientsEnabled, cles.DefaultTaskId, cles.IsOutlookAddinMailTrackingUseSubject);
var mes = es.Meeting;
Console.WriteLine("Meeting settings:"); Console.WriteLine("Synchronization of Microsoft Office Outlook® created meetings: {0},\nSynchronization of IBM (Lotus) Notes created meetings: {1}\n" + "Default meeting task: {2},\nMandatory offline work subject: {3},\n" + "Offline work requested automatically (calendar): {4},\nSyncronize meeting updates: {5},\nOffline work time longer than or equal to 24 hours can be approved: {6},\n" + "Retain overlapping working time: {7},\nSynchronization of tentative meetings: {8}\n", mes.EnableMeetingTracking, mes.EnableLotusNotesMeetingTracking, mes.DefaultTaskId.HasValue ? mes.DefaultTaskId.Value.ToString() : "Not set", mes.IsMeetingSubjectMandatory, mes.IsOfflineWorkingTimeRequestAutomatic, mes.SynchronizeCalendarMeetingModifications, mes.AllowApprovalOfMeetingsLongerOrEqualThan24Hours, mes.KeepMeetingParallelWorktime, mes.AreTentativeMeetingsSynched);
var moes = es.Mobile;
Console.WriteLine("Mobile settings:"); Console.WriteLine("Record locations: {0},\nMaximum length of private call in active time: {1},\nInactivity triggered logout (outside working time): {2}\n" + "Longest conversation without administration (multiple device login): {3}\n", moes.LocationTrackMode, TimeSpan.FromMinutes(moes.PrivateCallDuration), TimeSpan.FromMinutes(moes.AfterWorkTimeIdleMinutes), TimeSpan.FromMinutes(moes.WorkCallDuration));
var ies = es.IncidentManager;
Console.WriteLine("Incident manager settings are not listed as this function is obsolete, only kept for backward compatibility.\n");
var oes = es.Other;
var taskMandatoryFields = new List<string>();
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.Priority)) taskMandatoryFields.Add("TaskMandatoryFieldPriority");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.StartEndDate)) taskMandatoryFields.Add("TaskMandatoryFieldStartEndDate");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.PlannedWorkTime)) taskMandatoryFields.Add("TaskMandatoryFieldPlannedWorkTime");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.Description)) taskMandatoryFields.Add("TaskMandatoryFieldDescription");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.Category)) taskMandatoryFields.Add("TaskMandatoryFieldCategory");
var taskAssignmentMandatoryFields = new List<string>();
if (oes.TaskAssignmentMandatoryFields.HasFlag(AssignmentMandatoryFields.StartEndDate)) taskAssignmentMandatoryFields.Add("TaskAssignmentMandatoryFieldStartEndDate");
if (oes.TaskAssignmentMandatoryFields.HasFlag(AssignmentMandatoryFields.PlannedWorkTime)) taskAssignmentMandatoryFields.Add("TaskAssignmentMandatoryFieldPlannedWorkTime");
Console.WriteLine("Other settings:"); Console.WriteLine("Cost center id: {0},\nTime zone id: {1},\nCalendar id: {2},\nDaily working time: {3},\n" + "Mandatory task/project attributes: {4},\nMandatory task assignment attributes: {5},\n" + "Deadline for modifying working time: {6} (hours),\nMinimum number of active users in group: {7},\nMinimum percent of active users in group: {8}\n", oes.CostCenterId, oes.TimeZoneId, oes.CalendarId, TimeSpan.FromMinutes(oes.DailyWorkTimeInMinutes), taskMandatoryFields.Count > 0 ? string.Join(", ", taskMandatoryFields) : "Not set", taskAssignmentMandatoryFields.Count > 0 ? string.Join(", ", taskAssignmentMandatoryFields) : "Not set", oes.ManualWorkItemEditAgeLimit, oes.MinNumOfActiveUsersInGroup, oes.MinPercentOfActiveUsersInGroup); } } }
Description:
Gets a custom report saved as favorite for the registrator user. The query parameters (users, period, other report-specific parameters) are given on the Website's UI, when the custom report is saved as favorite.
Signature:
public GetFavoriteCustomReportRet GetFavoriteCustomReport(Guid CompanyAuthCode, int favoriteReportId, out DataCollectorReport Report))
Return values:
public enum GetFavoriteCustomReportRet { OK, ErrorInReportExecution, FavoriteReportTypeIsNotCustom, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
favoriteReportId |
In |
The Id of the saved favorite report. You can get this value when you are logged in the website and pointing your mouse on the favorite report's "download excel" button on Central Reports page. The Id is visible in the status bar. |
| DataCollectorReport |
Report |
Out |
Report data, which is a class of DataCollectorReport |
Example code (C#):
var parameterId = 1234;
using (var api = new API()) { DataCollectorReport report; var ret = api.GetFavoriteCustomReport(AuthCode, parameterId, out report);
if (ret != GetFavoriteCustomReportRet.OK) { Console.WriteLine("Error getting report, Id {0}, error code: {1}", parameterId, ret); } else { Console.WriteLine("Listing report content information for {0} result sets:", report.ResultSet.Tables.Length); foreach (var dataTable in report.ResultSet.Tables) { Console.WriteLine("Result set name: {0}", dataTable.TableName); Console.WriteLine("The dataset has {0} column(s) and {1} row(s)", dataTable.Columns.Length, dataTable.Rows.Length);
if (dataTable.Hide.HasValue && dataTable.Hide.Value) Console.WriteLine("The dataset should be hidden when rendering the output for user"); else Console.WriteLine("The dataset should be shown when rendering the output for user");
Console.WriteLine(dataTable.Delete ? "The dataset should be deleted before rendering the output for user" : "The dataset should not be deleted when rendering the output for user"); } } }
Description:
Gets the holiday categories for the company.
Signature:
public GetHolidayCategoriesRet GetHolidayCategories(Guid CompanyAuthCode, out HolidayCategory[] holidayCategories)
Return values:
public enum GetHolidayCategoriesRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| HolidayCategory[] |
holidayCategories |
Out |
This list holds all the holiday categories of the company. The information is stored in an object which is type of HolidayCategory. |
Example code (C#):
HolidayCategory[] holidayCategories; using (API api = new API()) { api.GetHolidayCategories(AuthCode, out holidayCategories); }
// find the holiday category you want and process it var holidayCategory = holidayCategories.First(); int holidayCategoryId = holidayCategory.Id; string RGBColorCode = holidayCategory.RGBColorCode; // e.g. "ffffff" string name = holidayCategory.Name; // e.g. "Study Leave" bool paid = holidayCategory.Paid; // e.g. true byte rank = holidayCategory.Rank; // e.g. 1 bool requestable = holidayCategory.Requestable; //e.g. true
Description:
Gets the holidaylimits for a specific user.
Signature:
public GetHolidayLimitsOfUserRet GetHolidayLimitsOfUser(Guid CompanyAuthCode, int userId, out HolidayLimit[] holidayLimits)
Return values:
public enum GetHolidayLimitsOfUserRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
This is the Id of the specified user. |
| HolidayLimit[] |
holidayLimits |
Out |
This list holds all the holidayLimits of a the given user. The information is stored in the HolidayLimit class |
Example code (C#):
var userId = 1234567; HolidayLimit[] holidayLimits; using (API api = new API()) { api.GetHolidayLimitsOfUser(AuthCode, userId, out holidayLimits); }
Description:
Gets the holidays for the whole company.
Signature:
public GetHolidaysForCompanyRet GetHolidaysForCompany(Guid CompanyAuthCode, out Holiday[] holidays)
Return values:
public enum GetHolidaysForCompanyRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| Holiday[] |
holidays |
Out |
This list holds all the holidays for the whole company. The information is stored in the Holiday class. |
Example code (C#):
Holiday[] holidays; using (API api = new API()) { var ret = api.GetHolidaysForCompany(AuthCode, out holidays);
if (ret == GetHolidaysForCompanyRet.OK && holidays.Length > 0) { // find the holiday you want and process it var holiday = holidays.First(); var dailyDurationInMins = holiday.DailyDurationInMins; //e.g. 8 * 60 var approvedBy = holiday.ApprovedBy; // null or approverId var userId = holiday.UserId; // UserId of a worker var startDate = holiday.StartDate; // new DateTime(2014, 1, 2) var endDate = holiday.EndDate; // new DateTime(2014, 1, 3) var holidayCategoryId = holiday.HolidayCategoryId; // null or an existing holidayCategoryId var numberOfWorkDays = holiday.NumberOfWorkDays; // 2 days } }
Description:
Gets the holidays for a user.
Signature:
public GetHolidaysOfUserRet GetHolidaysOfUser(Guid CompanyAuthCode, int userId, out Holiday[] holidays)
Return values:
public enum GetHolidaysOfUserRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
This is the Id of the specified user. |
| Holiday[] |
holidays |
Out |
This list holds all the holidays of a the given user. The information is stored in the Holiday class. |
Example code (C#):
Holiday[] holidays; using (API api = new API()) { api.GetHolidaysOfUser(AuthCode, Worker1UserId, out holidays); }
// find the holiday you want and process it var holiday = holidays.First(); var dailyDurationInMins = holiday.DailyDurationInMins; //e.g. 8 * 60 var approvedBy = holiday.ApprovedBy; // null or approverId var userId = holiday.UserId; // UserId of a worker var startDate = holiday.StartDate; // new DateTime(2014, 1, 2) var endDate = holiday.EndDate; // new DateTime(2014, 1, 3) var holidayCategoryId = holiday.HolidayCategoryId; // null or an existing holidayCategoryId var numberOfWorkDays = holiday.NumberOfWorkDays; // 2 days
Description:
Gets all manual workitems for the user in the given period.
Signature:
public GetManualWorkitemsRet GetManualWorkitemsOfUser(Guid companyAuthCode, int targetUserId, DateTime startDateInUtc, DateTime endDateInUtc, out List<ManualWorkItem> manualWorkitemsOfUser)
Return values:
public enum GetManualWorkitemsRet { OK, UnknownError, AuthCodeInvalid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user. |
| DateTime |
startDateInUtc |
In |
Start date of the query interval in UTC. |
| DateTime |
endDateInUtc |
In |
End date of the query interval in UTC. |
| List<ManualWorkItem> |
manualWorkitemsOfUser |
Out |
The user's manualworkitems in the queried period. The information is stored in the ManualWorkItem |
Example code (C#):
using (var api = new API()) { var authCode = Guid.NewGuid(); var targetUserId = 123456; var startDateInUtc = DateTime.UtcNow.AddMonths(-1); var endDateInUtc = DateTime.UtcNow; ManualWorkItem[] manualWorkitemsOfUser;
var ret = api.GetManualWorkitemsOfUser(AuthCode, targetUserId, startDateInUtc, endDateInUtc, out manualWorkitemsOfUser);
if (ret != GetManualWorkitemsRet.OK) Console.WriteLine("Error getting manualworkitems of the user"); else { foreach (var manualWorkitem in manualWorkitemsOfUser) { Console.WriteLine($"Id: {manualWorkitem.Id} ManualWorkItemType: {manualWorkitem.ManualWorkItemType.ToString()}, TaskId: {manualWorkitem.TaskId} StartDate: {manualWorkitem.StartDate} EndDate: {manualWorkitem.EndDate} UserId: {manualWorkitem.UserId} Comment: {manualWorkitem.Comment} CreateDate: {manualWorkitem.CreateDate} CreatedBy: {manualWorkitem.CreatedBy}"); } } }
Description:
Gets the tasks and assignments changed since the last version number. Please note, that the resulting hierarchy might contain parent tasks which were not changed but their child was, so always check version numbers of tasks.
Signature:
public GetModifiedTasksRet GetModifiedTasks_v2(Guid CompanyAuthCode, long lastTaskVersion, long lastAssignmentVersion, out TaskHierarchy_v2 ModifiedTasks)
Return values:
public enum GetModifiedTasksRet { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| long |
lastAssignmentVersion |
In |
This is the last known task assignment version. Result contains only task assignments having greater version number. |
| long |
lastTaskVersion |
In |
This is the last known task/project version. Result contains only tasks having greater version number. |
| TaskHierarchy_v2 |
ModifiedTasks |
Out |
This hierarchy contains the tasks which were modified since the last given version. When no tasks are modified this hierarchy is empty (i.e. contains only the root task). The information is stored in the TaskHierarchy_v2 class |
Example code (C#):
TaskHierarchy_v2 modifiedhierarchy; using (API api = new API()) { // get all the tasks by passing 0 as version api.GetModifiedTasks_v2(AuthCode, 0, 0, out modifiedhierarchy); } var someProject = modifiedhierarchy.Root.Children[0]; var someWork = someProject.Children[0]; var someAssignment = someWork.AssignedTo[0]; var lastTaskVersion = GetGreatestTaskVersion(modifiedhierarchy); var lastTaskAssignmentVersion = GetGreatestTaskAssignmentVersion(modifiedhierarchy); // get modified tasks an hour later... using (API api = new API()) { // get only the changed tasks since the last check by passing the last version numbers api.GetModifiedTasks_v2(AuthCode, lastTaskVersion, lastTaskAssignmentVersion, out modifiedhierarchy); }
Description:
Gets the organization hierarchy of the company from JC360.
Signature:
public GetOrganizationHierarchyRet GetOrganizationHierarchy(Guid CompanyAuthCode, out OrganizationHierarchy Hierarchy, bool IncludeDeletedUsers)
Return values:
public enum GetOrganizationHierarchyRet { OK, // Import was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| OrganizationHierarchy |
Hierarchy |
Out |
This class describes the structure of your organization, how workers are classified. This class only has a Root property which is a RootWorkerGroup typed object. OrganizationHierarchy consists of OrganizationHierarchyItem objects. OrganizationHierarchyItem is the base class of RootWorkerGroup, WorkerGroup and Worker classes are used for classification. Each class derives from base class which has the specific properties. |
| bool |
IncludeDeletedUsers |
In |
Specifies whether deleted users are returned or not. |
Example code (C#):
OrganizationHierarchy hierarchy; Guid AuthCode = Guid.Parse("YourCompanyAuthCodeHere"); using (API api = new API()) { api.GetOrganizationHierarchy(AuthCode, false, out hierarchy); }
// traverse hierarchy and export them to external system var rootGroup = hierarchy.Root as as RootWorkerGroup; var group1 = rootGroup.Children[0] as WorkerGroup; var user1 = group1.Children[0] as Worker;
Description:
Gets the planning periods for the company. Planning periods are used at project budget planning.
Signature:
public GetPlanningPeriodsRet GetPlanningPeriods(Guid CompanyAuthCode, out PlanningPeriod[] planningPeriods)
Return values:
public enum GetPlanningPeriodsRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| PlanningPeriod[] |
planningPeriods |
Out |
A list of planning periods defined at the company, the periods are stored in the PlanningPeriod class |
Example code (C#):
using (var api = new API()) { PlanningPeriod[] planningPeriods; var ret = api.GetPlanningPeriods(AuthCode, out planningPeriods);
if (ret != GetPlanningPeriodsRet.OK) { Console.WriteLine("Error getting planning periods for the company, error code is {0}", ret); } else { foreach (var pp in planningPeriods) { Console.WriteLine("Period id: {0}, period name: {1}, period start date: {2}, period end date: {3}, is default: {4}", pp.PeriodId, pp.Name, pp.StartDate, pp.EndDate, pp.IsDefault); } } }
Description:
Gets the member(s) of a given project
Signature:
public GetProjectMembersOfProjectRet GetProjectMembersOfProject(Guid CompanyAuthCode, int ProjectId, out ProjectMembership[] result)
Return values:
public enum GetProjectMembersOfProjectRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
ProjectId |
In |
The id of the project, which takes part in the operation |
| ProjectMembership[] |
result |
Out |
A list of project membership information, the information stored in the ProjectMembership class |
Example code (C#):
using (var api = new API()) { PlanningPeriod[] planningPeriods; var ret = api.GetPlanningPeriods(AuthCode, out planningPeriods);
if (ret != GetPlanningPeriodsRet.OK) { Console.WriteLine("Error getting planning periods for the company, error code is {0}", ret); } else { foreach (var pp in planningPeriods) { Console.WriteLine("Period id: {0}, period name: {1}, period start date: {2}, period end date: {3}, is default: {4}", pp.PeriodId, pp.Name, pp.StartDate, pp.EndDate, pp.IsDefault); } } }
Description:
Get the company's native "Project report" for the specified time interval. The structure (and ordering) of the result is the same as the layout of the Excel retrieved from website. Check it there.
Signature:
public GetProjectReportRet GetProjectReport_v2(Guid CompanyAuthCode, DateTime StartDate, DateTime EndDate, out ProjectReportHierarchy_v2 Report, int[] taskIdList, int[] userIdList)
Return values:
public enum GetProjectReportRet { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DateTime |
StartDate |
In |
StartDate of the report interval. |
| DateTime |
EndDate |
In |
EndDate of the report interval. |
| int[] |
userIdList |
In |
Filter for specific users. Leave parameter null to avoid filtering. |
| int[] |
taskIdList |
In |
Filter for specific tasks. Leave parameter null to avoid filtering. |
| ProjectReportHierarchy_v2 |
Report |
Out |
The resulting report in a hierarchical structure. The information is stored in an object which is type of ProjectReportHierarchy_v2 |
Example code (C#):
DateTime startDate = new DateTime(2013, 1, 10); DateTime endDate = new DateTime(2013, 1, 15); ProjectReportHierarchy_v2 report;
// get the report using (API api = new API()) { api.GetProjectReport_v2(AuthCode, startDate, endDate, null, null, out report); }
// get root of the hierarchy (company-wide total costs and times) var totalTime = report.Root.TotalTime; // value in ms; var totalCost = report.Root.InnerTotalCost;
// get a containing project (Type is ProjectReportItemType.Project, has no UserId defined) var projectId = report.Root.Children[0].TaskId; var projectTotalTime = report.Root.Children[0].TotalTime; // value in ms; var projectTotalCost = report.Root.Children[0].InnerTotalCost;
// get a containing work in project (Type is ProjectReportItemType.Work, has no UserId defined) var workId = report.Root.Children[0].Children[0].TaskId; var workTotalTime = report.Root.Children[0].Children[0].TotalTime; // value in ms; var workTotalCost = report.Root.Children[0].Children[0].InnerTotalCost;
// get assignments of the work which are the next siblings after the work (Type is ProjectReportItemType.AssignedWork and has UserId defined) var assignedUserId1 = report.Root.Children[0].Children[1].UserId; // e.g. worker1UserId var assignmentWorkId1 = report.Root.Children[0].Children[1].TaskId; // this is the same as workId var assignmentTotalTime1 = report.Root.Children[0].Children[1].TotalTime; // value in ms; var assignmentTotalCost1 = report.Root.Children[0].Children[1].InnerTotalCost;
var assignedUserId2 = report.Root.Children[0].Children[2].UserId; // e.g. worker2UserId var assignmentWorkId2 = report.Root.Children[0].Children[2].TaskId; // this is the same as workId var assignmentTotalTime2 = report.Root.Children[0].Children[2].TotalTime; // value in ms; var assignmentTotalCost2 = report.Root.Children[0].Children[2].InnerTotalCost;
Description:
Gets the sick leaves for the whole company.
Signature:
public GetSickLeavesForCompanyRet GetSickLeavesForCompany(Guid CompanyAuthCode, out SickLeave[] sickLeaves)
Return values:
public enum GetSickLeavesForCompanyRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| SickLeave[] |
sickLeaves |
Out |
This list holds all the sick leaves for all users of the company. The information is stored in an object which is type of SickLeave. |
Example code (C#):
SickLeave[] sickLeaves; using (API api = new API()) { api.GetSickLeavesForCompany(AuthCode, out sickLeaves); }
// find the sick leave you want and process it var sickleave = sickLeaves.First(); var dailyDurationInMins = sickleave.DailyDurationInMins; //e.g. 8 * 60 var userId = sickleave.UserId; // UserId of a worker var startDate = sickleave.StartDate; // new DateTime(2014, 1, 2) var endDate = sickleave.EndDate; // new DateTime(2014, 1, 3) var numberOfWorkDays = sickleave.NumberOfWorkDays; // 2 days
Description:
Gets the sick leaves for a user.
Signature:
public GetSickLeavesOfUserRet GetSickLeavesOfUser(Guid CompanyAuthCode, int userId, out SickLeave[] sickLeaves)
Return values:
public enum GetSickLeavesOfUserRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
This is the Id of the specified user. |
| SickLeave[] |
sickLeaves |
Out |
This list holds all the sick leaves of a the given user. The information is stored in an object which is type of SickLeave. |
Example code (C#):
using (API api = new API()) { api.GetSickLeavesOfUser(AuthCode, Worker1UserId, out sickLeaves); }
// find the sick leave you want and process it var sickleave = sickLeaves.First(); var dailyDurationInMins = sickleave.DailyDurationInMins; //e.g. 8 * 60 var userId = sickleave.UserId; // UserId of a worker var startDate = sickleave.StartDate; // new DateTime(2014, 1, 2) var endDate = sickleave.EndDate; // new DateTime(2014, 1, 3) var numberOfWorkDays = sickleave.NumberOfWorkDays; // 2 days
Description:
Gets DictionaryAutoRules that are StartWorks (its assignment is startwork). If taskid is null the method will get all of the startworks assigned to the company, if not null it will get only that are assigned to the task.
Signature:
public GetStartWorkDictionaryAutoRulesRet GetStartWorkDictionaryAutoRules(Guid CompanyAuthCode, int? taskId, out List<DictionaryAutoRule> dictionaryAutoRules)
Return values:
public enum GetStartWorkDictionaryAutoRulesRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int? |
taskId |
In |
Id of a task. If null the method will get all of the startworks assigned to the company, if not null it will get only that are assigned to the task |
| List<DictionaryAutoRule> |
dictionaryAutoRules |
Out |
StartWork DictionaryAutoRules (its assignment will be always startwork, because this is a GetStartWorkDictionaryAutoRules method) |
Example code (C#):
//taskid null DictionaryAutoRule[] dictionaryAutoRules1; using (API api = new API()) { var result = api.GetStartWorkDictionaryAutoRules(AuthCode, null, out dictionaryAutoRules1); } //taskid not null DictionaryAutoRule[] dictionaryAutoRules2; using (API api = new API()) { var result = api.GetStartWorkDictionaryAutoRules(AuthCode, taskId, out dictionaryAutoRules2); }
Description:
Gets DictionaryAutoRules that are StopWorks (its assignment is stopwork)
Signature:
public GetStopWorkDictionaryAutoRulesRet GetStopWorkDictionaryAutoRules(Guid CompanyAuthCode, out List<DictionaryAutoRule> dictionaryAutoRules)
Return values:
public enum GetStopWorkDictionaryAutoRulesRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| List<DictionaryAutoRules> |
dictionaryAutoRules |
Out |
StopWork DictionaryAutoRules (its assignment will be always stopwork, because this is a GetStopWorkDictionaryAutoRules method) |
Example code (C#):
DictionaryAutoRule[] dictionaryAutoRules; using (API api = new API()) { var result = api.GetStopWorkDictionaryAutoRules(AuthCode, out dictionaryAutoRules); }
Description:
Gets a work or project
Signature:
public GetTaskRet GetTask_V3(Guid CompanyAuthCode, int TaskId, bool IncludeClosedAssignments, out Task_v4 task)
Return values:
public enum GetTaskRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
Id of the task to get data for |
| bool |
IncludeClosedAssignments |
In |
Indicates, that the assignment list of task should also contain the closed assignments or not |
| Task_v4 |
task |
Out |
The information is stored in the Task_v4 class |
Example code (C#):
using (var api = new API()) { Task_v4 task; var ret = api.GetTask_V3(AuthCode, taskId, false, out task);
if (ret != GetTaskRet.OK) { Console.WriteLine("Error getting task data, error code: {0}", ret); } else { Console.WriteLine("Task id: {0}, name: {1}, description: {2}, category id: {3}", task.Id, task.Name, task.Description, task.CategoryId); } }
Description:
Get task categories available at the company
Signature:
public GetTaskCategoriesRet GetTaskCategories(Guid CompanyAuthCode, out TaskCategoryData[] Categories)
Return values:
public enum GetTaskCategoriesRet { OK, UnknownError, AuthCodeNotValid, }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| TaskCategoryData[] |
Categories |
Out |
A list of task categories, the information stored in the TaskCategoryData class |
Example code (C#):
using (var api = new API.API()) { TaskCategoryData[] taskCategories; var ret = api.GetTaskCategories(AuthCode, out taskCategories);
if (ret != GetTaskCategoriesRet.OK) { Console.WriteLine("Error getting task categories for company, error code is: {0}", ret); } else { foreach (var tc in taskCategories) { Console.WriteLine("Category id: {0}, category name: {1}", tc.Id, tc.Name); } } }
Description:
You can get the hierarchical structure of your tasks (projects and works) including closed tasks.
Signature:
public GetTaskHierarchyRet GetTaskHierarchy(Guid CompanyAuthCode, out TaskHierarchy_v2 TaskHierarchy, bool IncludeClosed)
Return values:
public enum GetTaskHierarchyRet { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| TaskHierarchy_v2 |
TaskHierarchy |
Out |
This is the complete hierarchical structure of your company's tasks. The information is stored in an object which is type of TaskHierarchy_v2. |
| bool |
IncludeClosed |
In |
You can set whether you want to retrieve the closed tasks or not. |
Example code (C#):
// Get Hierarchy and check whether properties are filled TaskHierarchy_v2 hierarchy; using (API api = new API()) { api.GetTaskHierarchy(AuthCode, true, out hierarchy); }
// then get the root task APIWS.Task_v2 rootTask = hierarchy.Root;
// or get children tasks var projectsUnderRoot = rootTask.Children;
// or simply flatten the complete hierarchy var tasks = rootTask.Flatten(e => e.Children);
// Misc methods for for flattening public interface IFlattenable { }
public partial class Task_v2 : IFlattenable { }
public static IEnumerable<T> Flatten<T> (this T source, Func<T, IEnumerable<T>> selector) where T : IFlattenable { yield return source;
var childSeq = selector(source); if (childSeq != null) { foreach (T item in Flatten(childSeq, selector)) { yield return item; } } }
public static IEnumerable<T> Flatten<T> (this IEnumerable<T> source, Func<T, IEnumerable<T>> selector) { foreach (T item in source) { yield return item;
var childSeq = selector(item); if (childSeq != null) { // recursive call to Traverse to get child of child ... foreach (T itemRecurse in Flatten(childSeq, selector)) { yield return itemRecurse; } } } }
Description:
Gets the currently open/closed tasks for the given user
Signature:
public GetTasksOfUserRet GetTasksOfUser_v4(Guid CompanyAuthCode, int UserId, bool ReturnClosedTasks, out Task_v4[] AssignedTasks)
Return values:
public enum GetTasksOfUserRet { OK, UnknownError, AuthCodeNotValid, }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
The id of the user for whom we are running the query |
| bool |
ReturnClosedTasks |
In |
Whether the closed task should be also returned or not |
| Task_v4[] |
AssignedTasks |
Out |
A list of tasks, the information stored in the Task_v4 class |
Example code (C#):
using (var api = new API()) { Task_v4[] tasks; var ret = api.GetTasksOfUser_v4(AuthCode, Worker1UserId, false, out tasks);
if (ret != GetTasksOfUserRet.OK) { Console.WriteLine("Error getting tasks assigned to user, error code: {0}", ret); } else { foreach (var task in tasks) { Console.WriteLine("Task id: {0}, task name: {1}, task category id: {2}, task description: {3}", task.Id, task.Name, task.CategoryId, task.Description); } } }
Description:
Gets a user
Signature:
public GetUserRet GetUser(Guid CompanyAuthCode, int userId, out Worker_v2 user)
Return values:
public enum GetUserRet { OK, UnknownError, AccessDenied, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user that needs to be get |
| Worker_v2 |
user |
Out |
The user |
Example code (C#):
using (var api = new API()) { Worker_v2 worker; var ret = api.GetUser(AuthCode, 123, out worker); if (ret != GetUserRet.OK) Console.WriteLine("Error getting User") }
Description:
Gets a user group.
Signature:
public GetUserGroupRet GetUserGroup(Guid CompanyAuthCode, int targetUserGroupId, out WorkerGroup_v2 group)
Return values:
public enum GetUserGroupRet { OK, UnknownError, AccessDenied, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserGroupId |
In |
Id of the user group about to be get. |
| WorkerGroup_v2 |
group |
Out |
The user group. |
Example code (C#):
using (var api = new API()) { var groupId = 123; var authCode = Guid.NewGuid();
WorkerGroup_v2 userGroup; var ret = api.GetUserGroup(authCode, groupId, out userGroup); if (ret != GetUserGroupRet.OK) Console.WriteLine("Error getting Group"); }
Description:
Gets DictionaryAutoRules assigned to the users provided in parameters
Signature:
public GetUsersDictionaryAutoRulesRet GetUsersDictionaryAutoRules(Guid CompanyAuthCode, List<int> userIds, out List<UsersDictionaryAutoRules> usersDictionaryAutoRules)
Return values:
public enum GetUsersDictionaryAutoRulesRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| List<int> |
userIds |
In |
Id of the users. |
| List<DictionaryAutoRule> |
usersDictionaryAutoRules |
Out |
DictionaryAutoRules assigned to the users provided in parameters |
Example code (C#):
UserDictionaryAutoRules[] usersDictionaryAutoRules; using (API api = new API()) { var result = api.GetUsersDictionaryAutoRules(AuthCode, new int[] { userId }, out usersDictionaryAutoRules); }
Description:
Gets the company's native "Workflow" report for the specified time period
Signature:
public GetWorkflowReportRet GetWorkflowReport(Guid CompanyAuthCode, DateTime StartDate, DateTime EndDate, int[] userIdList, int[] workerGroupIds, int[] taskIdList, out WorkFlowReport Report)
Return values:
public enum GetWorkflowReportRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DateTime |
StartDate |
In |
First day of the period |
| DateTime |
EndDate |
In |
Last day of the period |
| int[] |
userIdList |
In |
Array of user ids, that should be included in the report, if set to null, all users are included |
| int[] |
workerGroupIds |
In |
Array of workgroup ids, that should be included in the report, if set to null, all workgroups are included |
| int[] |
taskIdList |
In |
Array of task ids, that should be included in the report, if set to null, all tasks are included |
| WorkFlowReport |
Report |
Out |
The information is stored in the WorkFlowReport class |
Example code (C#):
using (var api = new API()) { var startDate = new DateTime(2018, 1, 1); var endDate = new DateTime(2018, 1, 5); WorkFlowReport workflowReport;
var ret = api.GetWorkflowReport(AuthCode, startDate, endDate, null, null, null, out workflowReport);
if (ret != GetWorkflowReportRet.OK) { Console.WriteLine("Error getting workflow report, error code: {0}", ret); } else { foreach (var item in workflowReport.WorkFlowView) { Console.WriteLine("User id: {0}, User last name: {1}, User first name: {2}, Item start date {3}, Item end date: {4}, Task name: {5}", item.UserId, item.LastName, item.FirstName, item.StartDate, item.EndDate, item.TaskName); } } }
Description:
Gets the company's native "Working time by day" report for the specified time interval
Signature:
public GetWorktimeReportRet GetWorktimeReport(Guid companyAuthCode, DateTime startDay, DateTime endDay, int[] userIdList, int[] workerGroupIds, out WorktimeReport Report)
Return values:
public enum GetWorktimeReportRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DateTime |
startDate |
In |
First day of the period |
| DateTime |
endDay |
In |
Last day of the period |
| int[] |
userIdList |
In |
Array of user ids, that should be included in the report, if set to null, all users are included |
| int[] |
workerGroupIds |
In |
Array of workgroup ids, that should be included in the report, if set to null, all workgroups are included |
| WorktimeReport |
Report |
Out |
The information is stored in the WorktimeReport class |
Example code (C#):
using (var api = new API()) { var startDate = new DateTime(2018, 1, 1); var endDate = new DateTime(2018, 1, 5); WorktimeReport worktimeReport;
var ret = api.GetWorktimeReport(AuthCode, startDate, endDate, null, null, out worktimeReport);
if (ret != GetWorktimeReportRet.OK) { Console.WriteLine("Error getting worktime report, error code: {0}", ret); } else { foreach (var item in worktimeReport.WorktimeReportDataList) { Console.WriteLine("User id: {0}, Active computer time in ms: {1}, Ad hoc meeting time in ms {2}, Idle time in ms: {3}", item.UserId, item.ActiveComputerWorkTimeMs, item.AdhocMeetingTimeMs, item.IdleComputerWorkTimeMs); } } }
Description:
Gets the worktime schedules (shifts) of the users within a time interval
Signature:
public GetWorktimeSchedulesOfUsersRet GetWorktimeSchedulesOfUsers(Guid companyAuthCode, List<int> targetUserIds, DateTime startDate, DateTime endDate, out WorktimeSchedule[] worktimeSchedules)
Return values:
public enum GetWorktimeSchedulesOfUsersRet { OK, UnknownError, AuthCodeNotValid, }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
targetUserIds |
In |
Array of user Ids. If null, all userIds will be included in the company |
| DateTime |
startDate |
In |
Minimum start date of the schedules |
| DateTime |
endDate |
In |
Maximum end date of the schedules |
| WorktimeSchedule[] |
worktimeSchedules |
Out |
Array of WorkTimeSchedules |
Example code (C#):
WorktimeSchedule[] resultSchedules; var rangeStart = DateTime.UtcNow; var rangeEnd = DateTime.UtcNow.AddDays(1); using (API api = new API()) { var ret = api.GetWorktimeSchedulesOfUsers(AuthCode, null, rangeStart, rangeEnd, out resultSchedules);
if (ret != GetWorktimeSchedulesOfUsersRet.OK) Console.WriteLine("Error getting WorktimeSchedules of users") }
Description:
Gets the worktime schedules (shifts) of the users within a time interval
Signature:
public GetWorktimeSchedulesOfUsersRet_v2 GetWorktimeSchedulesOfUsers_v2(Guid companyAuthCode, List<int> targetUserIds, DateTime startDate, DateTime endDate, out WorktimeSchedule_v2[] worktimeSchedules)
Return values:
public enum GetWorktimeSchedulesOfUsersRet_v2 { OK, UnknownError, AuthCodeNotValid, }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int[] |
targetUserIds |
In |
Array of user Ids. If null, all userIds will be included in the company |
| DateTime |
startDate |
In |
Minimum start date of the schedules |
| DateTime |
endDate |
In |
Maximum end date of the schedules |
| WorktimeSchedule_v2[] |
worktimeSchedules |
Out |
Array of WorkTimeSchedules |
Example code (C#):
WorktimeSchedule_v2[] resultSchedules; var rangeStart = DateTime.UtcNow; var rangeEnd = DateTime.UtcNow.AddDays(1); using (API api = new API()) { var ret = api.GetWorktimeSchedulesOfUsers_v2(AuthCode, null, rangeStart, rangeEnd, out resultSchedules);
if (ret != GetWorktimeSchedulesOfUsersRet_v2.OK) Console.WriteLine("Error getting WorktimeSchedules of users") }
Description:
Imports a leaves and schedules from a predefined excel workbook structure.
Signature:
public ImportLeavesAndSchedulesFromExcelRet ImportLeavesAndSchedulesFromExcel(Guid CompanyAuthCode, byte[] excel, UserIdentifierType userIdentifierType, bool overWriteImportedPeriod, bool skipNotFoundUserRows, out List<LeavesAndSchedulesImportError> importErrors)
Return values:
public enum ImportLeavesAndSchedulesFromExcelRet { AuthCodeNotValid, SubscriptionExpired, AccessDenied, UserIdentifierTypeInvalid, ImportFailed, OK, UnknownError }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| byte[] |
excel |
In |
The base64 encoded excel workbook containing the leaves and schedules. |
| UserIdentifierType |
userIdentifierType |
In |
Identifier type, possible values: UserId, ExtId, Email, ADName |
| bool |
overWriteImportedPeriod |
In |
Bool value to determine whether to merge imported data with existing (with no deletion on empty imported days) or overwrite it (with deletion on empty imported days). |
| bool |
skipNotFoundUserRows |
In |
Bool value to determine whether to skip corresponding rows of unidentified users (and commit the remaining valid rows) or rollback everything made. |
| List<LeavesAndSchedulesImportError> |
excelImportErrors |
Out |
The list of all the errors throughout the import process |
Example code (C#):
using (var api = new API()) { var authCode = Guid.NewGuid();
var errors = new List<ImportError> var excel = "UEsDBBQABgAIAAAAIQBE/mk9fQEAAPgFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAA..." var ret = api.ImportLeavesAndSchedulesFromExcel(authCode, excel, UserIdentifierType.ExtId, true, false, out errors);
if (ret != ImportLeavesAndSchedulesFromExcelRet.OK) Console.WriteLine("Error importing leaves and schedules");
foreach(var error in errors) Console.WriteLine(String.Format("Message: {0} IsWarning: {1}", error.Message, error IsWarning)); }
Description:
Imports a task subtree. It only creates and updates tasks and assignments. Deletion is not supported.
Signature:
public ImportTaskSubTreeRet ImportTaskSubTree(Guid CompanyAuthCode, Task_v4 SubTreeRoot)
Return values:
public class ImportTaskSubTreeRet { public ImportTaskSubTreeErrorCode GeneralErrorCode; public ImportTaskSubTreeError[] Errors; }
public enum ImportTaskSubTreeErrorCode { OK, UnknownError, AuthCodeNotValid, ErrorWithDetails, }
public class ImportTaskSubTreeError { public int TaskId; public int? UserId; public string ErrorMessage; }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| Task_v4 |
SubTreeRoot |
In |
This is the root of the (sub)hierarchy. Its children will be processed and validated at once, so you do not have to handle the order of the modifications and creations. |
Example code (C#):
using (var api = new API()) { var projectId = 123; var authCode = Guid.NewGuid(); Task_v4 subTreeRoot; api.ExportTaskSubTree(authCode, projectId, out subTreeRoot); // add a new project + task + assignment var newProject = new Task_v4 { Id = 0, Type = TaskType.Project, Status = TaskStatus.Active, Name = "NewProject1", ParentId = subTreeRoot.Id, ExtId = "MyProjectExtId", TargetCost = 500, TargetStartDate = new DateTime(2022, 6, 1), TargetEndDate = new DateTime(2022, 7, 1), TargetPlannedWorkTimeInMinutes = 500, };
var newTask = new Task_v4 { Id = 0, Type = TaskType.Work, Status = TaskStatus.Active, Name = "NewTask", ParentId = 0, ExtId = "MyTaskExtId", TargetCost = 500, TargetStartDate = new DateTime(2022, 6, 1), TargetEndDate = new DateTime(2022, 7, 1), TargetPlannedWorkTimeInMinutes = 500, Description = "Descr", };
var newAssignment = new TaskAssignment_v4 { UserId = user2Id, StartDate = new DateTime(2022, 6, 1), EndDate = new DateTime(2022, 7, 1), Status = TaskStatus.Active, PlannedWorkTimeInMinutes = 500, };
var newChildTree = subTreeRoot.Children.ToList(); newChildTree.Add(newProject); subTreeRoot.Children = newChildTree.ToArray(); newProject.Children = new[] { newTask }; newTask.AssignedTo = new[] { newAssignment };
// do the import var importRet = api.ImportTaskSubTree(_authCode, subTreeRoot);
// process the errors if (importRet.GeneralErrorCode == ImportTaskSubTreeErrorCode.ErrorWithDetails) { foreach (var error in importRet.Errors) Console.WriteLine(String.Format("TaskId: {0} | UserId: {1} | ErrorMessage: {2}", error.TaskId, error.UserId, error.ErrorMessage)); } }
Description:
Imports users and groups into JC360. You should always pass in the whole hierarchy even if only a single worker or group was changed. When imported groups/workers are missing from JC360, those are created. When specific groups/workers are not imported but they are existing in JobCTRL, groups/workers become deleted. Update and move operations are also handled. When nothing was changed and the hierarchy is re-imported, everything remains unchanged.
Signature:
public ImportUsersAndGroupsRet ImportUsersAndGroups(Guid CompanyAuthCode, OrganizationHierarchy_v2 OrganizationHierarchy)
Return values:
public enum ImportUsersAndGroupsRet { OK, // Import was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid UserHasNoEmailAddress, // At least one of the user has no email address given DuplicateExtIdFound, // There are more than one workergroups or workers exits with the same ExtId DuplicateEmailFound, // There are more than one workers exits with the same email address EmptyExtIdFound // At least one of the worker or workergroup has no ExtId }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| OrganizationHierarchy_v2 |
OrganizationHierarchy |
In |
This class describes the structure of your organization, how workers are classified. This class only has a Root property which is a RootWorkerGroup typed object. OrganizationHierarchy consists of OrganizationHierarchyItem objects. OrganizationHierarchyItem is the base class of RootWorkerGroup, WorkerGroup and Worker classes are used for classification. Each class derives from base class which has the specific properties. |
| bool |
activateUsers |
In |
If this parameter is false, users will be created as inactive. |
| bool |
deleteUnmatchedItemsWithExtId |
In |
If this parameter is false, already existing users and groups with ExtId set will not be deleted if not included in OrganizationHierarchy parameter. |
Example code (C#):
var organizationHierarchy = new OrganizationHierarchy_v2();
var root = new RootWorkerGroup_v2();
// get groups and workers from external system and build up the organization hierarchy var group1 = new WorkerGroup_v2 { ExtId = "1AA", Name = "Group1" }; var group2 = new WorkerGroup_v2 { ExtId = "2AA", Name = "Group2" }; var group3 = new WorkerGroup_v2 { ExtId = "3AA", Name = "Group3" }; var group4 = new WorkerGroup_v2 { ExtId = "104AA", Name = "Group4" }; var worker1 = new Worker_v2 { ExtId = "4AA", LastName = "Worker1", Email = "worker1@example.com", FirstName = "FirstName"}; var worker2 = new Worker_v2 { ExtId = "5AA", LastName = "Worker2", Email = "worker2@example.com", FirstName = "FirstName" }; var worker3 = new Worker_v2 { ExtId = "6AA", LastName = "Worker3", Email = "worker3@example.com", FirstName = "FirstName" }; var worker4 = new Worker_v2 { ExtId = "7AA", LastName = "Worker4", Email = "worker4@example.com", FirstName = "FirstName" }; var worker5 = new Worker_v2 { ExtId = "8AA", LastName = "Worker5", Email = "worker5@example.com", FirstName = "FirstName" }; var worker6 = new Worker_v2 { ExtId = "9AA", LastName = "Worker6", Email = "worker6@example.com", FirstName = "FirstName" };
group1.Children = new OrganizationHierarchyItem_v2[] { worker1, worker2 }; group2.Children = new OrganizationHierarchyItem_v2[] { worker3, worker4 }; group3.Children = new OrganizationHierarchyItem_v2[] { worker5, worker6 }; group4.Children = new OrganizationHierarchyItem_v2[] { };
root.Children = new OrganizationHierarchyItem_v2[] { group1, group2, group3, group4 };
organizationHierarchy.Root = root;
// Hierarchy is built, import it into JC360 (using JC360 webservice) Guid AuthCode = Guid.Parse("YourCompanyAuthCodeHere"); using (API api = new API()) { api.ImportUsersAndGroups(AuthCode, organizationHierarchy, true, true); }
Description:
Modifies the worktime of the user in the given period.
Signature:
public ModifyWorktimeRet ModifyWorktime(Guid companyAuthCode, int targetUserId, DateTime startDateInUtc, DateTime endDateInUtc, ModifyWorktimeMethod method, int? taskId, string comment)
Return values:
public enum ModifyWorktimeRet { OK, UnknownError, AuthCodeInvalid, SubscriptionExpired, AccessDenied, TimeIntervalIsOutdated, CorrectionTypeIsNotValid, TaskIdIsNotGiven, InvalidTimeInterval, TaskNotExistsOrNotAssignedToUser, TimeIntervalIsTooLong, BothDatesMustBeSetToNullOrToValue, SpecificTaskIdIsInvalid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user. |
| DateTime |
startDateInUtc |
In |
Start date in UTC. |
| DateTime |
endDateInUtc |
In |
End date in UTC. |
| ModifyWorktimeMethod |
method |
In |
The method of modification, which can be one of the following value of the ModifyWorktimeMethod enum: Add, Delete, Replace |
Example code (C#):
using (var api = new API()) { var authCode = Guid.NewGuid(); var targetUserId = 123456; var startDateInUtc = DateTime.UtcNow.AddMonths(-1); var endDateInUtc = DateTime.UtcNow; var taskId = 123456; var comment = "comment"; //Adds worktime as manualworkitems, which you can undo by deleting by the Id of the created ManualWorkItem var ret = api.ModifyWorktime(authCode, targetUserId, startDateInUtc, endDateInUtc, ModifyWorktimeMethod.Add, taskId, comment);
if (ret != ModifyWorktimeRet.OK) Console.WriteLine("Error adding manualworkitem for the user for the given period"); //Overwrites the taskId of any worktime in the given period with the given taskId var ret = api.ModifyWorktime(authCode, targetUserId, startDateInUtc, endDateInUtc, ModifyWorktimeMethod.Replace, taskId, comment);
if (ret != ModifyWorktimeRet.OK) Console.WriteLine("Error overwriting existing worktime of the user with the given taskid for the given period"); //Deletes any worktime and any collected data in the given period with the given taskId var ret = api.ModifyWorktime(authCode, targetUserId, startDateInUtc, endDateInUtc, ModifyWorktimeMethod.Delete, null, comment);
if (ret != ModifyWorktimeRet.OK) Console.WriteLine("Error deleting existing worktime of the user for the given period"); }
Description:
Moves a task or project to a different project
Signature:
public MoveTaskRet_v3 MoveTask_v3(Guid CompanyAuthCode, int TaskId, int NewParentId)
Return values:
public enum MoveTaskRet_v3 { OK, UnknownError, AuthCodeNotValid, AccessDenied, TaskCannotBeMovedToThatLocation, CannotMoveTaskIntoDeletedTask, ParentTargetPlannedWorkTimeIsExceeded, ParentTargetCostIsExceeded, CannotStartBeforeParentTask, CannotFinishAfterParentTask }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
Id of the task, which is to be moved |
| int |
NewParentId |
In |
Id of the new parent project |
Example code (C#):
using (var api = new API()) { var ret = api.MoveTask_v3(AuthCode, taskId, targetProjectId);
if (ret != MoveTaskRet_v3.OK) Console.WriteLine("Error moving task: {0} to project {1, error code: {2}}", taskId, targetProjectId, ret); }
Description:
Moves a user to another group.
Signature:
public MoveUserRet MoveUser(Guid companyAuthCode, int userId, int newParentGroupId)
Return values:
public enum MoveUserRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, CantMoveItemToThatLocation, CannotMoveItemIntoDeletedItem, InvalidUserOrGroup }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
userId |
In |
Id of the user that needs to be moved |
| int |
newParentGroupId |
In |
Id of the group the user should be moved to |
Example code (C#):
using (var api = new API()) { var ret = api.MoveUser(AuthCode, 123, 234); if (ret != MoveUserRet.OK) Console.WriteLine("Error moving User"); }
Description:
Moves a user group to another group.
Signature:
public MoveUserGroupRet MoveUserGroup(Guid companyAuthCode, int groupId, int newParentGroupId)
Return values:
public enum MoveUserGroupRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, CantMoveItemToThatLocation, CannotMoveItemIntoDeletedItem, InvalidUserGroup }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
groupId |
In |
Id of the user group that needs to be moved |
| int |
newParentGroupId |
In |
Id of the group the user group should be moved to |
Example code (C#):
using (var api = new API()) { var ret = api.MoveUserGroup(AuthCode, 123, 234); if (ret != MoveUserGroupRet.OK) Console.WriteLine("Error moving Group"); }
Description:
Deletes a holidaylimit entry.
Signature:
public RemoveHolidayLimitsForUserRet RemoveHolidayLimitsForUser(Guid CompanyAuthCode, int holidayLimitId)
Return values:
public enum RemoveHolidayLimitsForUserRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
holidayLimitId |
In |
This is the Id of the holidayLimit. This Id can be retrieved by using the GetHolidayLimitsOfUser function. |
Example code (C#):
var holidayLimit1Id = 123; using (API api = new API()) { api.RemoveHolidayLimitsForUser(AuthCode, holidayLimit1Id); }
Description:
Reopens a closed work or project. Recursively opens closed parent projects.
Signature:
public ReopenTaskRet ReopenTask(Guid CompanyAuthCode, int TaskId)
Return values:
public enum ReopenTaskRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
Id of the task/project to reopen |
Example code (C#):
using (var api = new API()) { var ret = api.ReopenTask(AuthCode, taskId);
if (ret != ReopenTaskRet.OK) { Console.WriteLine("Error reopening project/task: {0}, error code: {1}", taskId, ret); } }
Description:
Re-opens a deleted user. Changes the user's status to Inactive.
Signature:
public ReopenUserRet ReopenUser(Guid CompanyAuthCode, int targetUserId)
Return values:
public enum ReopenUserRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user about to be re-opened. |
Example code (C#):
using (var api = new API()) { var userId = 123; var authCode = Guid.NewGuid();
var ret = api.ReopenUser(authCode, userId); if (ret != ReopenUserRet.OK) Console.WriteLine("Error reopening User"); }
Description:
Sets an external id for works and projects.
Signature:
public SetExternalIdForTaskRet SetExternalIdForTask(Guid CompanyAuthCode, int TaskId, string ExternalId)
Return values:
public enum SetExternalIdForTaskRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, TaskMustBeProjectOrWork, ExtIdAlreadyExists }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
Id of the task/project to set the ExtId for |
| string |
ExternalId |
In |
The ExtId to set |
Example code (C#):
var Work1Id = 120221; var extId = "358111";
using (var api = new API()) { var ret = api.SetExternalIdForTask(AuthCode, Work1Id, extId);
if (ret != SetExternalIdForTaskRet.OK) { Console.WriteLine("Error setting ExtId for task: {0}, error code: {1}", Work1Id, ret); } }
Description:
Sets hourly wage intervals for a specific user. JC360 merges the given list of intervals with the ones existing in the system. New intervals are created, existing ones are updated or deleted. Always pass in every hourly wage intervals for the user (including the intervals in the future and in the past).
Signature:
public SetHourlyWagesForUserRet SetHourlyWagesForUser(Guid CompanyAuthCode, int UserId, HourlyWage[] workerHourlyWages)
Return values:
public enum SetHourlyWagesForUserRet { OK, // Operation was successful UnknownError, // Unknown error occured AuthCodeNotValid, // Company's authCode is not valid InvalidHourlyWage // A given hourlywage is 0 or lower }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
This is the Id of the specified user. |
| HourlyWage[] |
workerHourlyWages |
In |
List of user's hourlywage intervals. Always pass in each intervals, including the intervals in the future and in the past. The information is stored in an object which is type of HourlyWage. |
Example code (C#):
// Set/Change HourlyWages for users var wages = new HourlyWage[] { new HourlyWage { StartDate = new DateTime(2010, 1, 1), Amount = 3000 }, new HourlyWage { StartDate = new DateTime(2011, 1, 1), Amount = 4000 }, new HourlyWage { StartDate = new DateTime(2011, 6, 1), Amount = 5000 } };
// set hourly wages using (API api = new API()) { api.SetHourlyWagesForUser(AuthCode, worker1UserID, wages); } // Add/Change/Remove hourly wages wages = new HourlyWage[] { new HourlyWage { StartDate = new DateTime(2010, 1, 1), Amount = 3100 }, // change new HourlyWage { StartDate = new DateTime(2010, 6, 1), Amount = 3500 }, // add new HourlyWage { StartDate = new DateTime(2011, 1, 1), Amount = 4000 }, // leave new HourlyWage { StartDate = new DateTime(2013, 1, 1), Amount = 7000 }, // add };
using (API api = new API()) { api.SetHourlyWagesForUser(AuthCode, worker1UserID, wages); } // Remove every hourly wage using (API api = new API()) { api.SetHourlyWagesForUser(AuthCode, worker1UserID, new HourlyWage[0]); }
Description:
Sets phone number for user in the IVR based login scenario (available in Hungary at the moment)
Signature:
public SetPhoneNumberForUserRet SetPhoneNumberForUser(Guid CompanyAuthCode, int UserId, string PhoneNumber)
Return values:
public enum SetPhoneNumberForUserRet { OK, UnknownError, AuthCodeNotValid, InvalidPhoneNumber, PhoneNumberAlreadyExists }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
The id of the user for the phone number should be set |
| string |
PhoneNumber |
In |
Phone number to be set |
Example code (C#):
using (var api = new API()) { var phoneNumber = "+36201234567"; var ret = api.SetPhoneNumberForUser(AuthCode, Worker1UserId, phoneNumber);
if (ret != SetPhoneNumberForUserRet.OK) Console.WriteLine("Error setting phone number ({0}) for user: {1}, error: {2}", phoneNumber, Worker1UserId, ret); }
Description:
Updates cost center data, note that default cost center data can not be updated
Signature:
public CostCenterUpdateError UpdateCostCenter_v2(Guid companyAuthCode, CostCenter_v2 costCenter)
Return values:
public enum CostCenterUpdateError { OK = 0, UnknownError, AuthCodeNotValid, AccessDenied, InvalidName, InvalidBillingInformationCompanyRegistry, InvalidBillingInformationCountry, InvalidBillingInformationName, InvalidBillingInformationNumber, InvalidBillingInformationStreetType, InvalidBillingInformationStreetName, InvalidBillingInformationZip, InvalidBillingInformationTaxNumber, InvalidBillingInformationCity }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| CostCenter_v2 |
costCenter |
In |
Cost center data for update, the information is stored in the CostCenter_v2 class |
Example code (C#):
using (var api = new API()) { var costCenters = api.GetCostCenters_v2(AuthCode); var costCenterData = costCenters.FirstOrDefault();
if (costCenterData == null) return;
costCenterData.Description = "Modified description"; var ret = api.UpdateCostCenter_v2(AuthCode, costCenterData);
if (ret != CostCenterUpdateError.OK) Console.WriteLine("Error updating cost center data, error code: {0}", ret); }
Description:
Updates the data of a project
Signature:
public UpdateProjectRet_v3 UpdateProject_v3(Guid CompanyAuthCode, int TaskId, string Name, string Description, int? TargetPlannedWorktimeInMinutes, DateTime? TargetStartDate, DateTime? TargetEndDate, decimal? TargetCost, string taxId, int? priority, bool keepOriginalValuesIfNull, TaskPlannedPeriod_v2[] plannedPeriods)
Return values:
public enum UpdateProjectRet_v3 { OK, UnknownError, AuthCodeNotValid, AccessDenied, EmptyNameIsNotValid, TargetPlannedWorktimeInMinutesIsInvalid, InvalidTimeInterval, InvalidTargetCost, ParentTargetCostIsExceeded, ParentTargetPlannedWorkTimeIsExceeded, TotalChildrenTargetCostIsHigherThanTheSetValue, TotalChildrenTargetPlannedWorkTimeIsHigherThanTheSetValue, CannotStartBeforeParentTask, CannotFinishAfterParentTask, CannotStartAfterChildTask, CannotFinishBeforeChildTask }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
Id of the project to be updated |
| string |
Name |
In |
Name of the project |
| string |
Description |
In |
Description of the project |
| int? |
TargetPlannedWorktimeInMinutes |
In |
Total estimated time for the whole project |
| DateTime? |
TargetStartDate |
In |
Start date of the project |
| DateTime? |
TargetEndDate |
In |
End date of the project |
| decimal? |
TargetCost |
In |
Total estimated project cost |
| string |
taxId |
In |
Tax id related to the project (usually in case of customer related project) |
| int? |
priority |
In |
Priority of the project |
| bool |
keepOriginalValuesIfNull |
In |
In case of null submitted among the paramters, should it mean to keep the original values or set the values to null |
| TaskPlannedPeriod_v2[] |
plannedPeriods |
In |
Planned period based data for target cost and worktime, the information is stored in the TaskPlannedPeriod_v2 class |
Example code (C#):
using (var api = new API()) { var targetProjectId = 120221; Task_v4 project; var ret = api.GetTask_V3(AuthCode, targetProjectId, false, out project);
if (ret != GetTaskRet.OK) { Console.WriteLine("Error getting task data, error code: {0}", ret); } else { project.Name += " added name"; var ret2 = api.UpdateProject_v3(AuthCode, targetProjectId, project.Name, project.Description, project.TargetPlannedWorkTimeInMinutes, project.TargetStartDate, project.TargetEndDate, project.TargetCost, project.TaxId, project.TaskPriority, false, null);
if (ret2 != UpdateProjectRet_v3.OK) Console.WriteLine("Error updating project {0}, error code: {1}", targetProjectId, ret); } }
Description:
Updates project membership
Signature:
public UpdateProjectMembershipRet UpdateProjectMembership(Guid CompanyAuthCode, int ProjectId, int UserId, bool IsLeader)
Return values:
public enum UpdateProjectMembershipRet { OK, UnknownError, AuthCodeNotValid, AccessDenied }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
ProjectId |
In |
Id of the project for that membership information is to be updated |
| int |
UserId |
In |
Id of the user for who membership information is to be updated |
| bool |
IsLeader |
In |
Nem membership status would be Leader or Member |
Example code (C#):
using (var api = new API()) { var targetProjectId = 120221; var ret = api.UpdateProjectMembership(AuthCode, targetProjectId, Worker1UserId, true);
if (ret != UpdateProjectMembershipRet.OK) Console.WriteLine("Error updating project membership in project {0}, for user: {1}, error code: {2}", targetProjectId, Worker1UserId, ret); }
Description:
Updates settings for user. Fields left null are ignored.
Signature:
public UpdateSystemSettingForUserRet UpdateSystemSettingForUser(System.Guid CompanyAuthCode, SystemSetting sytemSetting)
Return values:
public enum UpdateSystemSettingForUserRet { OK, UnknownError, AuthCodeNotValid }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| SystemSetting |
sytemSetting |
In |
The information is stored in the SystemSetting class |
Example code (C#):
var systemSetting = new SystemSetting { UserId = Worker1UserId, CoreTime = new CoreTimeSetting { StartTime = null, EndTime = null, MinimumWorkTime = null, StartOffset = null, EndOffset = null }, Client = new ClientSetting { WorktimeStartInMins = null, WorktimeEndInMins = null, AfterWorktimeIdleInMins = null, DuringWorkTimeIdleInMins = null, DuringWorkTimeIdleManualIntervalInMilisec = null, MaxManualMeetingIntervalInMilisec = null, RuleRestrictions = null, ScreenshotQuality = null, BusyTimeThreshold = null, MaxOfflineWorkItems = null, CoincidentalClientsEnabled = null, DefaultTaskId = null, IsOutlookAddinMailTrackingUseSubject = null }, Meeting = new MeetingSetting { EnableMeetingTracking = null, EnableLotusNotesMeetingTracking = null, DefaultTaskId = null, IsMeetingSubjectMandatory = null, IsOfflineWorkingTimeRequestAutomatic = null, SynchronizeCalendarMeetingModifications = null, AllowApprovalOfMeetingsLongerOrEqualThan24Hours = null, KeepMeetingParallelWorktime = null, AreTentativeMeetingsSynched = null }, Mobile = new MobileSetting { LocationTrackMode = null, PrivateCallDuration = null, AfterWorkTimeIdleMinutes = null, WorkCallDuration = null }, IncidentManager = new IncidentManagerSetting(), // Obsolete, so not explained Other = new OtherSetting { CostCenterId = null, TimeZoneId = null, CalendarId = null, DailyWorkTimeInMinutes = 480, TaskMandatoryFields = null, TaskAssignmentMandatoryFields = null, ManualWorkItemEditAgeLimit = null, MinNumOfActiveUsersInGroup = null, MinPercentOfActiveUsersInGroup = null } };
using (var api = new API()) { api.Timeout = Int32.MaxValue;
var ret = api.UpdateSystemSettingForUser(AuthCode, systemSetting);
if (ret != UpdateSystemSettingForUserRet.OK) Console.WriteLine("Error updating system setting for user {0}, error code: {1}", Worker1UserId, ret); }
Description:
Updates assignment details of a work for the user
Signature:
public UpdateTaskAssignmentRet_v3 UpdateTaskAssignment_v3(Guid CompanyAuthCode, int UserId, int TaskId, DateTime? StartDate, DateTime? EndDate, int? PlannedWorktimeInMinutes)
Return values:
public enum UpdateTaskAssignmentRet_v3 { OK, UnknownError, AuthCodeNotValid, AccessDenied, InvalidTimeInterval, BothDatesMustBeSetToNullOrToValue, PriorityIsInvalid, PlannedWorktimeInMinutesIsInvalid, PlannedWorktimeInMinutesIsGreaterThanAllowedByStartdateAndEnddate, CannotStartBeforeParentTask, CannotFinishAfterParentTask, TotalAssignmentPlannedTimeGreaterThanWorkPlannedTime }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
UserId |
In |
The id of the user who is assigned to the task |
| int |
TaskId |
In |
The id of the task |
| DateTime? |
StartDate |
In |
First date of the assignment |
| DateTime? |
EndDate |
In |
Last date of the assignment |
| int? |
PlannedWorktimeInMinutes |
In |
Planned time for the assignment in minutes |
Example code (C#):
using (var api = new API()) { var ret = api.UpdateTaskAssignment_v3(AuthCode, Worker1UserId, taskId, null, null, 200);
if (ret != UpdateTaskAssignmentRet_v3.OK) Console.WriteLine("Error updating task ({0}), error code: {1}", taskId, ret); }
Description:
Updates a user (if domain login is updated, domain users are upserted every 12 hours.)
Signature:
public UpdateUserRet UpdateUser_v2(Guid CompanyAuthCode, int targetUserId, string firstName, string lastName, string email, UserAccessLevel accessLevel, NODE_STATUS status, string cultureId, string extId, string activeDirectoryUserPrincipalName, DateTime? firstWorkTime, DateTime? lastWorkTime, string password = null)
Return values:
public enum UpdateUserRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, EmailAddressIsAlreadyInUse, ActiveDirectoryUserPrincipalNameMustBeUnique, ExtIdMustBeUnique, UserCannotDeactivateHimself, CannotChangeStatusOfTheNodeBecauseParentIsNotActive, NameCannotBeEmpty, EmailCannotBeEmpty, InvalidAccessLevel, UserDoesNotExistOrDeleted, RegistratorCanOnlyBeModifiedByItself, RegistratorsAccessLevelCanOnlyBeAdministrator, OnlyAdminsCanManageSupervisorsAndAdmins, UserCannotUpgradeOrDowngradeHimself, UpdateUserFailedPasswordMustMeetPolicy, PasswordAndConfirmationMustMatch, CultureNotSupported }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserId |
In |
Id of the user that needs to be updated |
| string |
firstName |
In |
First name of the user |
| string |
lastName |
In |
Last name of the user |
| string |
email |
In |
Email of the user, must be unique in a company |
| UserAccessLevel |
accessLevel |
In |
Access level of the user. Enum: Worker = 0, Supervisor = 1, Administrator = 2 |
| NODE_STATUS |
status |
In |
Status of the user. Enum: Disabled = 0, Enabled = 1 |
| string |
cultureId |
In |
Culture of the user. Possible values are: en-US (English), hu-HU (Hungarian), ko-KR (Korean), ja-JP (Japanese), pt-BR (Portuguese), es-MX (Spanish) |
| string |
extId |
In |
External id of the user (for external systems) |
| string |
activeDirectoryUserPrincipalName |
In |
Active directory user principal name (UPN) |
| DateTime? |
firstWorkTime |
In |
First day of work. From this point in time (given in UTC) the reports start to calculate expected working time for user. If you leave this field null then the system will define it automatically later when the first work item uploaded for the user. |
| DateTime? |
lastWorkTime |
In |
Last day of work. From this point in time (given in UTC) the reports will not calculate expected working time for user. If you leave this field null then the system will define it automatically later when the user gets deleted. |
| string |
password |
In |
Optional. Password of the user. If given password is null or empty then password will remain unchanged. |
Example code (C#):
using (var api = new API()) { var ret = api.UpdateUser_v2(AuthCode, 123, "firstname", "lastname", "test@test.com", UserAccessLevel.Administrator, 1, "en-US", null, null, null, null, null); if (ret != UpdateUserRet.OK) Console.WriteLine("Error updating User") }
Description:
Updates a user group.
Signature:
public UpdateUserGroupRet UpdateUserGroup(Guid CompanyAuthCode, int targetUserGroupId, string name)
Return values:
public enum UpdateUserGroupRet { OK, AuthCodeNotValid, AccessDenied, UnknownError, NameCannotBeEmpty, GroupIsNotActive }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
targetUserGroupId |
In |
Id of the user group about to be updated. |
| string |
name |
In |
Name of the user group. |
Example code (C#):
using (var api = new API()) { var groupId = 123; var authCode = Guid.NewGuid();
var ret = api.UpdateUserGroup(authCode, groupId, "GroupName"); if (ret != UpdateUserGroupRet.OK) Console.WriteLine("Error updating Group"); }
Description:
Updates an existing task
Signature:
public UpdateWorkRet_v4 UpdateWork_v4(Guid CompanyAuthCode, int TaskId, string Name, string Description, int? MeetingDurationInMins, int? CategoryId, int? TargetPlannedWorktimeInMinutes, DateTime? TargetStartDate, DateTime? TargetEndDate, decimal? TargetCost, bool? isTaskForMobile, int? priority, int? autoCloseAfterXHours, bool keepOriginalValuesIfNull, TaskPlannedPeriod_v2[] plannedPeriods, RequiredCloseReasons_v4 requiredClosedReasons)
Return values:
public enum UpdateWorkRet_v4 { OK, UnknownError, AuthCodeNotValid, AccessDenied, EmptyNameIsNotValid, InvalidCategoryId, TargetPlannedWorktimeInMinutesIsInvalid, InvalidTimeInterval, InvalidTargetCost, ParentTargetCostIsExceeded, ParentTargetPlannedWorkTimeIsExceeded, TotalChildrenTargetCostIsHigherThanTheSetValue, TotalChildrenTargetPlannedWorkTimeIsHigherThanTheSetValue, CannotStartBeforeParentTask, CannotFinishAfterParentTask, CannotStartAfterChildTask, CannotFinishBeforeChildTask, WorkPlannedTimeLessThanTotalAssignmentPlannedTime, CloseReasonRequiredTimeIsInvalid, InvalidPlannedPeriod }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| int |
TaskId |
In |
Id of the task to be updated |
| string |
Name |
In |
Name of the task |
| string |
Description |
In |
Description for the task |
| int? |
MeetingDurationInMins |
In |
Duration in case of a timed task |
| int? |
CategoryId |
In |
Id of the task category assigned to the task |
| int? |
TargetPlannedWorktimeInMinutes |
In |
Total estimated time for the task |
| DateTime? |
TargetStartDate |
In |
Estimated start date |
| DateTime? |
TargetEndDate |
In |
Estimated finish data |
| decimal? |
TargetCost |
In |
Estimated cost of the task |
| bool? |
isTaskForMobile |
In |
Task should be visible on mobile application |
| int? |
priority |
In |
Priority of the task |
| int? |
autoCloseAfterXHours |
In |
Indicates whether the task should appear on mobile applications |
| bool |
keepOriginalValuesIfNull |
In |
If no value submitted, the target object properties/fields will keep their original value |
| TaskPlannedPeriod_v2[] |
plannedPeriods |
In |
List of values splitted to plannin periods. The information is stored in the TaskPlannedPeriod_v2 class |
| RequiredCloseReasons_v4 |
requiredClosedReasons |
In |
Task close constraints. The information is stored in the RequiredCloseReasons_v4 class |
Example code (C#):
using (var api = new API()) { var ret = api.UpdateWork_v4(AuthCode, taskId, "Updated name", null, null, null, null, null, null, null, null, null, null, true, null, null);
if (ret != UpdateWorkRet_v4.OK) Console.WriteLine("Error updating task ({0}), error code = {1}", taskId, ret); }
Description:
Updates a worktimeschedule
Signature:
public UpdateWorktimeScheduleRet UpdateWorktimeSchedule(Guid companyAuthCode, WorktimeSchedule worktimeSchedule)
Return values:
public enum UpdateWorktimeScheduleRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, ScheduleIsEmpty, //Items of the WorktimeSchedule is null or empty ItemIsTooLong, //StartDate EndDate interval is bigger than 24hours NegativeItemInterval, //StartDate is later than EndDate InvalidTaskId, ItemIsOutOfIntervalRange, //Intervals are allowed for yesterday, today, and for tomorrow OverlappingItemIntervals, //ScheduledItem overlap conflict between the provided parameters only OverlappingItemIntervalAlreadyExist //ScheduledItem overlap conflict between the parameters and database }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| WorktimeSchedule |
worktimeSchedule |
In |
Id of the WorktimeSchedule |
Example code (C#):
var scheduleId = 123; var targetUserId = 123;
var schedule = new WorktimeSchedule { Id = scheduleId, LocalDay = new DateTime(2018, 10, 19), UserId = targetUserId, IsInOffice = false };
var items = new List<WorktimeScheduleItem>() { new WorktimeScheduleItem { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, } };
schedule.Items = items.ToArray();
using (API api = new API()) { var ret = api.UpdateWorktimeSchedule(AuthCode, schedule); if (ret != UpdateWorktimeScheduleRet.OK) Console.WriteLine("Error updating WorktimeSchedule") }
Description:
Updates a worktimeschedule
Signature:
public UpdateWorktimeScheduleRet_v2 UpdateWorktimeSchedule_v2(Guid companyAuthCode, WorktimeSchedule_v2 worktimeSchedule)
Return values:
public enum UpdateWorktimeScheduleRet_v2 { OK, UnknownError, AuthCodeNotValid, AccessDenied, ScheduleIsEmpty, //Items of the WorktimeSchedule is null or empty ItemIsTooLong, //StartDate EndDate interval is bigger than 24hours NegativeItemInterval, //StartDate is later than EndDate InvalidTaskId, ItemIsOutOfIntervalRange, //Intervals are allowed for yesterday, today, and for tomorrow OverlappingItemIntervals, //ScheduledItem overlap conflict between the provided parameters only OverlappingItemIntervalAlreadyExist //ScheduledItem overlap conflict between the parameters and database ExtendedPropertyNameCannotBeEmpty, //Name fields of ExtendedProperty items must not be empty ExtendedPropertyNameIsNotUnique, //Name fields of ExtendedProperty items must be unique inside an item IsWorkDayAndIsInOfficeConflict //Office work on a non-workday cannot be required ItemsShouldBeEmptyOnNonWorkdays, //Items make no sense on non-working days CannotRequestInTheFuture, //Corresponding default setting doesn't let recording schedules in the future that much ahead ScheduleAlreadyExistsForTheGivenDay, //A schedule already exists for the day InvalidCategoryId //Category does not exist }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
companyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| WorktimeSchedule_v2 |
worktimeSchedule |
In |
Id of the WorktimeSchedule_v2 |
Example code (C#):
var scheduleId = 123; var targetUserId = 123;
var schedule = new WorktimeSchedule_v2 { Id = scheduleId, LocalDay = new DateTime(2018, 10, 19), UserId = targetUserId, IsInOffice = false, IsWorkDay = true };
var items = new List<WorktimeScheduleItem_v2>() { new WorktimeScheduleItem_v2 { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, CategoryId = 5678 } };
schedule.Items = items.ToArray();
using (API api = new API()) { var ret = api.UpdateWorktimeSchedule_v2(AuthCode, schedule); if (ret != UpdateWorktimeScheduleRet_v2.OK) Console.WriteLine("Error updating WorktimeSchedule") }
Description:
Updates the datasource file used by custom reports. Tries to find the file with the given name (case sensitive search!) and updates it. When not found it creates a new file with the given content. The file must be in excel (.xlsx) format.
Signature:
public UploadDataSourceFileRet UploadDataSourceFile(Guid CompanyAuthCode, string fileNameWithoutExtension, byte[] fileContent, out int dataSourceId)
Return values:
public enum UploadDataSourceFileRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, FileBytesNull, FileBytesZero, FileBytesExceeded, FileNameRequired }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| string |
fileNameWithoutExtension |
In |
Name of the datasource file shown on the website without extension (e.g. "MyExcelFile" and not "MyExcelFile.xlsx") |
| byte[] |
fileContent |
In |
Content of the datasource file. Must be in Excel (.xlsx) format. |
| int |
dataSourceId |
Out |
The id of the datasource. You can use it at the DownloadDataSourceFile() function. |
Example code (C#):
var fileName = "MyExcelFile"; var uploadedWorkbook = CreateSampleWorkbook(); var fileContent = uploadedWorkbook.SaveToStream().ToArray(); int dataSourceId;
using (API api = new API()) { api.UploadDataSourceFile(AuthCode, fileName, fileContent, out dataSourceId); }
Description:
Creates or updates a DictionaryAutoRule
Signature:
public UpsertStartWorkDictionaryAutoRuleRet UpsertStartWorkDictionaryAutoRule(Guid CompanyAuthCode, DictionaryAutoRule startWorkDictionaryAutoRule, out DictionaryAutoRule upsertedDictionaryAutoRule)
Return values:
public enum UpsertStartWorkDictionaryAutoRuleRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, //taskid is 0, //if complex and it has less than 2 parameters //if regex is true then is start/end fixed must be null, //if regex is false then is start/end fixed must be not null, //keyword cannot be null or * or *.*, //relations are provided incorrectly, //parameters with one word assigned to it must not have relation, //parameters with more than one word assigned to it must have relation //workers cannot edit start work dictionary autorules //dictionaryAutoRule is not in the supuser's company //sampleid does not exist, //parameterid does not exist //sample is a stopwork while we try to save startwork //invalid sampleid-parameterid (parameter is under another sample) //sample is not assigned to the company, //task could not be found or task is under another company, //if not admin and does not have project based access CannotAssignToClosedTask, //task is already closed CannotAssignToProject, //provided taskid is not work but project AtLeastOneSampleIsInactiveError, //One of the DictionaryAutoRuleSamples is not active DictionaryAutoRuleIdDoesNotExist, //DictionaryAutoRuleId does not exist in db InvalidAssignments, //Assignment is not startwork InvalidContent //If the content is not simple and not complex }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DictionaryAutoRule |
startWorkDictionaryAutoRule |
In |
Updateable/createable DictionaryAutoRule |
| DictionaryAutoRule |
upsertedDictionaryAutoRule |
Out |
Updated/created DictionaryAutoRule |
Example code (C#):
//Create simple startwork dictionaryautorule start DictionaryAutoRuleSample[] dictionaryAutoRuleSamples; using (API api = new API()) { var result = api.GetCompanyDictionaryAutoRuleSamples(AuthCode, out dictionaryAutoRuleSamples); Assert.AreEqual(result, GetCompanyDictionaryAutoRuleSamplesRet.OK); }
var samples = dictionaryAutoRuleSamples .Where(item => item.Type == DictionaryAutoRuleSampleType.StartWork && !item.IsComplex) .ToList();
var assignment = new StartWorkDictionaryAutoRuleAssignment() { TaskId = taskId };
var content = new SimpleDictionaryAutoRuleContent() { Parameters = new DictionaryAutoRuleParameter[] { new DictionaryAutoRuleParameter() { SampleId = samples[0].Id, ParameterId = samples[0].Parameters[0].Id } }, KeywordDetails = new DictionaryAutoRuleKeywordDetails[] { new DictionaryAutoRuleKeywordDetails() { Keyword = "apitest1", IsStartFixed = false, IsEndFixed = false, IsRegex = false } } };
var dictionaryAutoRule = new DictionaryAutoRule() { Assignment = assignment, Content = content };
DictionaryAutoRule createdDictionaryAutoRule; using (API api = new API()) { var result = api.UpsertStartWorkDictionaryAutoRule(AuthCode, dictionaryAutoRule, out createdDictionaryAutoRule); } //Create simple startwork dictionaryautorule end //Create complex startwork dictionaryautorule start DictionaryAutoRuleSample[] dictionaryAutoRuleSamples; using (API api = new API()) { var result = api.GetCompanyDictionaryAutoRuleSamples(AuthCode, out dictionaryAutoRuleSamples); }
var samples = dictionaryAutoRuleSamples .Where(item => item.Type == DictionaryAutoRuleSampleType.StartWork && item.IsComplex) .ToList();
var assignment = new StartWorkDictionaryAutoRuleAssignment() { TaskId = taskId };
var content = new ComplexDictionaryAutoRuleContent() { ParameterContent = new DictionaryAutoRuleParameterContent[] { new DictionaryAutoRuleParameterContent() { KeywordDetails = new DictionaryAutoRuleKeywordDetails[] { new DictionaryAutoRuleKeywordDetails() { Keyword = "apitest1", IsStartFixed = false, IsEndFixed = false, IsRegex = false } }, ParameterId = samples[0].Parameters[0].Id, SampleId = samples[0].Id }, new DictionaryAutoRuleParameterContent() { KeywordDetails = new DictionaryAutoRuleKeywordDetails[] { new DictionaryAutoRuleKeywordDetails() { Keyword = "apitest2", IsStartFixed = false, IsEndFixed = false, IsRegex = false } }, ParameterId = samples[0].Parameters[1].Id, SampleId = samples[0].Id } } };
var dictionaryAutoRule = new DictionaryAutoRule() { Assignment = assignment, Content = content };
DictionaryAutoRule createdDictionaryAutoRule; using (API api = new API()) { var result = api.UpsertStartWorkDictionaryAutoRule(AuthCode, dictionaryAutoRule, out createdDictionaryAutoRule); } //Create complex startwork dictionaryautorule end
Description:
Creates or updates a DictionaryAutoRule
Signature:
public UpsertStopWorkDictionaryAutoRuleRet UpsertStopWorkDictionaryAutoRule(Guid CompanyAuthCode, DictionaryAutoRule stopWorkDictionaryAutoRule, out DictionaryAutoRule upsertedDictionaryAutoRule)
Return values:
public enum UpsertStopWorkDictionaryAutoRuleRet { OK, UnknownError, AuthCodeNotValid, AccessDenied, //userids/roleids are null or empty, //if complex and it has less than 2 parameters //if regex is true then is start/end fixed must be null, //if regex is false then is start/end fixed must be not null, //keyword cannot be null or * or *.*, //relations are provided incorrectly, //parameters with one word assigned to it must not have relation, //parameters with more than one word assigned to it must have relation //only admins can edit stopworkdictionaryautorules //dictionaryAutoRule is not in the supuser's company //sampleid does not exist, //parameterid does not exist //sample is a startwork while we try to save stopwork //invalid sampleid-parameterid (parameter is under another sample) //sample is not assigned to the company AtLeastOneSampleIsInactiveError, //One of the DictionaryAutoRuleSamples is not active CannotAssignToNotActiveNode, //at least one of the userids/roleids does not exist in the db, or it is inactive/deleted DictionaryAutoRuleIdDoesNotExist, //DictionaryAutoRuleId does not exist in db InvalidAssignments, //Assignment is not stopwork InvalidContent //If the content is not simple and not complex }
Arguments:
| Type |
Name |
Direction |
Description |
| Guid |
CompanyAuthCode |
In |
A globally unique identifier (GUID) which authenticates the company. |
| DictionaryAutoRule |
startWorkDictionaryAutoRule |
In |
Updateable/createable DictionaryAutoRule |
| DictionaryAutoRule |
upsertedDictionaryAutoRule |
Out |
Updated/created DictionaryAutoRule |
Example code (C#):
//Create simple stopwork dictionaryautorule start DictionaryAutoRuleSample[] dictionaryAutoRuleSamples; using (API api = new API()) { var result = api.GetCompanyDictionaryAutoRuleSamples(AuthCode, out dictionaryAutoRuleSamples); }
var samples = dictionaryAutoRuleSamples .Where(item => item.Type == DictionaryAutoRuleSampleType.StopWork && !item.IsComplex) .ToList();
var assignment = new StopWorkDictionaryAutoRuleAssignment() { UserIds = new int[] { RegistratorUserId }, RoleIds = new int[] { workerGroupRole.Id } };
var content = new SimpleDictionaryAutoRuleContent() { Parameters = new DictionaryAutoRuleParameter[] { new DictionaryAutoRuleParameter() { SampleId = samples[0].Id, ParameterId = samples[0].Parameters[0].Id } }, KeywordDetails = new DictionaryAutoRuleKeywordDetails[] { new DictionaryAutoRuleKeywordDetails() { Keyword = "apitest1", IsStartFixed = false, IsEndFixed = false, IsRegex = false } } };
var dictionaryAutoRule = new UnitTests.APIWS.DictionaryAutoRule() { Assignment = assignment, Content = content };
DictionaryAutoRule createdDictionaryAutoRule; using (API api = new API()) { var result = api.UpsertStopWorkDictionaryAutoRule(AuthCode, dictionaryAutoRule, out createdDictionaryAutoRule); } //Create simple stopwork dictionaryautorule end //Create complex stopwork dictionaryautorule start DictionaryAutoRuleSample[] dictionaryAutoRuleSamples; using (API api = new API()) { var result = api.GetCompanyDictionaryAutoRuleSamples(AuthCode, out dictionaryAutoRuleSamples); }
var samples = dictionaryAutoRuleSamples .Where(item => item.Type == DictionaryAutoRuleSampleType.StopWork && item.IsComplex) .ToList();
var assignment = new StopWorkDictionaryAutoRuleAssignment() { UserIds = new int[] { RegistratorUserId }, RoleIds = new int[] { workerGroupRole.Id } };
var content = new ComplexDictionaryAutoRuleContent() { ParameterContent = new DictionaryAutoRuleParameterContent[] { new DictionaryAutoRuleParameterContent() { KeywordDetails = new DictionaryAutoRuleKeywordDetails[] { new DictionaryAutoRuleKeywordDetails() { Keyword = "apitest1", IsStartFixed = false, IsEndFixed = false, IsRegex = false } }, ParameterId = samples[0].Parameters[0].Id, SampleId = samples[0].Id }, new DictionaryAutoRuleParameterContent() { KeywordDetails = new DictionaryAutoRuleKeywordDetails[] { new DictionaryAutoRuleKeywordDetails() { Keyword = "apitest2", IsStartFixed = false, IsEndFixed = false, IsRegex = false } }, ParameterId = samples[0].Parameters[1].Id, SampleId = samples[0].Id } } };
var dictionaryAutoRule = new UnitTests.APIWS.DictionaryAutoRule() { Assignment = assignment, Content = content };
DictionaryAutoRule createdDictionaryAutoRule; using (API api = new API()) { var result = api.UpsertStopWorkDictionaryAutoRule(AuthCode, dictionaryAutoRule, out createdDictionaryAutoRule); } //Create complex stopwork dictionaryautorule end
Description:
This class holds the billing information related to cost centers. The cost center based billing will use this data to show on the invoice.
Members:
| Type |
Name |
Description |
| int |
CostCenterId |
The id of the cost center in the system |
| string |
City |
The city part of the address of the company as it should appear on the invoice. |
| string |
Zip |
The zip part of the address of the company as it should appear on the invoice. |
| string |
StreetName |
The street name part of the address of the company as it should appear on the invoice. |
| string |
StreetType |
The street type part of the address (street, square, avenue, etc.) of the company as it should appear on the invoice. |
| string |
Number |
The street number part of the address of the company as it should appear on the invoice. |
| string |
Floor |
The floor number part of the address of the company as it should appear on the invoice. |
| string |
Door |
The door number part of the address of the company as it should appear on the invoice. |
| string |
TaxNumber |
The tax number of the company as it should appear on the invoice. |
| string |
CompanyName |
The name of the company as it should appear on the invoice. |
| string |
ExtId |
The id of the cost center in the external system. Used when the cost center is synced from a different system. |
Example code (C#):
var billingInformation = new BillingInformation_v2 { CostCenterId = -1, CompanyName = "TestCompanyName", TaxNumber = "87654321", City = "City", Zip = "Zip", StreetName = "StreetName", StreetType = "StreetType", Number = "11", Floor = "22", Door = "33", ExtId = "TC5698", };
Description:
A CategoryLimit object contains the limit for a specific HolidayCategory.
Members:
| Type |
Name |
Description |
| int |
CategoryId |
The Id of the holidayCategory object. Can be used to retrieve by using the GetHolidayCategories function. |
| int |
LimitInMins |
This is the yearly limit given in minutes (e.g. 20 days (8 hours per day) = 20 * 8 * 60 minutes). |
Example code (C#):
var userId = 1234567; var holidayCategoryId1 = 100; var holidayCategoryId2 = 101; var holidayCategoryId3 = 102; var holidayLimitToUpload = new HolidayLimit { UserId = userId, Year = 2013, CategoryLimits = new CategoryLimit[] { new CategoryLimit{ CategoryId = holidayCategoryId1, LimitInMins = 200}, new CategoryLimit{ CategoryId = holidayCategoryId2, LimitInMins = 300}, new CategoryLimit{ CategoryId = holidayCategoryId3, LimitInMins = 400} } }; using (API api = new API()) { api.AddHolidayLimitsForUser(AuthCode, holidayLimitToUpload); }
HolidayLimit[] holidayLimits; using (API api = new API()) { api.GetHolidayLimitsOfUser(AuthCode, userId, out holidayLimits); } var holidayLimit = holidayLimits.First(t => t.Year == 2013); var limit1 = holidayLimit.Limits.First(t => t.CategoryId == holidayCategoryId1).LimitInMins); // 200 var limit2 = holidayLimit.Limits.First(t => t.CategoryId == holidayCategoryId2).LimitInMins); // 300 var limit3 = holidayLimit.Limits.First(t => t.CategoryId == holidayCategoryId3).LimitInMins); // 400 using (API api = new API()) { api.RemoveHolidayLimitsForUser(AuthCode, holidayLimit.Id); }
Description:
Inherits from DictionaryAutoRuleContentBase. You can assign the same DictionaryAutoRuleKeywordDetails to only 1 sample(but you can add different KeywordDetails to the parameters of the sample)
Members:
| Type |
Name |
Description |
| List<DictionaryAutoRuleParameterContent> |
ParameterContent |
Parameters the DictionaryAutoRule is assigned to. Cannot be null or empty. |
Example code (C#):
Description:
Cost center information
Members:
| Type |
Name |
Description |
| string |
ExtId |
ExternalId for the cost center |
| int |
Id |
The id of the cost center |
| string |
Description |
The description of the cost center |
| string |
Name |
The name of the cost center |
| bool |
IsDefault |
Indicates, wheter this cost center should be considered as the default cost center for the company |
| BillingInformation_v2 |
BillingInformation |
Billing information |
Example code (C#):
var billingInformation = new BillingInformation { CostCenterId = 1, CompanyName = "TestCompanyName", TaxNumber = "87654321", City = "City", Zip = "Zip", StreetName = "StreetName", StreetType = "StreetType", Number = "11", Floor = "22", Door = "33", ExtId = "TC5698", }; var costCenter = new CostCenter_v2 { Id = 1, Description = "Default cost center", Name = "Default", IsDefault = true, BillingInformation = billingInformation, }
Description:
This class holds the daily worktime report's feature list
Members:
| Type |
Name |
Description |
| string |
TotalWorkTimeTotalGross |
All types of worktimes total gross time. |
| string |
ComputerWorkTimeTotalGross |
Computer worktimes total gross time. |
| string |
MobileWorkTimeTotalGross |
Mobile worktimes total gross time. |
| string |
MobileCallWorkTimeGross |
Mobile call times total gross time. |
| string |
ManualWorkTimeTotalGross |
Manual worktimes total gross time. |
| string |
MeetingWorkTimeGross |
Meeting worktimes total gross time. |
| string |
ActiveComputerWorkTime |
Active worktimes on desktop. |
| string |
IdleComputerWorkTime |
Idle worktimes on desktop. |
| string |
BusyWorkTime |
Page load times on desktop. |
Example code (C#):
public class DailyWorkTimeFeatures { public const string TotalWorkTimeTotalGross = "TotalWorkTimeTotalGross"; public const string ComputerWorkTimeTotalGross = "ComputerWorkTimeTotalGross"; public const string MobileWorkTimeTotalGross = "MobileWorkTimeTotalGross"; public const string MobileCallWorkTimeGross = "MobileCallWorkTimeGross"; public const string ManualWorkTimeTotalGross = "ManualWorkTimeTotalGross"; public const string MeetingWorkTimeGross = "MeetingWorkTimeGross"; public const string ActiveComputerWorkTime = "ActiveComputerWorkTime"; public const string IdleComputerWorkTime = "IdleComputerWorkTime"; public const string BusyWorkTime = "BusyWorkTime"; }
Description:
Content holder class for the DailyWorktime report
Members:
| Type |
Name |
Description |
| List<ReportColumn> |
ReportColumns |
Report column description list |
| List<DailyWorkTimeReportData> |
UserTaskView |
Report data for the User-Task view sheet. The information is stored in an object which is type of DailyWorkTimeReportData. |
| List<DailyWorkTimeReportData> |
TaskUserView |
Report data for the Task-User view sheet. The information is stored in an object which is type of DailyWorkTimeReportData. |
| List<KeyValueIntString> |
ExternalKeysByTaskIdList |
Task id to external key mapping by using a class with az int Key and string Value members |
Example code (C#):
DateTime startDate = new DateTime(2017, 1, 10); DateTime endDate = new DateTime(2017, 1, 11);
using (var api = new API()) { DailyWorktimeReport report; var ret = api.GetDailyWorktimeReport(AuthCode, startDate, endDate, null, null, null, out report);
if (ret != GetDailyWorktimeReportRet.OK) Console.WriteLine("Error getting daily worktime report, error code: {0}", ret); }
Description:
Report one row data holder class
Members:
| Type |
Name |
Description |
| string |
FirstName |
First name of the user appearing in the report |
| string |
LastName |
Last name of the user appering in the report |
| int |
UserId |
The id of the user appering in the report |
| string |
TaskName |
Task name appearing in the report |
| int |
TaskId |
Id of the task |
| int |
ProjectId |
Parent id of the task |
| List<ReportKeyValue> |
TimesByColumnList |
A list of ReportKeyValues, which class has 2 members: Key is ReportColumn class, Value is a DailyWorktimes class |
| List<string> |
ParentTaskNames |
List of the parent project names of the current task |
| List<string> |
ParentWorkerGroupNames |
List of workergroup names of the current user |
Example code (C#):
DateTime startDate = new DateTime(2017, 1, 10); DateTime endDate = new DateTime(2017, 1, 11);
using (var api = new API()) { DailyWorktimeReport report; var ret = api.GetDailyWorktimeReport(AuthCode, startDate, endDate, null, null, null, out report);
if (ret != GetDailyWorktimeReportRet.OK) Console.WriteLine("Error getting daily worktime report, error code: {0}", ret); }
Description:
Daily worktimes report content holder class
Members:
| Type |
Name |
Description |
| long |
TotalGrossTotalTimeMs |
All types of worktime, total time in milliseconds |
| long |
GrossTotalTimeMs |
Not used, always 0 |
| long |
TotalGrossTotalComputerTimeMs |
Desktop worktime, total time in milliseconds |
| long |
GrossTotalComputerTimeMs |
Not used, always 0 |
| long |
TotalActiveTimeMs |
Active worktime, total time in milliseconds |
| long |
TotalIdleTimeMs |
Idle time, total time in milliseconds |
| long |
TotalGrossTotalIvrTimeMs |
IVR worktime, total time in milliseconds |
| long |
GrossTotalIvrTimeMs |
Not used, always 0 |
| long |
TotalGrossTotalMobileTimeMs |
Mobile worktime, total time in milliseconds |
| long |
GrossTotalMobileTimeMs |
Not used, always 0 |
| long |
TotalMobileCallTimeMs |
Mobile call time, total time in milliseconds |
| long |
TotalGrossTotalManualTimeMs |
Manually added worktime, total time in milliseconds |
| long |
GrossTotalManualTimeMs |
Not used, always 0 |
| long |
TotalMeetingTimeMs |
Meeting type worktime, total time in milliseconds |
| long |
TotalBusyTimeMs |
Page load times, total time in milliseconds |
Example code (C#):
public class DailyWorkTimes { public long TotalGrossTotalTimeMs { get; set; } public long GrossTotalTimeMs { get; set; } public long TotalGrossTotalComputerTimeMs { get; set; } public long GrossTotalComputerTimeMs { get; set; } public long TotalActiveTimeMs { get; set; } public long TotalIdleTimeMs { get; set; } public long TotalGrossTotalIvrTimeMs { get; set; } public long GrossTotalIvrTimeMs { get; set; } public long TotalGrossTotalMobileTimeMs { get; set; } public long GrossTotalMobileTimeMs { get; set; } public long TotalMobileCallTimeMs { get; set; } public long TotalGrossTotalManualTimeMs { get; set; } public long GrossTotalManualTimeMs { get; set; } public long TotalMeetingTimeMs { get; set; } public long TotalBusyTimeMs { get; set; } }
Description:
Data collector definiton holder class
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the definition |
| string |
Name |
Name of the definition appearing in definition list |
| string |
Description |
Detailed description of the definition |
Example code (C#):
DataCollectorDefinition[] definitions;
using (API api = new API()) { var ret = api.GetCompanyDataCollectorReportDefinitions(AuthCode, out definitions); } if (ret != GetCompanyDataCollectorReportDefinitionsRet.OK) { Log("Error getting company data collector defintions: " + ret); } else { foreach (var definition in definitions) { Log(string.Format("Id: {0}, Name: {1}, Description: {2}", definition.Id, definition.Name, definition.Description)); } }
Description:
Data collector report result data holder class
Members:
| Type |
Name |
Description |
| DataSet |
ResultSet |
The DataSet class is a list of DataTable classes, which represents a result set in the data collector output |
Example code (C#):
var startDate = new DateTime(2015, 10, 1); var endDate = new DateTime(2015, 10, 2);
using (var api = new API()) { DataCollectorReport report; var ret = api.GetDataCollectorReport(AuthCode, startDate, endDate, null, null, definitionId, 120, out report);
if (ret != GetDataCollectorReportRet.OK) { Console.WriteLine("Error getting data collector report, Id {0}, error code: {1}", definitionId, ret); } else { Console.WriteLine("Listing report content information for {0} result sets:", report.ResultSet.Tables.Length); foreach (var dataTable in report.ResultSet.Tables) { Console.WriteLine("Result set name: {0}", dataTable.TableName); Console.WriteLine("The dataset has {0} column(s) and {1} row(s)", dataTable.Columns.Length, dataTable.Rows.Length);
if (dataTable.Hide.HasValue && dataTable.Hide.Value) Console.WriteLine("The dataset should be hidden when rendering the output for user"); else Console.WriteLine("The dataset should be shown when rendering the output for user");
Console.WriteLine(dataTable.Delete ? "The dataset should be deleted before rendering the output for user" : "The dataset should not be deleted when rendering the output for user"); } } }
Description:
The DataTable class represent a result set in the data collector reports
Members:
| Type |
Name |
Description |
| List<DataColumn> |
Columns |
Columns holds a list of DataColumn classes, which describes the columns of the report, with 2 members: string ColumnName, string DataType |
| List<DataRow> |
Rows |
Rows holds a list of objects containing cell data |
| string |
TableName |
The name of the data table |
| bool? |
Hide |
Indicates whether the datatable should be visible in the Excel output (used when dataset contains data for pivots or contains information that is not important for the user) |
| bool |
Delete |
Indicates whether the datatable should be deleted in the Excel output of the report (used in case when the template contains information which is not public for the user) |
Example code (C#):
var startDate = new DateTime(2015, 10, 1); var endDate = new DateTime(2015, 10, 2);
using (var api = new API()) { DataCollectorReport report; var ret = api.GetDataCollectorReport(AuthCode, startDate, endDate, null, null, definitionId, 120, out report);
if (ret != GetDataCollectorReportRet.OK) { Console.WriteLine("Error getting data collector report, Id {0}, error code: {1}", definitionId, ret); } else { Console.WriteLine("Listing report content information for {0} result sets:", report.ResultSet.Tables.Length); foreach (var dataTable in report.ResultSet.Tables) { Console.WriteLine("Result set name: {0}", dataTable.TableName); Console.WriteLine("The dataset has {0} column(s) and {1} row(s)", dataTable.Columns.Length, dataTable.Rows.Length);
if (dataTable.Hide.HasValue && dataTable.Hide.Value) Console.WriteLine("The dataset should be hidden when rendering the output for user"); else Console.WriteLine("The dataset should be shown when rendering the output for user");
Console.WriteLine(dataTable.Delete ? "The dataset should be deleted before rendering the output for user" : "The dataset should not be deleted when rendering the output for user"); } } }
Description:
DictionaryAutoRules and DictionaryAutoRuleSample (samples) are a representation of Rules that change the user's pc client's behaviour.
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the dictionary autorule. |
| int |
LastUpdatedBy |
READONLY. Id of the User who modified the DictionaryAutoRule last. Dont set, only for getting data. |
| DateTime |
LastUpdatedAt |
READONLY. Last modification date. Dont set, only for getting data. |
| DictionaryAutoRuleAssignmentBase |
Assignment |
Can be StartWorkDictionaryAutoRuleAssignment or StopWorkDictionaryAutoRuleAssignment. |
| DictionaryAutoRuleContentBase |
Content |
Can be SimpleDictionaryAutoRuleContent or ComplexDictionaryAutoRuleContent. |
Example code (C#):
Description:
Empty base class to wraps StartWorkDictionaryAutoRuleAssignment and StopWorkDictionaryAutoRuleAssignment.
Members:
Example code (C#):
Description:
Empty base class, wraps SimpleDictionaryAutoRuleContent and ComplexDictionaryAutoRuleContent.
Members:
Example code (C#):
Description:
Contains the keywords and its details. Cannot be null or empty.
Members:
| Type |
Name |
Description |
| string |
Keyword |
Keyword |
| bool |
IsRegex |
Defines whether the Keyword is in regex form or not. If IsRegex is true, IsStartFixed and IsEndFixed must be null. If false, IsStartFixed and IsEndFixed cannot be null |
| bool? |
IsStartFixed |
If set to true, no character is allowed before the Keyword, it set to false, anything can appear before it (a "test" keyword with IsStartFixed set to true would not match for an "aaatest" word, but for a "testaaa"). If IsRegex is true, this must be null. If IsRegex is false, this cannot be null. |
| bool? |
IsEndFixed |
If set to true, no character is allowed after the Keyword, it set to false, anything can appear ater it (a "test" keyword with IsEndFixed set to true would not match for an "testaaa" word, but for an "aaatest"). If IsRegex is true, this must be null. If IsRegex is false, this cannot be null. |
Example code (C#):
Description:
DictionaryAutoRuleSample and DictionaryAutoRuleParameter pairs.
Members:
| Type |
Name |
Description |
| int |
SampleId |
Id of a DictionaryAutoRuleSample. |
| int |
ParameterId |
Id of a DictionaryAutoRuleSampleParameter. |
Example code (C#):
Description:
Inherits from DictionaryAutoRuleParameter. ComplexDictionaryAutoRuleContent has got multiple parameters, and those parameters can have different keywords and relations.
Members:
| Type |
Name |
Description |
| DictionaryAutoRuleRelation |
Relation |
Relation defines the relation between the Keywords (Like "word1 and word2 and word3 and word4", or it can also be "word1 or word2 or word3 or word4". The relations cannot be used as "word1 and word2 or word3"). If there is one word only, it must be null (one word does not have relation). If there are more than one word, cannot be null (Relation.Id can be 0). |
| List<DictionaryAutoRuleKeywordDetails> |
KeywordDetails |
Contains the keywords and its details. Cannot be null or empty. |
Example code (C#):
Description:
Relation defines the relation between the Keywords (Like "word1 and word2 and word3 and word4", or it can also be "word1 or word2 or word3 or word4". The relations cannot be used as "word1 and word2 or word3"). If there is one word only, it must be null (one word does not have relation). If there are more than one word, cannot be null (Relation.Id can be 0).
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the relation. Can be 0. |
| int |
IsAndRelation |
Defines the relation between the words ("OR" or "AND" relation) |
Example code (C#):
Description:
DictionaryAutoRules and DictionaryAutoRuleSamples (samples) are a representation of Rules that change the user's pc client's behaviour.
The base of every DictionaryAutoRule (not baseclass).
Besides of the fact that DictionaryAutoRules are always assigned to a task or (users and/or roles), they are always assigned to one or more DictionaryAutoRuleSampleId and DictionaryAutoRuleSampleParameterId pair.
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the sample |
| string |
Name |
Name of the sample |
| short |
Priority |
Priority defines the order of the generated rules. The higher the priority the earlier its condition will be evaluated (first wins). |
| DictionaryAutoRuleType |
Type |
Type of a DictionaryAutoRuleSample. It can be 1 = StartWork (jc pc client switches to a specific task), 2 = StopWork (jc pc client goes offline (icon turns red)) |
| List<DictionaryAutoRuleSampleParameter> |
Parameters |
DictionaryAutoRuleSampleParameter of the sample. Complex samples have got more than 1 parameters, simple samples have got only 1 |
Example code (C#):
Description:
Parameters of a DictionaryAutoRuleSample. One parameter can only exist under one sample.
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the dictionary autorule sample parameter |
| string |
Name |
Name of the dictionary autorule sample parameter |
Example code (C#):
Description:
A Holiday object represents a user's requested or approved holiday for an interval.
Members:
| Type |
Name |
Description |
| int |
Id |
The Id of the holiday. |
| int |
UserId |
The Id of the user. |
| DateTime |
StartDate |
First day of the holiday. |
| DateTime |
EndDate |
Last day of the holiday. Can be equal or greater than StartDate. |
| int |
DailyDurationInMins |
Length of the holiday per day. E.g. A full day might be 480 mins per day (8 hours/day), a half day migth be 240 mins (4 hour/day). |
| int |
NumberOfWorkDays |
Number of workdays between the StartDate and EndDate (where workdays means: not national holidays or weekends). Calculated by JC360's calendar. |
| int? |
HolidayCategoryId |
The Id of the holiday's category. Null when holiday's category is the default annual holiday. |
| int? |
ApprovedBy |
The Id of the user who approved the holiday. It is Null when holiday is not approved yet. |
| bool? |
IsWholeDay |
Whether the holiday is a whole day or a partial day. It is Null only for backward compatibility. |
Example code (C#):
Holiday[] holidays; using (API api = new API()) { api.GetHolidaysForCompany(AuthCode, out holidays); }
// find the holiday you want and process it var holiday = holidays.First(); var dailyDurationInMins = holiday.DailyDurationInMins; //e.g. 8 * 60 var approvedBy = holiday.ApprovedBy; // null or approverId var userId = holiday.UserId; // UserId of a worker var startDate = holiday.StartDate; // new DateTime(2014, 1, 2) var endDate = holiday.EndDate; // new DateTime(2014, 1, 3) var holidayCategoryId = holiday.HolidayCategoryId; // null or an existing holidayCategoryId var numberOfWorkDays = holiday.NumberOfWorkDays; // 2 days var isWholeDay = holiday.IsWholeDay; //e.g. true
Description:
A HolidayCategory object represents a holiday category of the company.
Members:
| Type |
Name |
Description |
| int |
Id |
The Id of the holiday category. |
| string |
Name |
Name of the holiday category (e.g. "Study leave", "Unpaid holiday", "Other", etc...). |
| byte |
Rank |
Order number of category in holiday category list. This is important when the holiday cannot be explicitly requested (i.e. part of the default annual holiday category). When annual holidays are requested, the holidays with greater Rank is "used" first. |
| bool |
Requestable |
Shows whether a holiday having this holiday category can be requested explicitly or it is a part of the default annual holiday category (cannot be explicitly selected). |
| string |
RGBColorCode |
RGB color code of the category which is used on the website to differentiate holidays from each other by category. Can be maximum 6-char long. |
| bool |
Paid |
Shows whether a holiday having this holiday category is paid or not (i.e. user will gain worktime or not). |
Example code (C#):
HolidayCategory[] holidayCategories; using (API api = new API()) { api.GetHolidayCategories(AuthCode, out holidayCategories); }
// find the holiday category you want and process it var holidayCategory = holidayCategories.First(); int holidayCategoryId = holidayCategory.Id; string RGBColorCode = holidayCategory.RGBColorCode; // e.g. "ffffff" string name = holidayCategory.Name; // e.g. "Study Leave" bool paid = holidayCategory.Paid; // e.g. true byte rank = holidayCategory.Rank; // e.g. 1 bool requestable = holidayCategory.Requestable; //e.g. true
Description:
A HolidayLimit object represents a user's yearly holiday limits by holiday categories.
Members:
| Type |
Name |
Description |
| int |
Id |
The Id of the holidayLimit object. |
| int |
UserId |
The Id of the user. |
| int |
Year |
The year the limit is applied for. |
| CategoryLimit[] |
CategoryLimits |
List of the limits by category. The information is stored in an object which is type of CategoryLimit. |
Example code (C#):
var userId = 1234567; var holidayCategoryId1 = 100; var holidayCategoryId2 = 101; var holidayCategoryId3 = 102; var holidayLimitToUpload = new HolidayLimit { UserId = userId, Year = 2013, CategoryLimits = new CategoryLimit[] { new CategoryLimit{ CategoryId = holidayCategoryId1, LimitInMins = 200}, new CategoryLimit{ CategoryId = holidayCategoryId2, LimitInMins = 300}, new CategoryLimit{ CategoryId = holidayCategoryId3, LimitInMins = 400} } }; using (API api = new API()) { api.AddHolidayLimitsForUser(AuthCode, holidayLimitToUpload); }
HolidayLimit[] holidayLimits; using (API api = new API()) { api.GetHolidayLimitsOfUser(AuthCode, userId, out holidayLimits); } var holidayLimit = holidayLimits.First(t => t.Year == 2013); var limit1 = holidayLimit.Limits.First(t => t.CategoryId == holidayCategoryId1).LimitInMins); // 200 var limit2 = holidayLimit.Limits.First(t => t.CategoryId == holidayCategoryId2).LimitInMins); // 300 var limit3 = holidayLimit.Limits.First(t => t.CategoryId == holidayCategoryId3).LimitInMins); // 400 using (API api = new API()) { api.RemoveHolidayLimitsForUser(AuthCode, holidayLimit.Id); }
Description:
An HourlyWage object represents a time interval with a given amount of hourly wage.
Members:
| Type |
Name |
Description |
| DateTime |
StartDate |
StartDate is the beginning of the interval and the ending of the preceding interval. |
| decimal |
Amount |
The amount of hourly wage in the interval. |
Example code (C#):
// The following list desribes to following hourly wage changes of a given user: // Before 2010.01.01 : 0 // 2010.01.01 - 2011.01.01 : 3000 // 2011.01.01 - 2011.06.01 : 4000 // After 2011.06.01 : 5000 var wages = new HourlyWage[] { new HourlyWage { StartDate = new DateTime(2010, 1, 1), Amount = 3000 }, new HourlyWage { StartDate = new DateTime(2011, 1, 1), Amount = 4000 }, new HourlyWage { StartDate = new DateTime(2011, 6, 1), Amount = 5000 }, };
Description:
WorktimeSchedule excel import
Members:
| Type |
Name |
Description |
| string |
Message |
|
| bool |
IsWarning |
|
Example code (C#):
Description:
Contains data of a manual workitem
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the WorktimeSchedule_v2 |
| ManualWorkItemType? |
ManualWorkItemType |
The type of the manual workitem, which can be one of the following value of the ManualWorkItemType enum: AddWork, ReplaceInterval. Contains value only when IsRequested property is true. |
| int? |
TaskId |
Id of the task for the manual workitem |
| DateTime |
StartDate |
Start date of the manual workitem in UTC |
| DateTime |
EndDate |
End date of the manual workitem in UTC |
| int |
UserId |
Id of the user |
| string |
Comment |
Comment of the manual workitem |
| DateTime |
CreateDate |
Creation date of the manual workitem in UTC |
| int? |
CreatedBy |
Id of the user who created the manual workitem |
Example code (C#):
using (var api = new API()) { var authCode = Guid.NewGuid(); var targetUserId = 123456; var startDateInUtc = DateTime.UtcNow.AddMonths(-1); var endDateInUtc = DateTime.UtcNow; ManualWorkItem[] manualWorkitemsOfUser;
var ret = api.GetManualWorkitemsOfUser(AuthCode, targetUserId, startDateInUtc, endDateInUtc, out manualWorkitemsOfUser);
if (ret != GetManualWorkitemsRet.OK) Console.WriteLine("Error getting manualworkitems of the user"); else { foreach (var manualWorkitem in manualWorkitemsOfUser) { Console.WriteLine($"Id: {manualWorkitem.Id} ManualWorkItemType: {manualWorkitem.ManualWorkItemType.ToString()}, TaskId: {manualWorkitem.TaskId} StartDate: {manualWorkitem.StartDate} EndDate: {manualWorkitem.EndDate} UserId: {manualWorkitem.UserId} Comment: {manualWorkitem.Comment} CreateDate: {manualWorkitem.CreateDate} CreatedBy: {manualWorkitem.CreatedBy}"); } } }
Description:
OrganizationHierarchy consists of OrganizationHierarchyItem objects. OrganizationHierarchyItem contains the common members of the specialized items like WorkerGroup and Worker.
Members:
| Type |
Name |
Description |
| int |
Id |
This value is the internal ID (in JC360 system) of the current item. This can be left null during import. |
| int |
ParentId |
This value is the internal ID (in JC360 system) of the current item's parent. This can be left null during import. |
| string |
ExtId |
Custom External identifier of items. This value is used to detect whether this item already exists in the JC360 system. When this value is null, it means the item was added in JC360 system. |
| OrganizationHierarchyItem_v2[] |
Children |
List of items which are "hierarchically under" the current item. |
| OrganizationHierarchyItemStatus |
Status |
This value is optional and can be left default during import. It's values can be: Active, Disabled, Deleted. |
| DateTime |
DeletedAt |
This field shows when the item was deleted. When the value is null, it means the item is not deleted. |
Example code (C#):
var organizationHierarchy = new OrganizationHierarchy_v2();
var root = new RootWorkerGroup_v2();
var group1 = new WorkerGroup_v2 { ExtId = "1AA", Name = "Group1" }; var group2 = new WorkerGroup_v2 { ExtId = "2AA", Name = "Group2" }; var group3 = new WorkerGroup_v2 { ExtId = "3AA", Name = "Group3" }; var group4 = new WorkerGroup_v2 { ExtId = "104AA", Name = "Group4" }; var worker1 = new Worker_v2 { ExtId = "4AA", LastName = "Worker1", Email = "worker1@example.com", FirstName = "FirstName"}; var worker2 = new Worker_v2 { ExtId = "5AA", LastName = "Worker2", Email = "worker2@example.com", FirstName = "FirstName" }; var worker3 = new Worker_v2 { ExtId = "6AA", LastName = "Worker3", Email = "worker3@example.com", FirstName = "FirstName" }; var worker4 = new Worker_v2 { ExtId = "7AA", LastName = "Worker4", Email = "worker4@example.com", FirstName = "FirstName" }; var worker5 = new Worker_v2 { ExtId = "8AA", LastName = "Worker5", Email = "worker5@example.com", FirstName = "FirstName" }; var worker6 = new Worker_v2 { ExtId = "9AA", LastName = "Worker6", Email = "worker6@example.com", FirstName = "FirstName" };
group1.Children = new OrganizationHierarchyItem_v2[] { worker1, worker2 }; group2.Children = new OrganizationHierarchyItem_v2[] { worker3, worker4 }; group3.Children = new OrganizationHierarchyItem_v2[] { worker5, worker6 }; group4.Children = new OrganizationHierarchyItem_v2[] { };
root.Children = new OrganizationHierarchyItem_v2[] { group1, group2, group3, group4 };
organizationHierarchy.Root = root;
Description:
This class holds the planning period data which is used in planning the projects with more than one cost/time usage period
Members:
| Type |
Name |
Description |
| int |
PeriodId |
The id of the planning period in the system |
| string |
Name |
The name of the planning period in the system |
| DateTime |
StartDate |
Start date of the planning period |
| DateTime |
EndDate |
End date of the planning period |
| bool |
IsDefault |
Indicates whether this period should be the default when editing on the website |
Example code (C#):
using (var api = new API()) { PlanningPeriod[] planningPeriods; var ret = api.GetPlanningPeriods(AuthCode, out planningPeriods);
if (ret != GetPlanningPeriodsRet.OK) { Console.WriteLine("Error getting planning periods for the company, error code is {0}", ret); } else { foreach (var pp in planningPeriods) { Console.WriteLine("Period id: {0}, period name: {1}, period start date: {2}, period end date: {3}, is default: {4}", pp.PeriodId, pp.Name, pp.StartDate, pp.EndDate, pp.IsDefault); } } }
Description:
Members:
| Type |
Name |
Description |
| int |
UserId |
Id of the user in the membership information |
| int |
ProjectId |
Id of the project in the membership information |
| string |
ProjectName |
Name of the project in the membership information |
| bool |
IsLeader |
Indicates whether the user is leader or member in the membership |
| string |
FirstName |
First name of the user |
| string |
LastName |
Last name of the user |
Example code (C#):
using (var api = new API()) { var projectId = 5521; ProjectMembership[] projectMemberships; var ret = api.GetProjectMembersOfProject(AuthCode, projectId, out projectMemberships);
if (ret != GetProjectMembersOfProjectRet.OK) { Console.WriteLine("Error getting project membership for project {0}, error code is: {1}", projectId, ret); } else { foreach (var pm in projectMemberships) { Console.WriteLine("UserId: {0}, Project id: {1}, IsLeader: {2}", pm.UserId, pm.ProjectId, pm.IsLeader); } } }
Description:
A ProjectParticipant object represents a user who is assigned to a project.
Members:
| Type |
Name |
Description |
| int |
UserId |
User's Id of the ProjectParticipant. |
| bool |
IsLeader |
Shows whether the user is a project leader or a simple project member. |
Example code (C#):
var leaderParticipant = new ProjectParticipant { UserId = Worker1UserId, IsLeader = true }; var memberParticipant = new ProjectParticipant { UserId = Worker2UserId, IsLeader = false };
Description:
A ProjectReportHierarchy represents the return value of a project report returned by API. It has a hierarchical structure, exactly the same as the format of Excel-based report on website. ProjectReportHierarchy consists of ProjectReportItem object which is basically a line of the Excel report. You can traverse this structure starting from Root through Children member of each contained items.
Members:
| Type |
Name |
Description |
| ProjectReportItem |
Root |
Root item of the report. You can traverse the whole report by getting the children of each element. Each element represent a single row in the Excel output based report. |
| TaskCategoryData[] |
TaskCategories |
List of objects which are type of TaskCategoryData, making this information usable in the report. |
Example code (C#):
DateTime startDate = new DateTime(2013, 1, 10); DateTime endDate = new DateTime(2013, 1, 15); ProjectReportHierarchy_v2 report;
// get the report using (API api = new API()) { api.GetProjectReport_v2(AuthCode, startDate, endDate, null, null, out report); }
// get root of the hierarchy (company-wide total costs and times) var totalTime = report.Root.TotalTime; // value in ms; var totalCost = report.Root.InnerTotalCost;
// get a containing project (Type is ProjectReportItemType.Project, has no UserId defined) var projectId = report.Root.Children[0].TaskId; var projectTotalTime = report.Root.Children[0].TotalTime; // value in ms; var projectTotalCost = report.Root.Children[0].InnerTotalCost;
// get a containing work in project (Type is ProjectReportItemType.Work, has no UserId defined) var workId = report.Root.Children[0].Children[0].TaskId; var workTotalTime = report.Root.Children[0].Children[0].TotalTime; // value in ms; var workTotalCost = report.Root.Children[0].Children[0].InnerTotalCost;
// get assignments of the work which are the next siblings after the work (Type is ProjectReportItemType.AssignedWork and has UserId defined) var assignedUserId1 = report.Root.Children[0].Children[1].UserId; // e.g. worker1UserId var assignmentWorkId1 = report.Root.Children[0].Children[1].TaskId; // this is the same as workId var assignmentTotalTime1 = report.Root.Children[0].Children[1].TotalTime; // value in ms; var assignmentTotalCost1 = report.Root.Children[0].Children[1].InnerTotalCost;
var assignedUserId2 = report.Root.Children[0].Children[2].UserId; // e.g. worker2UserId var assignmentWorkId2 = report.Root.Children[0].Children[2].TaskId; // this is the same as workId var assignmentTotalTime2 = report.Root.Children[0].Children[2].TotalTime; // value in ms; var assignmentTotalCost2 = report.Root.Children[0].Children[2].InnerTotalCost;
Description:
A ProjectReportItem object is a single element of the ProjectReportHierarchy structure. Each element represents a row in the Excel report of project report on the website. Please check it there.
Members:
| Type |
Name |
Description |
| string |
FirstName |
Firstname of the worker. Empty when row doesn't contain user. |
| string |
LastName |
Lastname of the worker. Empty when row doesn't contain user. |
| int? |
UserId |
Id of the worker. Empty when row doesn't contain user. |
| string |
Name |
Name of the work. Empty when row contains only projects. |
| int? |
TaskId |
Id of the work. Empty when row contains only projects. |
| int? |
TaskCategoryId |
Id of the work's category. Empty when work does not have category set. |
| int? |
ProjectId |
Id of the project. Empty when row is the root summary. |
| long |
TotalTime |
This is the total time (in ms) spent on the specific work, project or root in the queried interval. |
| decimal |
InnerTotalCost |
This is the total cost spent on the specific work, project or root. |
| short? |
Priority |
Priority of the assignment/work/project. Empty when assignment/work/project does not have priority set. |
| DateTime? |
StartDate |
Start date of the assignment/work/project. Empty when assignment/work/project does not have start date set. |
| DateTime? |
EndDate |
End date of the assignment/work/project. Empty when assignment/work/project does not have end date set. |
| int? |
HoursPlanned |
Number of planned hours of the assignment/work/project. Empty when assignment/work/project does not have planned hours set. |
| long? |
SumTotalTime |
This is the total time (in ms) spent on the specific work, project or root regardless of the queried interval. Only filled when PlannedHours is not empty. |
| DateTime? |
DeletedAt |
Shows the date when the assignment/work/project was closed. |
| ProjectReportItem[] |
Children |
Contains the children items of the current ProjectReportItem object. Project can contain other project rows, work rows or assignment rows. Work rows and assignment rows does not contain any other row. |
| string[] |
ParentTaskNames |
The list contains the names of the projects containing the current assignment/work/project. |
| string[] |
ParentWorkerGroupNames |
The list contains the names of the worker groups containing the current user. |
| ProjectReportItemType |
Type |
This is the type of the item which shows whether it is a Project item, Work item or Assigment item. The root of the report has Project type. |
Example code (C#):
DateTime startDate = new DateTime(2013, 1, 10); DateTime endDate = new DateTime(2013, 1, 15); ProjectReportHierarchy_v2 report;
// get the report using (API api = new API()) { api.GetProjectReport_v2(AuthCode, startDate, endDate, null, null, out report); }
// get root of the hierarchy (company-wide total costs and times) var totalTime = report.Root.TotalTime; // value in ms; var totalCost = report.Root.InnerTotalCost;
// get a containing project (Type is ProjectReportItemType.Project, has no UserId defined) var projectId = report.Root.Children[0].TaskId; var projectTotalTime = report.Root.Children[0].TotalTime; // value in ms; var projectTotalCost = report.Root.Children[0].InnerTotalCost;
// get a containing work in project (Type is ProjectReportItemType.Work, has no UserId defined) var workId = report.Root.Children[0].Children[0].TaskId; var workTotalTime = report.Root.Children[0].Children[0].TotalTime; // value in ms; var workTotalCost = report.Root.Children[0].Children[0].InnerTotalCost;
// get assignments of the work which are the next siblings after the work (Type is ProjectReportItemType.AssignedWork and has UserId defined) var assignedUserId1 = report.Root.Children[0].Children[1].UserId; // e.g. worker1UserId var assignmentWorkId1 = report.Root.Children[0].Children[1].TaskId; // this is the same as workId var assignmentTotalTime1 = report.Root.Children[0].Children[1].TotalTime; // value in ms; var assignmentTotalCost1 = report.Root.Children[0].Children[1].InnerTotalCost;
var assignedUserId2 = report.Root.Children[0].Children[2].UserId; // e.g. worker2UserId var assignmentWorkId2 = report.Root.Children[0].Children[2].TaskId; // this is the same as workId var assignmentTotalTime2 = report.Root.Children[0].Children[2].TotalTime; // value in ms; var assignmentTotalCost2 = report.Root.Children[0].Children[2].InnerTotalCost;
Description:
Report column definition holder class
Members:
| Type |
Name |
Description |
| int |
Id |
Column id |
| StartEndDateTime |
Interval |
A struct of StartDate and EndDate members with the type of DateTime |
| ReportColumnType |
Type |
Type of the report column, which can be one of the following value of the ReportColumnType enum: WorkerGroupName,WorkerName,ProjectName,TaskName,Date,Time,Description,ProcessName,WindowSize,SingleDay,Summary,Average,WindowIsActive,RawText |
| int |
Id |
Column id |
Example code (C#):
Description:
A RequiredCloseReasons object contains the attributes of close reasoning.
Members:
| Type |
Name |
Description |
| DateTime? |
AfterDate |
You can set whether the user must comment before closing task after a specified date. Leave null by default. |
| int? |
AfterTimeInMins |
You can set whether the user must comment before closing task after a specified time spent working on it. Leave null by default. |
| int? |
RepeatIntervalInMins |
You can set whether the user must comment repeatedly before closing task. Leave null by default. |
| int? |
RepeatingTimes |
You can set how many times the user must comment before closing task. Leave null by default. |
Example code (C#):
Description:
RootWorkerGroup class is a derived from OrganizationHierarchyItem class, so it has the inherited members, nothing else. A hierarchy can contain only one RootWorkerGroup and it must be placed on the top of the hierarchy.
Members:
Example code (C#):
var organizationHierarchy = new OrganizationHierarchy_v2();
var root = new RootWorkerGroup_v2();
var group1 = new WorkerGroup_v2 { ExtId = "1AA", Name = "Group1" }; var group2 = new WorkerGroup_v2 { ExtId = "2AA", Name = "Group2" }; var group3 = new WorkerGroup_v2 { ExtId = "3AA", Name = "Group3" }; var group4 = new WorkerGroup_v2 { ExtId = "104AA", Name = "Group4" }; var worker1 = new Worker_v2 { ExtId = "4AA", LastName = "Worker1", Email = "worker1@example.com", FirstName = "FirstName"}; var worker2 = new Worker_v2 { ExtId = "5AA", LastName = "Worker2", Email = "worker2@example.com", FirstName = "FirstName" }; var worker3 = new Worker_v2 { ExtId = "6AA", LastName = "Worker3", Email = "worker3@example.com", FirstName = "FirstName" }; var worker4 = new Worker_v2 { ExtId = "7AA", LastName = "Worker4", Email = "worker4@example.com", FirstName = "FirstName" }; var worker5 = new Worker_v2 { ExtId = "8AA", LastName = "Worker5", Email = "worker5@example.com", FirstName = "FirstName" }; var worker6 = new Worker_v2 { ExtId = "9AA", LastName = "Worker6", Email = "worker6@example.com", FirstName = "FirstName" };
group1.Children = new OrganizationHierarchyItem_v2[] { worker1, worker2 }; group2.Children = new OrganizationHierarchyItem_v2[] { worker3, worker4 }; group3.Children = new OrganizationHierarchyItem_v2[] { worker5, worker6 }; group4.Children = new OrganizationHierarchyItem_v2[] { };
root.Children = new OrganizationHierarchyItem_v2[] { group1, group2, group3, group4 };
organizationHierarchy.Root = root;
Description:
A SickLeave object represents a user's sick leave for an interval.
Members:
| Type |
Name |
Description |
| int |
Id |
The Id of the sick leave. |
| int |
UserId |
The Id of the user. |
| DateTime |
StartDate |
First day of the sick leave. |
| DateTime |
EndDate |
Last day of the sick leave. Can be equal or greater than StartDate. |
| int |
DailyDurationInMins |
Length of the sick leave per day. E.g. A full day might be 480 mins per day (8 hours/day), a half day migth be 240 mins (4 hour/day). |
| int |
NumberOfWorkDays |
Number of workdays between the StartDate and EndDate (where workdays means: not national holidays or weekends). Calculated by JC360's calendar. |
| bool? |
IsWholeDay |
Whether the holiday is a whole day or a partial day. It is Null only for backward compatibility. |
Example code (C#):
SickLeave[] sickLeaves; using (API api = new API()) { api.GetSickLeavesForCompany(AuthCode, out sickLeaves); }
// find the sick leave you want and process it var sickleave = sickLeaves.First(); var dailyDurationInMins = sickleave.DailyDurationInMins; //e.g. 8 * 60 var userId = sickleave.UserId; // UserId of a worker var startDate = sickleave.StartDate; // new DateTime(2014, 1, 2) var endDate = sickleave.EndDate; // new DateTime(2014, 1, 3) var numberOfWorkDays = sickleave.NumberOfWorkDays; // 2 days var isWholeDay = holiday.IsWholeDay; //e.g. true
Description:
Inherits from DictionaryAutoRuleContentBase. You can assign the sameDictionaryAutoRuleKeywordDetails to multiple and different samples(and to that only 1 parameter under the sample)
Members:
| Type |
Name |
Description |
| List<DictionaryAutoRuleParameter> |
Parameters |
SampleId/Parameters pairs the DictionaryAutoRule is assigned to. Cannot be null or empty. |
| DictionaryAutoRuleRelation |
Relation |
Relation defines the relation between the Keywords (Like "word1 and word2 and word3 and word4", or it can also be "word1 or word2 or word3 or word4". The relations cannot be used as "word1 and word2 or word3"). If there is one word only, it must be null (one word does not have relation). If there are more than one word, cannot be null (Relation.Id can be 0). |
| List<DictionaryAutoRuleKeywordDetails> |
KeywordDetails |
Contains the keywords and its details. Cannot be null or empty. |
Example code (C#):
Description:
Inherits from DictionaryAutoRuleAssignmentBase. Describes a DictionaryAutoRule that is StartWork.
Members:
| Type |
Name |
Description |
| int |
TaskId |
Id of the task the StartWorkDictionaryAutoRule is assigned to. Cannot be 0. |
Example code (C#):
Description:
Inherits from DictionaryAutoRuleAssignmentBase. Describes a DictionaryAutoRule that is StopWork.
Members:
| Type |
Name |
Description |
| HashSet<int> |
UserIds |
Ids of the users the StopWorkDictionaryAutoRule is assigned to. Cannot be null if RoleIds is null. |
| HashSet<int> |
RoleIds |
Ids of the roles the StopWorkDictionaryAutoRule is assigned to. Cannot be null if UserIds is null. |
Example code (C#):
Description:
This class is used for setting and updating users's system settings. When the set values are null, the global inherited setting will be displayed in the effective settings.
Members:
| Type |
Name |
Description |
| int |
UserId |
The id of the user for who the effective settings was calculated |
| CoreTimeSetting |
CoreTime |
The CoreTimeSetting class holds the effective settings for the user in the core time region of the system settings. |
| ClientSetting |
Client |
The ClientSetting class holds the effective settings for the user in the client region of the system settings. |
| MeetingSetting |
Meeting |
The MeetingSetting class holds the effective settings for the user in the meeting region of the system settings. |
| MobileSetting |
Mobile |
The MobileSetting class holds the effective settings for the user in the mobile region of the system settings. |
| IncidentManagerSetting |
IncidentManager |
The IncidentManagerSetting class holds the effective settings for the user. This class is included only for backward compatibility. |
| OtherSetting |
Other |
The OtherSetting class holds the effective settings for the user in the other region of the system settings. |
Example code (C#):
var systemSetting = new SystemSetting { UserId = Worker1UserId, CoreTime = new CoreTimeSetting { StartTime = null, EndTime = null, MinimumWorkTime = null, StartOffset = null, EndOffset = null }, Client = new ClientSetting { WorktimeStartInMins = null, WorktimeEndInMins = null, AfterWorktimeIdleInMins = null, DuringWorkTimeIdleInMins = null, DuringWorkTimeIdleManualIntervalInMilisec = null, MaxManualMeetingIntervalInMilisec = null, RuleRestrictions = null, ScreenshotQuality = null, BusyTimeThreshold = null, MaxOfflineWorkItems = null, CoincidentalClientsEnabled = null, DefaultTaskId = null, IsOutlookAddinMailTrackingUseSubject = null }, Meeting = new MeetingSetting { EnableMeetingTracking = null, EnableLotusNotesMeetingTracking = null, DefaultTaskId = null, IsMeetingSubjectMandatory = null, IsOfflineWorkingTimeRequestAutomatic = null, SynchronizeCalendarMeetingModifications = null, AllowApprovalOfMeetingsLongerOrEqualThan24Hours = null, KeepMeetingParallelWorktime = null, AreTentativeMeetingsSynched = null }, Mobile = new MobileSetting { LocationTrackMode = null, PrivateCallDuration = null, AfterWorkTimeIdleMinutes = null, WorkCallDuration = null }, IncidentManager = new IncidentManagerSetting(), // Obsolete, so not explained Other = new OtherSetting { CostCenterId = null, TimeZoneId = null, CalendarId = null, DailyWorkTimeInMinutes = 480, TargetWorkTimeIntervals = null, TaskMandatoryFields = null, TaskAssignmentMandatoryFields = null, ManualWorkItemEditAgeLimit = null, MinNumOfActiveUsersInGroup = null, MinPercentOfActiveUsersInGroup = null } };
using (var api = new API()) { api.Timeout = Int32.MaxValue;
var ret = api.UpdateSystemSettingForUser(AuthCode, systemSetting);
if (ret != UpdateSystemSettingForUserRet.OK) Console.WriteLine("Error updating system setting for user {0}, error code: {1}", Worker1UserId, ret); }
Description:
An item of TaskHierarchy object. This can be type of Root, Project or Work.
Members:
| Type |
Name |
Description |
| int |
Id |
Task's Id in JC360. |
| TaskType |
Type |
The type of the task. It can be Root, Project, Work. |
| string |
Name |
Name of the task. |
| int? |
ParentId |
Id of the task's parent task. It can be null for Root tasks. |
| int? |
ExtId |
Id of the task in the External System. It can be set during importing/exporting tasks. |
| Task_v2[] |
Children |
Tasks directly under the given task. Root can have only Projects children, Projects can have other Projects or Works, while Works can have no children. The information is stored in an object which is type of Task_v2. |
| TaskAssignment_v2[] |
AssignedTo |
List of task's assignments. Only Works can have assignments. The information is stored in an object which is type of TaskAssignment_v2. |
| int? |
MeetingDurationInMins |
This can be set only for Works. When this value is set and task is selected from PC client then the client goes offline and start a countdown until the given number of minutes elapsed. |
| bool? |
IsTasksAutoAssigned |
Obsolated, value is not used, will be removed in the future. Always pass null. |
| int? |
CategoryId |
Id of task's category. Only a Work can have this setting. |
| int? |
ExtCategoryId |
Id of task's category in the external system. Can only be set during import. Only a Work can have this setting. |
| int? |
TemplateTaskId |
Shows whether the task was generated by template. As templates cannot be reached through the API, this field will be removed in the future. |
| bool? |
IsForMobile |
Shows whether the task is shown in the menu of JC360 mobile client. Only a Work can have this setting. |
| TaskStatus |
Status |
Status of the task. It can be Active, Closed, Deleted, Planned. Use always Active or Closed. |
| DateTime? |
ClosedAt |
Date and Time when the task was closed. Null when task is active. |
| long |
Version |
Version of task. When task was changed, this version is increased. This version is globally unique so the increment is almost always greater than 1. |
| decimal? |
TargetCost |
Target cost of task. |
| int? |
TargetPlannedWorkTimeInMinutes |
Planned work time of task in minutes. |
| DateTime? |
TargetStartDate |
Target start date of task. |
| DateTime? |
TargetEndDate |
Target end date of task. |
| int? |
TaskPriority |
Priority of the task (not the same as assignments' priority). |
| string |
TaxId |
Obsolated, value is not used, will be removed in the future. Always pass null. |
| int? |
CloseAfterInactiveHours |
This can be set only for Works. When no one worked on work for the given number of hours then the task gets closed automatically. |
Example code (C#):
var assignment = new TaskAssignment_v2() { StartDate = new DateTime(2011, 1, 1), EndDate = new DateTime(2011, 2, 1), UserId = 11111111, Priority = 100, PlannedWorkTimeInMinutes = 10 * 60 // 10 hours };
var work = new Task_v2() { Name = "WorkName", Type = TaskType.Work, AssignedTo = new TaskAssignment_v2[]{assignment} };
var project = new Task_v2() { Name = "ProjectName", Type = TaskType.Project, Children = new Task_v2[] { work } };
Description:
TaskAssignment represents the relation between tasks and users.
Members:
| Type |
Name |
Description |
| int |
UserId |
User's Id in JC360. |
| int? |
ExtUserId |
User's Id in external system. |
| int |
Priority |
Priority of task assignment. |
| DateTime? |
StartDate |
Start date of task assignment. |
| DateTime? |
EndDate |
End date of task assignment. |
| int? |
PlannedWorkTimeInMinutes |
Planned work time of task assignment in minutes. |
| TaskStatus |
Status |
Status of the task assignment. It can be Active, Closed, Deleted, Planned. Use always Active or Closed. |
| DateTime? |
ClosedAt |
Date and Time when the task assignment was closed. Null when task is active. |
| long |
Version |
Version of task assignment. When task assignment was changed, this version is increased. This version is globally unique so the increment is almost always greater than 1. |
Example code (C#):
var assignment = new TaskAssignment_v2() { StartDate = new DateTime(2011, 1, 1), EndDate = new DateTime(2011, 2, 1), UserId = 11111111, Priority = 100, PlannedWorkTimeInMinutes = 10 * 60 // 10 hours };
var work = new Task_v2() { Name = "WorkName", Type = TaskType.Work, AssignedTo = new TaskAssignment_v2[]{assignment} };
Description:
A TaskCategoryData object represents a category of a Task. A category has a Name and an Id. Use this Id to set category for a specific Task.
Members:
| Type |
Name |
Description |
| string |
Name |
Name of the category. |
| int |
Id |
The Id of the category. |
Example code (C#):
using (var api = new API()) { TaskCategoryData[] taskCategories; var ret = api.GetTaskCategories(AuthCode, out taskCategories);
if (ret != GetTaskCategoriesRet.OK) { Console.WriteLine("Error getting task categories for company, error code is: {0}", ret); } else { foreach (var tc in taskCategories) { Console.WriteLine("Category id: {0}, category name: {1}", tc.Id, tc.Name); } } }
Description:
A hierarchical structure which contains the tasks of a company.
Members:
| Type |
Name |
Description |
| Task |
Root |
The root of the hierarchy. You can traverse hierarchy through its children. The information is stored in an object which is type of Task. |
Example code (C#):
TaskHierarchy_v2 modifiedhierarchy; using (API api = new API()) { // get all the tasks by passing 0 as version api.GetModifiedTasks_v2(AuthCode, 0, 0, out modifiedhierarchy); }
var someProject = modifiedhierarchy.Root.Children[0]; var someWork = someProject.Children[0]; var someAssignment = someWork.AssignedTo[0];
Description:
This class holds the data for a planned period
Members:
| Type |
Name |
Description |
| int |
PeriodId |
The id of the relared planning period in the system |
| bool |
IsDefault |
Indicates whether this is the default planning period |
| string |
Name |
Name of the planning period |
| decimal? |
TargetCost |
Value of the estamated cost for this period |
| int? |
TargetWorktimeInMinutes |
Value of the estimated worktime for this period |
Example code (C#):
var taskPlannedPeriod = new TaskPlannedPeriod_v2 { PeriodId = 1, IsDefault = false, Name = "2018 Q1", TargetCost = null, TargetWorktimeInMinutes = 200, };
Description:
DictionaryAutoRules assigned to a user.
Members:
| Type |
Name |
Description |
| int |
UserId |
Id of a user |
| List<DictionaryAutoRule> |
DictionaryAutoRules |
List of DictionaryAutoRule assigned to the user |
Example code (C#):
Description:
This class holds the calculated effective settings for one user
Members:
| Type |
Name |
Description |
| int |
UserId |
The id of the user for who the effective settings was calculated |
| CoreTimeEffectiveSetting |
CoreTime |
The CoreTimeEffectiveSettings class holds the effective settings for the user in the core time region of the system settings. |
| ClientEffectiveSetting |
Client |
The ClientEffectiveSetting class holds the effective settings for the user in the client region of the system settings. |
| MeetingEffectiveSetting |
Meeting |
The MeetingEffectiveSetting class holds the effective settings for the user in the meeting region of the system settings. |
| MobileEffectiveSetting |
Mobile |
The MobileEffectiveSetting class holds the effective settings for the user in the mobile region of the system settings. |
| IncidentManagerEffectiveSetting |
IncidentManager |
The IncidentManagerEffectiveSetting class holds the effective settings for the user in the incident manager region of the system settings. |
| OtherEffectiveSetting |
Other |
The OtherEffectiveSetting class holds the effective settings for the user in the other region of the system settings. |
Example code (C#):
using (var api = new API()) { UserEffectiveSetting[] effectiveSettings; var ret = api.GetEffectiveSettingsForUsers(AuthCode, new[] { Worker1UserId }, out effectiveSettings);
if (ret != GetEffectiveSettingsForUsersRet.OK) { Console.WriteLine("Error getting effective settings, error code: {0}", ret); } else { foreach (var es in effectiveSettings) { Console.WriteLine("Effective settings for UserId: {0}\n", es.UserId);
var ces = es.CoreTime;
Console.WriteLine("Coretime settings:"); Console.WriteLine("Core time start: {0},\nCore time finish: {1},\nMinimum worktime during coretime: {2},\nLatest start: {3} (mins),\nEarliest finish: {4} (mins)\n", TimeSpan.FromMinutes(ces.StartTime), TimeSpan.FromMinutes(ces.EndTime), TimeSpan.FromMinutes(ces.MinimumWorkTime), ces.StartOffset, ces.EndOffset);
var cles = es.Client;
var ruleRestrictions = new List<string>();
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotOverrideRules)) ruleRestrictions.Add("RuleRestrictionsCannotOverrideRules");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotCreateOrModifyRules)) ruleRestrictions.Add("RuleRestrictionsCannotCreateOrModifyRules");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotCreateOrModifyRules) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanModifyRuleTitle)) ruleRestrictions.Add("RuleRestrictionsCanModifyRuleTitle");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule)) ruleRestrictions.Add("RuleRestrictionsCannotUseAnyOkValueForLearningRule");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkDefault)) ruleRestrictions.Add("RuleRestrictionsCanUseOkDefault");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkUntilWindowClosed)) ruleRestrictions.Add("RuleRestrictionsCanUseOkUntilWindowClosed");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkForOneHour)) ruleRestrictions.Add("RuleRestrictionsCanUseOkForOneHour");
if (cles.RuleRestrictions.HasFlag(RuleRestrictions.CannotUseAnyOkValueForLearningRule) && cles.RuleRestrictions.HasFlag(RuleRestrictions.CanUseOkForOneDay)) ruleRestrictions.Add("RuleRestrictionsCanUseOkForOneDay");
Console.WriteLine("Client settings:"); Console.WriteLine("Business hours: {0} - {1},\nLongest inactivity during business hours: {2},\nLongest inactivity outsider business hours: {3},\n" + "Longest offline work triggered by inactivity: {4}\nAd-hoc offline work maximum length: {5}\n" + "Rule restrictions: {6}\nScreenshot quality: {7},\n" + "Microsoft Internet Explorer® waiting time threshold: {8} (ms),\nMax offline workitems: {9}\nMultiple device login: {10},\n" + "Default task: {11},\n" + "Use email subjects for generating unique mail identifier into the incoming and outgoing mails: {12}\n", TimeSpan.FromMinutes(cles.WorktimeStartInMins), TimeSpan.FromMinutes(cles.WorktimeEndInMins), TimeSpan.FromMinutes(cles.DuringWorkTimeIdleInMins), TimeSpan.FromMinutes(cles.AfterWorktimeIdleInMins), TimeSpan.FromMilliseconds(cles.DuringWorkTimeIdleManualIntervalInMilisec), TimeSpan.FromMilliseconds(cles.MaxManualMeetingIntervalInMilisec), ruleRestrictions.Count > 0 ? string.Join(", ", ruleRestrictions) : "Not set", cles.ScreenshotQuality, cles.BusyTimeThreshold, cles.MaxOfflineWorkItems, cles.CoincidentalClientsEnabled, cles.DefaultTaskId, cles.IsOutlookAddinMailTrackingUseSubject);
var mes = es.Meeting;
Console.WriteLine("Meeting settings:"); Console.WriteLine("Synchronization of Microsoft Office Outlook® created meetings: {0},\nSynchronization of IBM (Lotus) Notes created meetings: {1}\n" + "Default meeting task: {2},\nMandatory offline work subject: {3},\n" + "Offline work requested automatically (calendar): {4},\nSyncronize meeting updates: {5},\nOffline work time longer than or equal to 24 hours can be approved: {6},\n" + "Retain overlapping working time: {7},\nSynchronization of tentative meetings: {8}\n", mes.EnableMeetingTracking, mes.EnableLotusNotesMeetingTracking, mes.DefaultTaskId.HasValue ? mes.DefaultTaskId.Value.ToString() : "Not set", mes.IsMeetingSubjectMandatory, mes.IsOfflineWorkingTimeRequestAutomatic, mes.SynchronizeCalendarMeetingModifications, mes.AllowApprovalOfMeetingsLongerOrEqualThan24Hours, mes.KeepMeetingParallelWorktime, mes.AreTentativeMeetingsSynched);
var moes = es.Mobile;
Console.WriteLine("Mobile settings:"); Console.WriteLine("Record locations: {0},\nMaximum length of private call in active time: {1},\nInactivity triggered logout (outside working time): {2}\n" + "Longest conversation without administration (multiple device login): {3}\n", moes.LocationTrackMode, TimeSpan.FromMinutes(moes.PrivateCallDuration), TimeSpan.FromMinutes(moes.AfterWorkTimeIdleMinutes), TimeSpan.FromMinutes(moes.WorkCallDuration));
var ies = es.IncidentManager;
Console.WriteLine("Incident manager settings are not listed as this function is obsolete, only kept for backward compatibility.\n");
var oes = es.Other;
var taskMandatoryFields = new List<string>();
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.Priority)) taskMandatoryFields.Add("TaskMandatoryFieldPriority");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.StartEndDate)) taskMandatoryFields.Add("TaskMandatoryFieldStartEndDate");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.PlannedWorkTime)) taskMandatoryFields.Add("TaskMandatoryFieldPlannedWorkTime");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.Description)) taskMandatoryFields.Add("TaskMandatoryFieldDescription");
if (oes.TaskMandatoryFields.HasFlag(TaskMandatoryFields.Category)) taskMandatoryFields.Add("TaskMandatoryFieldCategory");
var taskAssignmentMandatoryFields = new List<string>();
if (oes.TaskAssignmentMandatoryFields.HasFlag(AssignmentMandatoryFields.StartEndDate)) taskAssignmentMandatoryFields.Add("TaskAssignmentMandatoryFieldStartEndDate");
if (oes.TaskAssignmentMandatoryFields.HasFlag(AssignmentMandatoryFields.PlannedWorkTime)) taskAssignmentMandatoryFields.Add("TaskAssignmentMandatoryFieldPlannedWorkTime");
Console.WriteLine("Other settings:"); Console.WriteLine("Cost center id: {0},\nTime zone id: {1},\nCalendar id: {2},\nDaily working time: {3},\n" + "Mandatory task/project attributes: {4},\nMandatory task assignment attributes: {5},\n" + "Deadline for modifying working time: {6} (hours),\nMinimum number of active users in group: {7},\nMinimum percent of active users in group: {8}\n", oes.CostCenterId, oes.TimeZoneId, oes.CalendarId, TimeSpan.FromMinutes(oes.DailyWorkTimeInMinutes), taskMandatoryFields.Count > 0 ? string.Join(", ", taskMandatoryFields) : "Not set", taskAssignmentMandatoryFields.Count > 0 ? string.Join(", ", taskAssignmentMandatoryFields) : "Not set", oes.ManualWorkItemEditAgeLimit, oes.MinNumOfActiveUsersInGroup, oes.MinPercentOfActiveUsersInGroup); } } }
Description:
Worker class is a derived from OrganizationHierarchyItem class, so it has the inherited members plus some special ones. Workers cannot contain other OrganizationHierarchyItem objects, this must always be on the leaf level of the hierarchy.
Members:
| Type |
Name |
Description |
| int |
UserId |
This value is the internal ID (in JC360 system) of the current item. This can be left null during import. |
| string |
FirstName |
Worker's first name. |
| string |
LastName |
Worker's last name. |
| string |
Email |
Worker's email address which must be unique throughout the system. User can use this for login and to receive emails. |
| WorkerAccessLevel |
AccessLevel |
Possible values: Worker, Supervisor, Administrator or leave empty if you do not want to change. |
| string |
CultureId |
Culture code for the worker, leave empty if you do not want to change. Possible values are: en-US (English), hu-HU (Hungarian), ko-KR (Korean), ja-JP (Japanese), pt-BR (Portuguese), es-MX (Spanish) |
| DateTime? |
FirstWorkTime |
First day of work. From this point in time (given in UTC) the reports start to calculate expected working time for user. If you leave this field null then the system will define it automatically later when the first work item uploaded for the user. |
| DateTime? |
LastWorkTime |
Last day of work. From this point in time (given in UTC) the reports will not calculate expected working time for user. If you leave this field null then the system will define it automatically later when the user gets deleted. |
Example code (C#):
var organizationHierarchy = new OrganizationHierarchy_v2();
var root = new RootWorkerGroup_v2();
var group1 = new WorkerGroup_v2 { ExtId = "1AA", Name = "Group1" }; var group2 = new WorkerGroup_v2 { ExtId = "2AA", Name = "Group2" }; var group3 = new WorkerGroup_v2 { ExtId = "3AA", Name = "Group3" }; var group4 = new WorkerGroup_v2 { ExtId = "104AA", Name = "Group4" }; var worker1 = new Worker_v2 { ExtId = "4AA", LastName = "Worker1", Email = "worker1@example.com", FirstName = "FirstName"}; var worker2 = new Worker_v2 { ExtId = "5AA", LastName = "Worker2", Email = "worker2@example.com", FirstName = "FirstName" }; var worker3 = new Worker_v2 { ExtId = "6AA", LastName = "Worker3", Email = "worker3@example.com", FirstName = "FirstName" }; var worker4 = new Worker_v2 { ExtId = "7AA", LastName = "Worker4", Email = "worker4@example.com", FirstName = "FirstName" }; var worker5 = new Worker_v2 { ExtId = "8AA", LastName = "Worker5", Email = "worker5@example.com", FirstName = "FirstName" }; var worker6 = new Worker_v2 { ExtId = "9AA", LastName = "Worker6", Email = "worker6@example.com", FirstName = "FirstName" };
group1.Children = new OrganizationHierarchyItem_v2[] { worker1, worker2 }; group2.Children = new OrganizationHierarchyItem_v2[] { worker3, worker4 }; group3.Children = new OrganizationHierarchyItem_v2[] { worker5, worker6 }; group4.Children = new OrganizationHierarchyItem_v2[] { };
root.Children = new OrganizationHierarchyItem_v2[] { group1, group2, group3, group4 };
organizationHierarchy.Root = root;
Description:
WorkerGroup class is a derived from OrganizationHierarchyItem class, so it has the inherited members plus some special ones. Worker groups can contain other worker groups and/or workers.
Members:
| Type |
Name |
Description |
| string |
Name |
Name of the worker group. |
Example code (C#):
var organizationHierarchy = new OrganizationHierarchy_v2();
var root = new RootWorkerGroup_v2();
var group1 = new WorkerGroup_v2 { ExtId = "1AA", Name = "Group1" }; var group2 = new WorkerGroup_v2 { ExtId = "2AA", Name = "Group2" }; var group3 = new WorkerGroup_v2 { ExtId = "3AA", Name = "Group3" }; var group4 = new WorkerGroup_v2 { ExtId = "104AA", Name = "Group4" }; var worker1 = new Worker_v2 { ExtId = "4AA", LastName = "Worker1", Email = "worker1@example.com", FirstName = "FirstName"}; var worker2 = new Worker_v2 { ExtId = "5AA", LastName = "Worker2", Email = "worker2@example.com", FirstName = "FirstName" }; var worker3 = new Worker_v2 { ExtId = "6AA", LastName = "Worker3", Email = "worker3@example.com", FirstName = "FirstName" }; var worker4 = new Worker_v2 { ExtId = "7AA", LastName = "Worker4", Email = "worker4@example.com", FirstName = "FirstName" }; var worker5 = new Worker_v2 { ExtId = "8AA", LastName = "Worker5", Email = "worker5@example.com", FirstName = "FirstName" }; var worker6 = new Worker_v2 { ExtId = "9AA", LastName = "Worker6", Email = "worker6@example.com", FirstName = "FirstName" };
group1.Children = new OrganizationHierarchyItem_v2[] { worker1, worker2 }; group2.Children = new OrganizationHierarchyItem_v2[] { worker3, worker4 }; group3.Children = new OrganizationHierarchyItem_v2[] { worker5, worker6 }; group4.Children = new OrganizationHierarchyItem_v2[] { };
root.Children = new OrganizationHierarchyItem_v2[] { group1, group2, group3, group4 };
organizationHierarchy.Root = root;
Description:
Official workflow report holder class
Members:
| Type |
Name |
Description |
| List<WorkFlowReportItem> |
WorkFlowView |
A list of item which are the instance of WorkFlowReportItem class |
Example code (C#):
using (var api = new API()) { var startDate = new DateTime(2018, 1, 1); var endDate = new DateTime(2018, 1, 5); WorkFlowReport workflowReport;
var ret = api.GetWorkflowReport(AuthCode, startDate, endDate, null, null, null, out workflowReport);
if (ret != GetWorkflowReportRet.OK) { Console.WriteLine("Error getting workflow report, error code: {0}", ret); } else { foreach (var item in workflowReport.WorkFlowView) { Console.WriteLine("User id: {0}, User last name: {1}, User first name: {2}, Item start date {3}, Item end date: {4}, Task name: {5}", item.UserId, item.LastName, item.FirstName, item.StartDate, item.EndDate, item.TaskName); } } }
Description:
One data row for the workflow report
Members:
| Type |
Name |
Description |
| string |
FirstName |
First name of the user appearing in this line of the report |
| string |
LastName |
Last name of the user appearing in this line of the report |
| int |
UserId |
Id of the user appearing in this line of the report |
| string |
TaskName |
Name of the task appearing in this line of the report |
| int |
TaskId |
Id of the task appearing in this line of the report |
| List<string> |
ParentWorkerGroupNames |
List of the name of the parent workergroups of the user |
| List<string> |
ParentTaskNames |
List of the parent project names of the task |
| DateTime |
StartDate |
Start time of the entry |
| DateTime |
EndDate |
Finish time of the entry |
| WorkFlowReportItemType |
WorkFlowReportItemType |
Type of the entry, valid values are: PC,Mobile,Ivr,Manual,Meeting,MobileCallWithWorkTime,MobileCallWithoutWorkTime,ReasonResponse,BusyTime |
| long? |
ActiveTimeInMillisecond |
Active part of the entry in milliseconds |
| long? |
InactiveTimeInMillisecond |
Inactive time of the entry in milliseconds |
| string |
WorktimeModificationDescription |
If this entry is a modified worktime and requires description, the value is shown here |
| string |
PhoneNumber |
If this entry is call, the other party's call number is shown here |
| string |
MobileContactName |
If this entry is call, the other party's name is shown here in case the caller is added to the Contacts in the mobile application |
| bool? |
IsInbound |
If this entry is call, it shows whether this was inbound or outbound call |
| string |
MeetingTitle |
If this entry is a synced calendar meeting, this shows the title of the meeting |
| string |
MeetingDescription |
If this entry is a synced calendar meeting, this shows the description part of the meeting |
| string |
MeetingParticipants |
If this entry is a synced calendar meeting, this shows the mail address of the meeting participants of the meeting |
| MeetingType |
MeetingType |
If this entry is meeting, this shows the type of the meeting, valid values are: Calendar, Manual |
| string |
ReasonResponseFullPath |
If this entry has a reason added from the reason tree, the value shows the added reason with the full path of the tree |
| string |
ReasonResponseFreeText |
If this entry has a reason added as a free text, the value shows the added text |
Example code (C#):
using (var api = new API()) { var startDate = new DateTime(2018, 1, 1); var endDate = new DateTime(2018, 1, 5); WorkFlowReport workflowReport;
var ret = api.GetWorkflowReport(AuthCode, startDate, endDate, null, null, null, out workflowReport);
if (ret != GetWorkflowReportRet.OK) { Console.WriteLine("Error getting workflow report, error code: {0}", ret); } else { foreach (var item in workflowReport.WorkFlowView) { Console.WriteLine("User id: {0}, User last name: {1}, User first name: {2}, Item start date {3}, Item end date: {4}, Task name: {5}", item.UserId, item.LastName, item.FirstName, item.StartDate, item.EndDate, item.TaskName); } } }
Description:
Class containing worktime modification data
Members:
| Type |
Name |
Description |
| int |
Id |
Internal id of the worktime modification |
| WorktimeModificationType |
Type |
Type of worktime modification (AddWork, DeleteInterval, ReplaceInterval, DeleteComputerInterval, DeleteMobileInterval) |
| int? |
WorkId |
Id of the task which is affected in the operation |
| DateTime |
StartDate |
New timestamp of the workitem for the start time |
| DateTime |
EndDate |
New timestamp of the workitem for the finish time |
| int |
UserId |
Id of the user who is affected in the operation |
| string |
Comment |
Comment for the worktime modification (it is compulsory on the website except for the delete operations) |
| DateTime |
CreateDate |
Timestamp for creation of the worktime modification |
Example code (C#):
WorktimeModification[] worktimeModifications; var userIds = new int[] { Worker1UserId };
using (API api = new API()) { var ret = api.GetApprovableWorktimeModificationRequests(AuthCode, userIds, out worktimeModifications); if (ret != GetApprovableWorktimeModificationRequestsRet.OK) { Log("Get approvable modification request error: " + ret); } else { var wm = worktimeModifications.First(); Log(string.Format("Id: {0}, Type: {1}, TaskId: {2}, StartDate: {3}, EndDate: {4}, UserId: {5}, Comment: {6}, CreateDate: {7}", wm.Id, wm.Type.ToString(), wm.WorkId ?? "", wm.StartDate, wm.EndDate, wm.UserId, wm.Comment, wm.CreateDate)); } }
Description:
The data holder class of the Worktime report. Worktime report is the report name Worktime report by day on the website.
Members:
| Type |
Name |
Description |
| List<ReportColumn> |
ReportColumns |
List of report columns, the information is store in the ReportColumn class |
| List<WorktimeReportData> |
WorktimeReportDataList |
List of report rows, the information is store in the WorktimeReportData class |
Example code (C#):
using (var api = new API()) { var startDate = new DateTime(2018, 1, 1); var endDate = new DateTime(2018, 1, 5); WorktimeReport worktimeReport;
var ret = api.GetWorktimeReport(AuthCode, startDate, endDate, null, null, out worktimeReport);
if (ret != GetWorktimeReportRet.OK) { Console.WriteLine("Error getting worktime report, error code: {0}", ret); } else { foreach (var item in worktimeReport.WorktimeReportDataList) { Console.WriteLine("User id: {0}, Active computer time in ms: {1}, Ad hoc meeting time in ms {2}, Idle time in ms: {3}", item.UserId, item.ActiveComputerWorkTimeMs, item.AdhocMeetingTimeMs, item.IdleComputerWorkTimeMs); } } }
Description:
Represents one column in the worktime report
Members:
| Type |
Name |
Description |
| int |
UserId |
Id of the user appearing in this entry of the report |
| ReportColumn |
ReportColumn |
Description for the report column |
| long |
TotalWorkTimeNetMs |
Total net worktime in milliseconds |
| List<WorktimeForTaskGroup> |
SumSpecialTaskWorkTimes |
If user defined task groups are included, their times are listed here, the data holder class has 3 fields: string TaskGroupName, int TaskGroupId, long WorktimeMs |
| long |
ComputerWorkTimeNetMs |
Total desktop worktime in milliseconds |
| long |
ActiveComputerWorkTimeMs |
Total desktop active worktime in milliseconds |
| long |
IdleComputerWorkTimeMs |
Total desktop idle time in milliseconds |
| long |
OfficeWorkTimeMs |
Total desktop time in the office in milliseconds |
| long |
OutOfOfficeWorkTimeMs |
Total desktop time outside the office in milliseconds |
| long |
MobileWorkTimeNetMs |
Total mobile counted time in milliseconds |
| long |
MobileCallWorkTimeNetMs |
Total mobile call times in milliseconds |
| long |
ManualWorkTimeNetMs |
Total manually added worktime in milliseconds |
| long |
HolidayTimeMs |
Total holiday time in milliseconds |
| long |
SickLeaveTimeMs |
Total sickleave time in milliseconds |
| long |
AdhocMeetingTimeMs |
Total adhoc meeting time in milliseconds |
| long |
CalendarMeetingTimeMs |
Total calendar meeting time in milliseconds |
| long? |
StartOfWorkMs |
Start time of work in milliseconds |
| long? |
EndOfWorkMs |
End time of work in milliseconds |
| WorktimeViolationDetails |
LateStartOfWorkSingleDay |
Worktime violation for late start, the data holder class has 2 members: bool Worked, long? ViolatedAtMs |
| WorktimeViolationDetails |
EarlyEndOfWorkSingleDay |
Worktime violation for early finish, the data holder class has 2 members: bool Worked, long? ViolatedAtMs |
| WorktimeViolationDetails |
ViolateCoreTimeSingleDay |
Worktime violation for request minimum worktime during coretime, the data holder class has 2 members: bool Worked, long? ViolatedAtMs |
| int? |
LateStartOfWorkSummary |
Number of late start incidents |
| int? |
EarlyEndOfWorkSummary |
Number of early finish incidents |
| int? |
ViolateCoreTimeSummary |
Number of core time violation incidents |
| long? |
WorkTimeFrameDifferenceMs |
Worktime balance (requested - worked) in milliseconds |
| int |
NumberOfIncidents |
Total number of incidents |
| long? |
TimeSpentAtWorkplaceMs |
Time spent at workplace in milliseconds (this means the time between the first and the last worktime on the workplace) |
| long? |
IneffectiveWorkTimeMs |
Total inactive time durint the period |
| int |
NumberOfActiveWorkdays |
Number of workdays when any activity was recored |
| int |
NumberOfOfficialWorkdays |
Number of official workdays based on the calendar |
Example code (C#):
using (var api = new API()) { var startDate = new DateTime(2018, 1, 1); var endDate = new DateTime(2018, 1, 5); WorktimeReport worktimeReport;
var ret = api.GetWorktimeReport(AuthCode, startDate, endDate, null, null, out worktimeReport);
if (ret != GetWorktimeReportRet.OK) { Console.WriteLine("Error getting worktime report, error code: {0}", ret); } else { foreach (var item in worktimeReport.WorktimeReportDataList) { Console.WriteLine("User id: {0}, Active computer time in ms: {1}, Ad hoc meeting time in ms {2}, Idle time in ms: {3}", item.UserId, item.ActiveComputerWorkTimeMs, item.AdhocMeetingTimeMs, item.IdleComputerWorkTimeMs); } } }
Description:
Contains data about a user day worktime schedules ("shift")
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the WorktimeSchedule |
| int |
UserId |
Id of the user |
| DateTime |
LocalDay |
Day of the "shift" |
| WorktimeScheduleItem[] |
Items |
Defines a smaller chunk of a WorktimeSchedule ("shift") |
| bool |
IsInOffice |
Indicates whether the user have to work in the office or not during their "shift" |
Example code (C#):
var schedule = new WorktimeSchedule { Id = 0, LocalDay = new DateTime(2018, 10, 19), UserId = 1234, IsInOffice = false };
var items = new List<WorktimeScheduleItem>() { new WorktimeScheduleItem { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, } };
schedule.Items = items.ToArray();
Description:
Contains data about a user day worktime schedules ("shift")
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the WorktimeSchedule_v2 |
| int |
UserId |
Id of the user |
| DateTime |
LocalDay |
Day of the "shift" |
| WorktimeScheduleItem_v2[] |
Items |
Defines a smaller chunk of a WorktimeSchedule_v2 ("shift") |
| bool |
IsInOffice |
Indicates whether the user has to work in the office or not during their "shift" |
| bool |
IsWorkDay |
Indicates whether the user has to work or has a rest day |
| bool |
IsApproved |
Indicates whether schedule is in approved or requested status |
Example code (C#):
var schedule = new WorktimeSchedule_v2 { Id = 0, LocalDay = new DateTime(2018, 10, 19), UserId = 1234, IsInOffice = false, IsWorkDay = true };
var items = new List<WorktimeScheduleItem_v2>() { new WorktimeScheduleItem_v2 { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, CategoryId = 5678 } };
schedule.Items = items.ToArray();
Description:
Defines a smaller chunk of a WorktimeSchedule ("shift")
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the WorktimeScheduleItem |
| int |
WorktimeScheduleId |
Id of the WorktimeSchedule that the WorktimeScheduleItem belongs to |
| DateTime |
UtcStartDate |
Start date of a "shift" |
| DateTime |
UtcEndDate |
End date of a "shift" |
| int |
TaskId |
Id of a Task |
| bool |
IsOvertime |
Defines whether the "shift" chunk is overtime or not |
Example code (C#):
var schedule = new WorktimeSchedule { Id = 0, LocalDay = new DateTime(2018, 10, 19), UserId = 1234, IsInOffice = false };
var items = new List<WorktimeScheduleItem>() { new WorktimeScheduleItem { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, } };
schedule.Items = items.ToArray();
Description:
Defines a smaller chunk of a WorktimeSchedule_v2 ("shift")
Members:
| Type |
Name |
Description |
| int |
Id |
Id of the WorktimeScheduleItem_v2 |
| int |
WorktimeScheduleId |
Id of the WorktimeSchedule_v2 that the WorktimeScheduleItem_v2 belongs to |
| DateTime |
UtcStartDate |
Start date of a "shift" |
| DateTime |
UtcEndDate |
End date of a "shift" |
| int? |
TaskId |
Id of a Task |
| bool |
IsOvertime |
Defines whether the "shift" chunk is overtime or not |
| int? |
CategoryId |
Defines the category of the "shift" |
Example code (C#):
var schedule = new WorktimeSchedule_v2 { Id = 0, LocalDay = new DateTime(2018, 10, 19), UserId = 1234, IsInOffice = false, IsWorkDay = true };
var items = new List<WorktimeScheduleItem_v2>() { new WorktimeScheduleItem_v2 { UtcStartDate = DateTime.UtcNow.LocalDay.AddHours(6), UtcEndDate = DateTime.UtcNow.LocalDay.AddHours(8), TaskId = 1234, IsOvertime = false, CategoryId = 5678 } };
schedule.Items = items.ToArray();
|
|