Skip to main content

Retrieving tasks

This section provides information on how to retrieve previously created tasks.

API reference:

Required scopes:

  • Taskurai.Task.Read

Prerequisites

Retrieving a task

To retrieve a previously created task, use its ID.

var myTask = await taskurai.GetTaskAsync(previouslyCreatedTaskId); // Get the created task

Console.WriteLine(JsonSerializer.Serialize(myTask));

Next, run the console application to validate:

dotnet run

The expected output should be:

{
"Id": "5e7f3b48-8914-478e-8b6c-35c8d5924c7a",
"Config": {
"Command": "testCommand",
"Arguments": [
{
"Name": "arg1",
"Value": "abc-123"
}
],
"Category": "Console app",
"Subject": "Samples",
"Description": "This is a test task",
"ExternalId": "my-id-123456",
"IsolationMode": true,
"LocalIdentifier": "6d63b7cf-a0f9-4448-ac8a-5a6edd8bdf7a",
"Id": "5e7f3b48-8914-478e-8b6c-35c8d5924c7a",
"Data": {"Name":"Test","Value":"Some value","Properties":["Some property","Another property"]}
},
"Created": "2023-06-15T17:51:25.7657589+00:00",
"Status": "Created",
"ProvisioningState": "Created",
"Archived": false,
"Postponed": false,
"Cancelled": false
}