Skip to main content
Version: Current

TaskServices.TakeAssignmentAsync

Description​

The API takes the specified task assignment from the AI Command Center.

Signature [C#]​

Task TakeAssignmentAsync(int taskId);

Properties​

Input​

ParameterTypeRequired / defaultDescription
taskIdintRequiredThe ID of the task to claim.

Remarks​

Use TakeAssignmentAsync API to take the task assignment from the connected AI Command Center.

Example​

C#
public async Task TakeAssignmentTask()
{
IControlRoomContext context = LoginControlRoom();
try
{
int taskId = 1;
await context.Tasks.TakeAssignmentAsync(taskId);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.