Skip to content
On this page

Task-Related Code Samples

GetTasks()

csharp
var req = new TaskDetailsRequestModel()
{
    IDs = new List<object> { id },
    Includes = new TaskIncludesModel()
    {
        IncludeFileAttachments = true,
        IncludeWorkflowActions = true
    }
};

var api = new TasksApi(myRestEndpointUrl);
var results = api.GetTasks(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
    //do work...
}
else
{
    //handle error
}

InsertTasks()

csharp
var req = new TaskInsertRequestModel()
{
    EnableLogging = false,
    Tasks = new List<object>
            {
                new TaskInsertModel()
                {
                    DocumentID = documentID,
                    ParticipantID = participantID,
                    Type = TaskTypes.Delivery
                }
            }
};

var api = new TasksApi(myRestEndpointUrl);
var results = api.InsertTasks(req, apiKey, apiSecret, apiUsername, apiPassword);;
if (results.IsSuccessful.Value)
{
    //do work...
}
else
{
    //handle error
}

GetTasksUpdateable()

csharp
var req = new TaskUpdateableRequestModel()
{
    IDs = new List<object> { 1234567890 }
};

var api = new TasksUpdateableApi(myRestEndpointUrl);
var results = api.GetTasksUpdateable(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
    //do work...
}
else
{
    //handle error
}

UpdateTasks()

csharp
var req = new TaskUpdateableRequestModel()
{
    IDs = new List<object> { 1234567890 }
};

var api = new TasksUpdateableApi(myRestEndpointUrl);
var results = api.GetTasksUpdateable(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
	results.UpdateableTasks[0].ParticipantID = 1234567890;
    var updateModel = new TaskUpdateRequestModel()
	{
	    Tasks = results.UpdateableTasks
	};
    
    var api = new TasksApi(myRestEndpointUrl);
	var updateResults = api.UpdateTasks(sa, updateModel);
	if (updateResults.IsSuccessful)
	{
		//do work...
	}
	else
	{
	    //handle error
	}
}
else
{
    //handle error
}

RemoteSign()

csharp
var req = new TaskRemoteSignRequestModel()
{
    Tasks = new List<object>
    {
        new TaskRemoteSignModel()
        {
            ID = 1234567890,
            Password = "1234"
        }
    }
};

var api = new TasksApi(myRestEndpointUrl);
var results = api.RemoteSign(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
    //do work...
}
else
{
    //handle error
}