Skip to main content
Version: Current

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​

PropertyDescription
botIdSpecify the SmartBuddy Id to retrieve log information.
skipSpecify the number of log details in a sequence to be skipped, by returning the remaining log details.
takeSpecify the number of contiguous log details from the start of a sequence.

Output​

PropertyDescription
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 void GetLogByBotId()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

int jobId = 1;

var logs = Task.Run(() => context.Logs.GetLogsByJobId(jobId)).Result;
foreach (LogData logData in logs)
System.Console.WriteLine(logData.Message);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}