Task samples

Basics

Task fields description:

Field Type Description Mandatory

Id

long

Internal task ID.

 

It is automatically set by the application.

 

Not applicable.

Owner

String

It contains the OpenKM user ID.

It is automatically set by the application.

Not applicable.

Subject

String

The topic of the task.

Yes.

Description

String

The description of the task.

No.

Start

DateTime

When the task might start.

Yes.

End

DateTime

When the task might end.

No.

Status

TaskStatus

The task status.

You administer the list of status values.

Yes.

Project

TaskProject

The project related to the task.

You administer the list of project values.

Yes.

Type

TaskType

The task type.

You administer the list of task type values.

Yes.

Progress

int

The numeric progress status.

The range of allowed values is from 0 to 100, where 100% indicates a completed task.

Yes.

RepeatGroup

long

When a task is repeated over time it is a member of a group. The group is identified by a unique repeat group ID.

No.

ReminderStartValue

int

How many days before the task starts the system might send an email notification to the user.

No.

ReminderEndValue

int

How many days before the task ends the system might send an email notification to the user.

No.

ReminderStartUnit

String

Reminder start units.

Allowed values:

  • "m" for minutes.
  • "h" for hours.
  • "d" for days.

Mandatory when ReminderStartValue is greater than 0.

ReminderEndUnit

String

Reminder end units.

Allowed values:

  • "m" for minutes.
  • "h" for hours.
  • "d" for days.

Mandatory when ReminderEndValue is greater than 0.

Users

List<String>

Collection of users assigned to the task.

No. But at least one user or role should be assigned.

Roles

List<String>

Collection of assigned roles to the task.

No. But at least one user or role should be assigned.

Documents

List<String>

List of UUIDs of the related documents.

No.

Folders

List<String>

List of UUIDs of the related folders.

No.

Mails

List<String>

List of UUIDs of the related mails.

No.

Records

List<String>

List of UUIDs of the related records.

No.

On all methods, you'll see a parameter named "token". When accessing the application via SOAP, the login process returns a token, which is used to identify the user on all exposed methods. From the default application execution context you must use the "null" value, which indicates the application must use the "user session".

In special cases, you might be "promoted as Administrator" using the "administrator token".

String systemToken = DbSessionManager.getInstance().getSystemToken();

Suggested code sample

First, you must create the webservice object:

OKMWebservices ws = OKMWebservicesFactory.newInstance(host);

Then you should log in using the method "login". You can access the "login" method from the webservice object "ws" as shown below:

ws.login(user, password);

Once you are logged in with the webservices, the session is kept in the webservice object. Then you can use the other API methods.

At this point you can use all the Task methods from the "task" class as shown below:

ws.task.getAssigned(projectId, typeId, statusId, orderColumn, true, 0, 10, subject);

Methods

getAssigned

Description:

Method Return values Description

getAssigned(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, DateTime? from, DateTime? to,String subject)

TaskList

Retrieve a list of tasks assigned to a user, filtered and paginated.

Filter parameters description:

  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.
  • The statusId parameter must be a valid status id.
  • The orderColumn parameter must be a valid parameter of the TaskManagerTask class. Commonly used parameters are "subject", "start", "end", "progress", "owner". More information at javadoc documentation.
  • The orderAsc parameter orders ascending or descending.
  • The from date to filter (this parameter is optional).
  • The to date to filter (this parameter is optional).
  • The subject parameter is the topic of the task.

The parameters "limit" and "offset" allow you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" specifies how many results to skip before returning results.

For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

The parameters "from" and "to" are optional and allow you to retrieve just a portion of the results of a query.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id   
String orderColumn = "subject"; // A valid TaskManagerTask class parameter name used in HQL query
DateTime? from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime? to = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 30);
String subject = "test";

TaskList assignedTasks = ws.task.getAssigned(projectId, typeId, statusId, orderColumn, true, 0, 10, from, to, subject);
foreach (Task task in assignedTasks.tasks)
{
System.Console.WriteLine(task.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getActive

Description:

Method Return values Description

getActive(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, DateTime? from, DateTime? to, String subject)

TaskList

Retrieve a list of active tasks assigned to a user, filtered and paginated.

Filter parameters description:

  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.
  • The statusId parameter must be a valid status id.
  • The orderColumn parameter must be a valid parameter of the TaskManagerTask class. Commonly used parameters are "subject", "start", "end", "progress", "owner". More information at javadoc documentation.
  • The orderAsc parameter orders ascending or descending.
  • The from date to filter (this parameter is optional).
  • The to date to filter (this parameter is optional).
  • The subject parameter is the topic of the task.

The parameters "limit" and "offset" allow you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" specifies how many results to skip before returning results.

For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

The parameters "from" and "to" are optional and allow you to retrieve just a portion of the results of a query.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id   
String orderColumn = "subject"; // A valid TaskManagerTask class parameter name used in HQL query
DateTime? from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime? to = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 30);
String subject = "test";

TaskList activeTasks = ws.task.getActive(projectId, typeId, statusId, "description", false, 0, 10, from, to, subject);
foreach (Task task in activeTasks.tasks)
{
System.Console.WriteLine(task.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getFinished

Description:

Method Return values Description

getFinished(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, DateTime? from, DateTime? to, String subject)

TaskList

Retrieve a list of finished tasks assigned to a user, filtered and paginated.

Filter parameters description:

  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.
  • The statusId parameter must be a valid status id.
  • The orderColumn parameter must be a valid parameter of the TaskManagerTask class. Commonly used parameters are "subject", "start", "end", "progress", "owner". More information at javadoc documentation.
  • The orderAsc parameter orders ascending or descending.
  • The from date to filter (this parameter is optional).
  • The to date to filter (this parameter is optional).
  • The subject parameter is the topic of the task.

The parameters "limit" and "offset" allow you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" specifies how many results to skip before returning results.

For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

The parameters "from" and "to" are optional and allow you to retrieve just a portion of the results of a query.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id   
String orderColumn = "start"; // A valid TaskManagerTask class parameter name used in HQL query
DateTime? from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime? to = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 30);
String subject = "test";

TaskList finishedTasks = ws.task.getFinished(projectId, typeId, statusId, "description", false, 0, 10, from, to, subject);
foreach (Task task in finishedTasks.tasks)
{
System.Console.WriteLine(task.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getNotified

Description:

Method Return values Description

getNotified(long projectId, long typeId, long statusId, String orderColumn, bool orderAsc, int offset, int limit, DateTime? from, DateTime? to, String subject)

List<Task>

Retrieve a list of notified tasks assigned to a user, filtered and paginated.

Filter parameters description:

  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.
  • The statusId parameter must be a valid status id.
  • The orderColumn parameter must be a valid parameters of the TaskManagerTask class. Common used parameters are "subject", "start", "end", "progress", "owner".  More information at javadoc documentation.
  • The orderAsc parameter orders ascending or descending.
  • The from date to filter (this parameter is optional).
  • The to date to filter (this parameter is optional).
  • The subject parameter is the topic of the task.

The parameters "limit" and "offset" allow you to retrieve just a portion of the results of a query.

  • The parameter "limit" is used to limit the number of results returned.
  • The parameter "offset" specifies how many results to skip before returning results.

For example, if your query has 1000 results, but you only want to return the first 10, you should use these values:

  • limit=10
  • offset=0

Now suppose you want to show the results from 11-20, you should use these values:

  • limit=10
  • offset=10

The parameters "from" and "to" are optional and allow you to retrieve just a portion of the results of a query.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id
String orderColumn = "start"; // A valid TaskManagerTask class parameter name used in HQL query
DateTime? from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime? to = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 30);
String subject = "test";

TaskList taskList = ws.task.getNotified(projectId, typeId, statusId, orderColumn, true, 0, 10, from, to, subject);
foreach (Task task in taskList.tasks)
{
Console.WriteLine(task.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getStatus

Description:

Method Return values Description

getStatus()

List<TaskStatus>

Retrieve a list of all task statuses.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
List<TaskStatus> list = ws.task.getStatus();
foreach (TaskStatus taskStatus in list)
{
System.Console.WriteLine(taskStatus.name);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getProjects

Description:

Method Return values Description

getProjects(bool filterActive)

List<TaskProject>

Retrieve a list of all the task projects.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
List<TaskProject> taskProjects = ws.task.geProjects(true);
foreach (TaskProject tpj in taskProjects)
{
System.Console.WriteLine(tpj.name);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getTypes

Description:

Method Return values Description

getTypes(bool filterActive)

List<TaskType>

Retrieve a list of all the task types.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
List<TaskType> taskTypes = ws.task.getTypes(false);
foreach (TaskType tp in taskTypes)
{
System.Console.WriteLine(tp.name);
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getAssignedCount

Description:

Method Return values Description

getAssignedCount(long statusId, long projectId, long typeId)

long

Returns the number of tasks assigned to a user.

Filter parameters description:

  • The statusId parameter must be a valid status id.
  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long statusId = 1; // A valid status id 
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long assigned = ws.task.getAssignedCount(statusId, projectId, typeId);
System.Console.WriteLine("Assigned tasks count: "+ assigned.ToString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getActiveCount

Description:

Method Return values Description

getActiveCount(long statusId, long projectId, long typeId)

long

Returns the number of active tasks for a user.

Filter parameters description:

  • The statusId parameter must be a valid status id.
  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long statusId = 1; // A valid status id 
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long active = ws.task.getActiveCount(statusId, projectId, typeId);
System.Console.WriteLine("Active tasks count: " + active.ToString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getFinishedCount

Description:

Method Return values Description

getFinishedCount(long statusId, long projectId, long typeId)

long

Returns the number of finished tasks for a user.

Filter parameters description:

  • The statusId parameter must be a valid status id.
  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long statusId = 1; // A valid status id 
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long finished = ws.task.getFinishedCount(statusId, projectId, typeId);
System.Console.WriteLine("Finished tasks count: " + finished.ToString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getNotifiedCount

Description:

Method Return values Description

getNotifiedCount(long statusId, long projectId, long typeId)

Long

Returns the number of notified tasks assigned to a user.

Filter parameters description:

  • The statusId parameter must be a valid status id.
  • The projectId parameter must be a valid project id.
  • The typeId parameter must be a valid type id.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id
long statusId = 1; // A valid status id
long total = ws.task.getNotifiedCount(statusId, projectId, typeId);
Console.WriteLine("Total: " + total.ToString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

create

Description:

Method Return values Description

create(String subject, String start, String end, String description, long statusId, long projectId,
            long typeId, String user, List<String> notificationUsers, List<String> externalUsers, List<String> relatedDocuments,
            List<String> relatedFolders, List<String> relatedRecords, List<String> relatedMails, String repeatExpression,
            String repeatExpression, String formatDate, int repeatTimes, String reminderStartUnit, int reminderStartValue,
            String reminderEndUnit, int reminderEndValue)

Task

Create a new task.

The repeatExpression parameter description:

The commands are executed by cron when the minute, hour, and month fields match the current time, and when at least one of the two day fields (day of month, or day of week) matches the current time. The scheduler examines crontab entries once every minute. The time and date fields are:

 * * * * * command to execute
? ? ? ? ?
? ? ? ? ?
? ? ? ? ????? day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
? ? ? ?????????? month (1 - 12)
? ? ??????????????? day of month (1 - 31)
? ???????????????????? hour (0 - 23)
????????????????????????? min (0 - 59)

 

   

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.util; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8180/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host); try { ws.login(user, password);
String subject = "task subject";

DateTime date = DateTime.Now;
String start = ISO8601.formatBasic(date);
date = new DateTime(2019, 1, 1);
String end = ISO8601.formatBasic(date);

String description = "description test";
long statusId = 1; // A valid task status id
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id

List<String> notificationUsers = new List<string>();
notificationUsers.Add("pherrera");
notificationUsers.Add("sochoa");

List<String> externalUsers = new List<String>();
externalUsers.Add("test@openkm.com");

List<String> relatedDocuments = new List<String>();
relatedDocuments.Add("82555dd1-bcc2-4e64-81cb-5f7c2b0d7801");

List<String> relatedFolders = new List<String>();
relatedFolders.Add("70ec54af-76ad-4d02-b9c8-8c94c3b6ffc7");

List<String> relatedMails = new List<String>();
List<String> relatedRecords = new List<String>();

Task task = ws.task.create(subject, start, end, description, statusId, projectId, typeId, "okmAdmin", notificationUsers, externalUsers,
relatedDocuments, relatedFolders, relatedRecords, relatedMails, "0 0 1 * *", "", "", 10, "m", 5, "m", 10); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

update

Description:

Method Return values Description

update(long taskId, String subject, String start, String end, String description, long statusId,
            long projectId, long typeId, String user, List<String> notificationUsers, List<String> externalUsers,
            List<String> relatedDocuments, List<String> relatedFolders, List<String> relatedRecords, List<String> relatedMails,
            String owner, String repeatExpression, String repeatUntil, String formatDate, int repeatTimes, int progress,
            String reminderStartUnit, int reminderStartValue, String reminderEndUnit, int reminderEndValue)

Task

Update a task.

The repeatExpression parameters description:

The commands are executed by cron when the minute, hour, and month fields match the current time, and when at least one of the two day fields (day of the month, or day of the week) matches the current time. The scheduler examines crontab entries once every minute. The time and date fields are:

 * * * * * command to execute
? ? ? ? ?
? ? ? ? ?
? ? ? ? ????? day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
? ? ? ?????????? month (1 - 12)
? ? ??????????????? day of month (1 - 31)
? ???????????????????? hour (0 - 23)
????????????????????????? min (0 - 59)

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;
using com.openkm.sdk4csharp.util; namespace OKMRest { public class Program { static void Main(string[] args) { String host = "http://localhost:8180/openkm"; String username = "okmAdmin"; String password = "admin"; OKMWebservice ws = OKMWebservicesFactory.newInstance(host); try { ws.login(user, password);
String taskId = "2";
String subject = "task update";

DateTime date = DateTime.Now;
String start = ISO8601.formatBasic(date);

date = new DateTime(2019, 12, 1);
String end = ISO8601.formatBasic(date);

String description = "test update";
long statusId = 1; // A valid task status id
long projectId = 1; // A valid project id
long typeId = 1; // A valid type id


List<String> notificationUsers = new List<String>();
roles.Add("pherrera");
roles.Add("sochoa");

List<String> externalUsers = new List<String>();
externalUsers.Add("test@openkm.com");

List<String> relatedDocuments = new List<String>();
relatedDocuments.Add("82555dd1-bcc2-4e64-81cb-5f7c2b0d7801");

List<String> relatedFolders = new List<String>();
relatedFolders.Add("70ec54af-76ad-4d02-b9c8-8c94c3b6ffc7");

List<String> relatedMails = new List<String>();
List<String> relatedRecords = new List<String>();

String owner = "okmAdmin";
int progress = 20; // Progress task

String repeatExpression = "0 0 1 * *";
long taskId = 1;
Task task = ws.task.update(taskId, subject, start, end, description, statusId, projectId, typeId, "okmAdmin", notificationUsers, externalUsers,
relatedDocuments, relatedFolders, relatedRecords, relatedMails, owner, repeatExpression, "", "", progress, 10, "m", 5, "m", 10);
System.Console.WriteLine(task.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getTask

Description:

Method Return values Description

getTask(long taskId)

Task

Retrieve a task.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskId = "2";
  Task task = ws.task.getTask(task.id);
System.Console.WriteLine(task.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

delete

Description:

Method Return values Description

delete(long taskId)

void

Delete a task.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskId = "2";
  ws.task.delete(task.id); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

createProject

Description:

Method Return values Description

createProject(String name, bool active, String description)

TaskProject

Create a task project.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
TaskProject taskProject = ws.task.createProject("Task project 001", true, "Any description");
System.Console.WriteLine(taskProject.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

updateProject

Description:

Method Return values Description

updateProject(long projectId, bool active, String name, String description)

TaskProject

Update a task project.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskProjectId = 1; // Valid task project id
TaskProject taskProject = ws.task.updateProject(taskProjectId, true, "Task project 002", "Any description");
System.Console.WriteLine(taskProject1.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

deleteProject

Description:

Method Return values Description

deleteProject(long projectId)

void

Delete a task project.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskProjectId = 1; // Valid task project id
ws.task.deleteProject(taskProjectId); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getProject

Description:

Method Return values Description

getProject(long projectId)

TaskProject

Get a task project.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskProjectId = 1; // Valid task project id
TaskProject tp = ws.task.getProject(taskProjectId);
System.Console.WriteLine(tp.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

createType

Description:

Method Return values Description

createType(String name, bool active, String description)

TaskType

Create a task type.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
TaskType taskType = ws.task.createType("Test", false, "Any description");
System.Console.WriteLine(taskType.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

updateType

Description:

Method Return values Description

updateType(long typeId, bool active, String name, String description)

TaskType

Update a task type.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskTypeId = 1; // Valid task type id
TaskType taskType = ws.task.updateType(taskTypeId, true, "New Test", "New description");
System.Console.WriteLine(taskType.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

deleteType

Description:

Method Return values Description

deleteType(long typeId)

void

Delete a task type.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskTypeId = 1; //Valid task type id
ws.task.deleteType(taskTypeId); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getType

Description:

Method Return values Description

getType(long typeId)

TaskType

Get a task type object by id.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskTypeId = 1; //Valid task type id
TaskType taskType = ws.task.getType(taskTypeId);
System.Console.WriteLine(taskType.toString());
} catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

createStatus

Description:

Method Return values Description

createStatus(String name, bool finish)

TaskStatus

Create a task status.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
TaskStatus taskStatus = ws.task.createStatus("Test", false);
System.Console.WriteLine(taskStatus.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

updateStatus

Description:

Method Return values Description

updateStatus(long statusId, String name, bool finish)

TaskStatus

Update a task status.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskStatusId = 1; // Valid task status id
TaskStatus taskStatus = ws.task.updateStatus(taskStatusId , "Test", true);
System.Console.WriteLine(taskStatus.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

deleteStatus

Description:

Method Return values Description

deleteStatus(long statusId)

void

Delete a task status.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskStatusId = 1; // Valid task status id
ws.task.deleteStatus(taskStatusId); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getStatus

Description:

Method Return values Description

getStatus(long statusId)

TaskStatus

Get a task status by id.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskStatusId = 1; // Valid task status id
TaskStatus taskStatus= ws.task.getStatus(taskStatusId);
System.Console.WriteLine(taskStatus.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getNotes

Description:

Method Return values Description

getNotes(long taskId)

 List<TaskNote>

Returns a list of notes for a task.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskId = 1; // Valid task id
foreach (TaskNote tn in ws.task.getNotes(taskId))
{
System.Console.WriteLine(tn.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

createNote

Description:

Method Return values Description

createNote(long taskId, String text)

 TaskNote

Create a note for a certain task.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskId = 1; // Valid task id
TaskNote taskNote = ws.task.createNote(taskId, "Any note");
System.Console.WriteLine(taskNote.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

updateNote

Description:

Method Return values Description

updateNote(long noteId, String text)

 TaskNote

Update a task note.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskNoteId = 1; // Valid task note id
TaskNote taskNote = ws.task.updateNote(taskNoteId, "Any text");
System.Console.WriteLine(taskNote.toString()); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

deleteNote

Description:

Method Return values Description

deleteNote(long noteId)

 void

Delete a task note.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskNoteId = 1; // Valid task note id
ws.task.deleteNote(taskNoteId); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getHistory

Description:

Method Return values Description

getHistory(long taskId)

 List<TaskHistory>

Returns a list for a task.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
long taskId = 1; // Valid task id
foreach (TaskHistory th in ws.task.getHistory(taskId))
{
System.Console.WriteLine(th.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }

getRelatedTasks

Description:

Method Return values Description

getRelatedTasks(string uuid)

 TaskList

Returns a list of tasks.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.openkm.sdk4csharp;
using com.openkm.sdk4csharp.bean;

namespace OKMRest
{
    public class Program
    {
        static void Main(string[] args)
        {
            String host = "http://localhost:8180/openkm";
            String username = "okmAdmin";
            String password = "admin";
            OKMWebservice ws = OKMWebservicesFactory.newInstance(host);

            try
            {
                ws.login(user, password);
foreach (TaskList tl in ws.task.getRelatedTasks("l8fce7e5-f667-44bd-be2f-f3b3e584d574").tasks)
{
System.Console.WriteLine(tl.toString());
} } catch (Exception e) { System.Console.WriteLine(e.ToString()); } } } }