Managing Tasks
When you create a new Transaction, you are required to include at least one Document, one Participant, and one Task per Document/Participant. However, after the Transaction is created, you can add new Tasks or update existing Tasks via the API at any point as long as the transaction is still in the Pending
status.
Insert a Task
In order to insert a new Task into an existing Transaction, you'll need provide the Document ID and Participant ID along with the new Task's details.
var req = new TaskInsertRequestModel() {
EnableLogging = false,
Tasks = new List<object> {
new TaskInsertModel() {
DocumentID = 1234567890,
ParticipantID = 1000456789,
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
}
Update a Task
In order to update an existing Participant, you'll need to retrieve an existing "Updateable" Participant first. Once you have the ParticipantUpdateModel
you can add/update/delete any properties you wish from that object and then all the UpdateParticipants()
method to commit the update.
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
}
Application Types
Signing Remotely
Signing documents remotely is typically when you want to apply a signature on a document without using the AlphaTrust® e-Sign workflow or signing interface. This call requires, at minimum, the TaskID for the task you wish to complete which doesn't necessarily need to be a signing task. It could be any of the available task types which are, Signature, Initial, Acknowledgement, Delivery, and NoActionRequired. If the task requires authentication (of which, only Password, PasswordHashed, and RegisteredUser are supported), you will need to pass that data in along with the task's ID property. For Password authentication, just pass in the clear-text password in the Password property. For the RegisteredUser authentication, you need to pass in both the Username and the Password properties.