Logs.GetLogsByBotId
Description
The API gets the list of log details of all jobs from the specified SmartBuddy Id from the connected AI Command Center.
Signature [C#]
Task<List<LogData>> GetLogsByBotId(int botId, int skip, int take);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
botId | int | Required | Specify the SmartBuddy Id to retrieve log information. |
skip | int | Required | Specify the number of log details in a sequence to be skipped, by returning the remaining log details. |
take | int | Required | Specify the number of contiguous log details from the start of a sequence. |
Output
| Property | Description |
|---|---|
| Task<List<LogData>> | Returns log details of jobs from the specified SmartBuddy. |
Remarks
Use GetLogsByBotId API to get the list of logs of all jobs from the specified SmartBuddy id and the pagination parameters (take and skip) from the connected AI Command Center.
Example
C#
public async Task GetLogByBotId()
{
IControlRoomContext context = LoginControlRoom();
try
{
int botId = 1;
int skip = 0;
int take = 100;
var logs = await context.Logs.GetLogsByBotId(botId, skip, take);
foreach (LogData logData in logs)
System.Console.WriteLine(logData.Message);
}
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.