{"__v":30,"_id":"5601e11b96e0f70d0044b138","category":{"__v":1,"_id":"563d412a31f7580d00511e54","pages":["56bd2ce7fb9be80d003280e7"],"project":"55f0757d4624ec2d00814345","version":"55f0b2b5f3735d0d00691ffe","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-07T00:09:14.469Z","from_sync":false,"order":5,"slug":"windows-sdk","title":".NET SDK"},"parentDoc":null,"project":"55f0757d4624ec2d00814345","user":"55f0756a1e63fc37004b8d2b","version":{"__v":9,"_id":"55f0b2b5f3735d0d00691ffe","project":"55f0757d4624ec2d00814345","createdAt":"2015-09-09T22:29:09.118Z","releaseDate":"2015-09-09T22:29:09.118Z","categories":["55f0b2b5f3735d0d00691fff","55f0b2b5f3735d0d00692000","55f0b2b5f3735d0d00692001","55f0bd67d5d8fc0d00ca6f44","55f0cde9d5d8fc0d00ca6f55","563a8a62a8ba320d00106830","563a8ac9a8ba320d00106832","563d410f31f7580d00511e53","563d411de79f670d00a10a5f","563d412a31f7580d00511e54","566a206f74d574170070b640"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-22T23:15:39.546Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The Windows .NET SDK is a server side SDK to help integrate secure messaging within a .NET environment.  The SDK is a .NET wrapper of our [REST APIs](doc:rest-api) to make things easier to incorporate into your Windows applications.     \n\nThis quick start guide will help you get the SDK added to your project.  \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \".NET SDK Examples\",\n  \"body\": \"We put together a few <a href=\\\"https://github.com/tigerconnect/dotnet-sdk-release\\\" target=\\\"_blank\\\">.NET SDK examples</a> to help you get up to speed on how the .NET SDK works.  Our .NET SDK release repository contains a .NET solution file with 3 example projects, including a web application, a Windows console application, and a Windows Service.\\n\\nCheck it out here:\\n<a href=\\\"https://github.com/tigerconnect/dotnet-sdk-release\\\" target=\\\"_blank\\\">https://github.com/tigerconnect/dotnet-sdk-release</a>\"\n}\n[/block]\nThe .NET SDK is available to use with the following platforms/frameworks:\n\n* .NET Framework 4.0 or higher (backward compatible up to Windows XP & Windows Server 2003)\n* ASP.NET 4 or higher\n* Silverlight 5\n* Windows 8/8.1 (Store apps)\n* Windows Phone 8.1\n* Windows Phone Silverlight 8\n* Xamarin.Android\n* Xamarin.iOS\n* Xamarin.iOS (Classic)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Installation\"\n}\n[/block]\n## Download zipped versions\nTo get started, you can clone the repository or download the zipped version in order to access and use the projects. Once you open the solution in Visual Studio, you can build the solution in order to restore all NuGet references, and to run the example projects. Simply right-click on the project of interest and set it as your startup project to debug the code.\n\n## NuGet\nYou may also add the TigerConnect .NET SDK to your existing projects by making references to the required libraries:\n* Newtonsoft.Json - You may download this file as a NuGet package, or make a file reference to the appropriate version in the /packages/Newtonsoft folder in the solution root directory.\n* TigerText.Windows.SDK.dll - The TigerConnect SDK will be available as a NuGet package in the near future. In the meantime, simply make a reference to the .dll that is in the /packages folder in the solution root directory.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Initialization\"\n}\n[/block]\nInitialize the SDK in your main class or at the application start event. You don't need to authenticate the user separately. The following code snippet will activate the SDK and use the key/secret in all subsequent API calls: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"TT.Win.SDK.Global.Init(ConfigurationManager.AppSettings[\\\"KEY\\\"], ConfigurationManager.AppSettings[\\\"SECRET\\\"]);\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Events\"\n}\n[/block]\nAfter initializing, you can subscribe to the MessageReceivedEvent and then start listening to the events in order to get all the recent conversations. The following code snippets will subscribe and start getting all recent conversation.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"TT.Win.SDK.Api.Events.MessageReceivedEvent += Events_MessageReceivedEvent;\\nTT.Win.SDK.Api.Events.StartListening();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\nTo trigger the MessageReceivedEvent, be sure to implement the following method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"private async static void Events_MessageReceivedEvent(object sender, TT.Win.SDK.Events.MessageEventArgs e)\\n{\\n    if (e.MessageData.sender_user == null)\\n    {\\n        e.MessageData.sender_user = await TT.Win.SDK.Api.User.GetUserAsync(e.MessageData.sender);\\n    }\\n    string result = string.Format(\\\"Message received from {0} : {1}\\\", e.MessageData.sender_user.display_name, e.MessageData.body));\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sending a Message\"\n}\n[/block]\nIf you have completed sending a TigerText message to Echobot, you should be able to see the conversation and send another message via the Windows SDK demo app. There are several ways to send a message. The following snippet is one way to send a message from Windows SDK.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"TT.Win.SDK.Api.Message.SendMessage(\\\"Hello world!\\\", \\\"echobot:::at:::tigertext.com\\\");\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]","excerpt":"A quick guide to the TigerConnect Windows .NET SDK.","slug":"dotnet-quick-start","type":"basic","title":"Quick Start Guide"}

Quick Start Guide

A quick guide to the TigerConnect Windows .NET SDK.

The Windows .NET SDK is a server side SDK to help integrate secure messaging within a .NET environment. The SDK is a .NET wrapper of our [REST APIs](doc:rest-api) to make things easier to incorporate into your Windows applications. This quick start guide will help you get the SDK added to your project. [block:callout] { "type": "info", "title": ".NET SDK Examples", "body": "We put together a few <a href=\"https://github.com/tigerconnect/dotnet-sdk-release\" target=\"_blank\">.NET SDK examples</a> to help you get up to speed on how the .NET SDK works. Our .NET SDK release repository contains a .NET solution file with 3 example projects, including a web application, a Windows console application, and a Windows Service.\n\nCheck it out here:\n<a href=\"https://github.com/tigerconnect/dotnet-sdk-release\" target=\"_blank\">https://github.com/tigerconnect/dotnet-sdk-release</a>" } [/block] The .NET SDK is available to use with the following platforms/frameworks: * .NET Framework 4.0 or higher (backward compatible up to Windows XP & Windows Server 2003) * ASP.NET 4 or higher * Silverlight 5 * Windows 8/8.1 (Store apps) * Windows Phone 8.1 * Windows Phone Silverlight 8 * Xamarin.Android * Xamarin.iOS * Xamarin.iOS (Classic) [block:api-header] { "type": "basic", "title": "Installation" } [/block] ## Download zipped versions To get started, you can clone the repository or download the zipped version in order to access and use the projects. Once you open the solution in Visual Studio, you can build the solution in order to restore all NuGet references, and to run the example projects. Simply right-click on the project of interest and set it as your startup project to debug the code. ## NuGet You may also add the TigerConnect .NET SDK to your existing projects by making references to the required libraries: * Newtonsoft.Json - You may download this file as a NuGet package, or make a file reference to the appropriate version in the /packages/Newtonsoft folder in the solution root directory. * TigerText.Windows.SDK.dll - The TigerConnect SDK will be available as a NuGet package in the near future. In the meantime, simply make a reference to the .dll that is in the /packages folder in the solution root directory. [block:api-header] { "type": "basic", "title": "Initialization" } [/block] Initialize the SDK in your main class or at the application start event. You don't need to authenticate the user separately. The following code snippet will activate the SDK and use the key/secret in all subsequent API calls: [block:code] { "codes": [ { "code": "TT.Win.SDK.Global.Init(ConfigurationManager.AppSettings[\"KEY\"], ConfigurationManager.AppSettings[\"SECRET\"]);", "language": "csharp" } ] } [/block] [block:api-header] { "type": "basic", "title": "Events" } [/block] After initializing, you can subscribe to the MessageReceivedEvent and then start listening to the events in order to get all the recent conversations. The following code snippets will subscribe and start getting all recent conversation. [block:code] { "codes": [ { "code": "TT.Win.SDK.Api.Events.MessageReceivedEvent += Events_MessageReceivedEvent;\nTT.Win.SDK.Api.Events.StartListening();", "language": "csharp" } ] } [/block] To trigger the MessageReceivedEvent, be sure to implement the following method: [block:code] { "codes": [ { "code": "private async static void Events_MessageReceivedEvent(object sender, TT.Win.SDK.Events.MessageEventArgs e)\n{\n if (e.MessageData.sender_user == null)\n {\n e.MessageData.sender_user = await TT.Win.SDK.Api.User.GetUserAsync(e.MessageData.sender);\n }\n string result = string.Format(\"Message received from {0} : {1}\", e.MessageData.sender_user.display_name, e.MessageData.body));\n}", "language": "csharp" } ] } [/block] [block:api-header] { "type": "basic", "title": "Sending a Message" } [/block] If you have completed sending a TigerText message to Echobot, you should be able to see the conversation and send another message via the Windows SDK demo app. There are several ways to send a message. The following snippet is one way to send a message from Windows SDK. [block:code] { "codes": [ { "code": "TT.Win.SDK.Api.Message.SendMessage(\"Hello world!\", \"echobot@tigertext.com\");", "language": "csharp" } ] } [/block]