Skip to main content
Version: Current

Job.GetJobsByAssistantBuddyIdAsync

Description​

The API gets the list of all jobs with specified Assistant Buddy Id from the connected AI Command Center.

Signature [C#]​

Task<List<ViewJobInfo>> GetJobsByAssistantBuddyIdAsync(int buddyId);

Properties​

Input​

ParameterTypeRequired / defaultDescription
buddyIdintRequiredSpecify the AssistantBuddy Id for which job information has to be retrieved.

Output​

PropertyDescription
Task<List<ViewJobInfo>>Returns all Assistant Buddy jobs information from the AI Command Center.

Remarks​

Use GetJobsByAssistantBuddyIdAsync API to return information about all the jobs submitted by an AssistantBuddy.

Example​

C#
public async Task GetJobsByAssistantBuddyId()
{
IControlRoomContext context = LoginControlRoom();
try
{
int buddyId = 1;
List<ViewJobInfo> buddiesInfo = await context.Jobs.GetJobsByAssistantBuddyIdAsync(buddyId);
foreach (ViewJobInfo buddyInfo in buddiesInfo)
Console.WriteLine("Bot Name: " + buddyInfo.BotName);
}
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.