Log |
get attachment info by log id
Namespace: Gamanet.C4.SDK
Assembly: Gamanet.C4.SimpleClient (in Gamanet.C4.SimpleClient.dll) Version: 2026.0.0.733
Syntax
C#
public ISimpleCollection<MetadataV1> GetAttachmentsInfo( Guid logId )
Parameters
- logId Guid
- The log identifier.
Return Value
ISimpleCollection<MetadataV1>Attachment info
Implements
ISimpleClientLogRepositoryV1.GetAttachmentsInfo(Guid)Example
The following example illustrates how to get attachment info by log id
C#
using System; using Gamanet.C4.SDK; using Gamanet.C4.SimpleInterfaces; public class Example { static void Main() { // Create instance of simple client var client = new SimpleClient(ConnectorConfiguration.HttpClient); ConnectionInfoV1 token; // Connect to local server var connectionResult = client.Connect(new Uri("https://localhost/"), "Support", "support", out token); if (connectionResult != ConnectionResult.Successful) { Console.WriteLine("Connection unsuccessful, result: {0}", connectionResult); return; } Console.WriteLine("Connection result: {0}", connectionResult); Console.WriteLine(); //create ticket definition var ticket = new SimpleTicketV1( Guid.NewGuid(), LogCategory.AlarmTicket); //we have to add initial log to ticket var log = client.Logs.GetAllByCreateTime( DateTime.Now.AddMinutes(-1), DateTime.Now).FirstOrDefault(); //in real situation, add your prefered log //create ticket with assigned log client.TicketManagement.Create(ticket, log.Id); //you have to add attachment to ticket client.TicketManagement.AddImage(ticket.Id, photoStream, "image/png"); //we added image to ticket's log, ticket category is image, log category is "TicketImageAdded" var attachmentLog = client.TicketManagement.Get(ticket.Id) .Logs.First(l=>l.CategoryId == LogCategory.TicketImageAdded); var getLogAttachmentInfo = client.Logs.GetAttachmentsInfo(attachmentLog.Id); foreach (var attachmentInfo in getLogAttachmentInfo) { Console.WriteLine(attachmentInfo); } // Disconnect from server client.Disconnect(); } }
See Also