Job.GetJobsByBotIdAsync
Description
The API gets the list of all jobs with specified Smart Buddy Id from the connected AI Command Center.
C#
Task<List<ViewJobInfo>> GetJobsByBotIdAsync(int botId)
Properties
Input
| Property | Description |
|---|---|
| botId | Specify the SmartBuddy Id for which list of jobs information has to be retrieved. |
Output
| Property | Description |
|---|---|
| Task<List<ViewJobInfo>> | Returns all Smart Buddy jobs information from the AI Command Center. |
Remarks
Use GetJobsByBotIdAsync API to get information about all the jobs submitted by a SmartBuddy.
Example
C#
public async Task GetJobsBySmartBuddyId()
{
IControlRoomContext context = LoginControlRoom();
try
{
int buddyId = 1;
List<ViewJobInfo> buddiesInfo = await context.Jobs.GetJobsByBotIdAsync(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.