Job.GetJobsByAssistantBuddyIdAsync
Description
The API gets the list of all jobs with specified Assistant Buddy Id from the connected Control Room.
Signature [C#]
Task<List<ViewJobInfo>> GetJobsByAssistantBuddyIdAsync(int buddyId)
Properties
Input
Property | Description |
---|---|
buddyId | Specify the AssistantBuddy Id for which job information has to be retrieved. |
Output
Property | Description |
---|---|
Task<List<ViewJobInfo>> | Returns all Assistant Buddy jobs information from the Control Room. |
Remarks
Use GetJobsByAssistantBuddyIdAsync API to return information about all the jobs submitted by an AssistantBuddy.
Example
C#
public void GetJobsByAssistantBuddyId()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int buddyId = 1;
List<ViewJobInfo> buddiesInfo = Task.Run(() => context.Jobs.GetJobsByAssistantBuddyIdAsync(buddyId)).Result;
foreach (ViewJobInfo buddyInfo in buddiesInfo)
Console.WriteLine("Bot Name: " + buddyInfo.BotName);
}
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;
}