static void Main(string[] args) { try { string apikey = ""; string appid = ""; var client = IntercomClient.GetClient(appid, apikey); var user = client.Users.Get(); var newuser = client.Users.Post(new { email = "*****@*****.**" }); var messages = client.MessageThreads.Get(email: "*****@*****.**"); } catch (Exception ex) { Console.WriteLine(ex); } }
private static void Main(string[] args) { try { string apikey = ""; string appid = ""; var client = IntercomClient.GetClient(appid, apikey); //var user = client.Users.Get(); // var newuser = client.Users.Post(new { email = "*****@*****.**" }); //client.Users.Delete("put id here"); //client.Users.DeleteWithUserId("put user_id here"); //client.Events.Post("test_event", DateTime.Now, "userid", new { }); //---- Conversations examples---- //create a new admin initiated message //client.Messages.Post("email", "Hello", "This is just a test message", "personal", "put admin id here", "put user_id here"); //User or Contact Initiated Conversation //client.Messages.Post("userid", "Message Body.."); //Fetch a list of all conversations //client.Conversations.GetAllUserConversations(); //Get a Single Conversation //client.Conversations.GetSingleConversation("Conversation ID"); //Replying from user to admin with a conversationID //client.Conversations.ReplyingConversation("UserID", "conversationID", "Message body"); //Replying from user admin to a last conversation without ID //client.Conversations.ReplytoLastConversation("UserID", "Message body"); //Replying from admin to user last conversation //client.Conversations.ReplytoLastConversationFromAdmintoUser("admin_id", "user_id", "Reply from admin to user"); //Mark conversation as read //client.Conversations.MarkConversations("conversationID"); //Close a conversation //client.Conversations.CloseConversations("conversationID", "adminID"); } catch (Exception ex) { Console.WriteLine(ex); } }
private static void Main(string[] args) { try { string apikey = ""; string appid = ""; var client = IntercomClient.GetClient(appid, apikey); //var user = client.Users.Get(); var newuser = client.Users.Post(new { email = "*****@*****.**" }); //client.Events.Post("test_event", DateTime.Now, "userid", new { }); } catch (Exception ex) { Console.WriteLine(ex); } }
private static void Main(string[] args) { try { string apikey = ""; string appid = ""; var client = IntercomClient.GetClient(appid, apikey); //var user = client.Users.Get(); var newuser = client.Users.Post(new { email = "*****@*****.**" }); //client.Events.Post("test_event", DateTime.Now, "userid", new { }); //client.Messages.Post("email", "Hello", "This is just a test message", "personal", "put admin id here", "put user_id here"); } catch (Exception ex) { Console.WriteLine(ex); } }
public SupportService(ISupportConfiguration configuration) { this.configuration = configuration; if (!string.IsNullOrWhiteSpace(configuration.IntercomAppId) && !string.IsNullOrWhiteSpace(configuration.IntercomApiKey)) { intercom = IntercomClient.GetClient( configuration.IntercomAppId, configuration.IntercomApiKey); } if (!string.IsNullOrWhiteSpace(TelemetryConfiguration.Active.InstrumentationKey)) { insights = new TelemetryClient(TelemetryConfiguration.Active); } else if (!string.IsNullOrWhiteSpace(configuration.InsightsInstrumentationKey)) { insightsConfiguration = TelemetryConfiguration.CreateDefault(); insightsConfiguration.InstrumentationKey = configuration.InsightsInstrumentationKey; insights = new TelemetryClient(insightsConfiguration); } }