Skip to main content
Version: Current

Job.SubmitJobV2Async

Description​

This API submits the job for execution in the AI Command Center and returns Task<JobInfo>

Signature [C#]​

Task<JobInfo> SubmitJobV2Async(Dictionary<string, object> inputArgs, int processId, string logLevel = "Information", int? botId = null, bool isAssistanBuddyJob = false, string initiatorName = "", int? initiatorType = null);

Properties​

Input​

ParameterTypeRequired / defaultDescription
inputArgsDictionary<string, object>RequiredSpecify the job input arguments.
processIdintRequiredSpecify the ProcessId to execute the job.
botIdint?Optional; nullSpecify the bot Id to execute the job.
logLevelstringOptional; "Information"Specify the job log level.
isAssistanBuddyJobboolOptional; falseSpecify the value that indicates whether the AssistantBuddy job is submitted.
initiatorNamestringOptional; ""Specify the job's initiator name.
initiatorTypeint?Optional; nullSpecify the initiator type of the job.

Output​

PropertyDescription
Task<JobInfo>Returns the information of a current job.

Remarks​

Use SubmitJobV2Async API to submit a job for execution based on specified Assistant or Smart Buddy Id and other job details from the connected AI Command Center.

Example​

C#
public async Task SubmitJob()
{
IControlRoomContext context = LoginControlRoom();
try
{
int processId = 1;
int botId = 1;
string logLevel = "Information";
bool isAssistantBuddyJob = false;
string username = "tester";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
// Add entries whose names and types match the process input arguments.
JobInfo jobInfo = await context.Jobs.SubmitJobV2Async(inputArgs, processId, logLevel, botId, isAssistantBuddyJob, username);
Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output);
}
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.