From f983a8e7b0bfb9656c3bbbb34100e09989cda988 Mon Sep 17 00:00:00 2001 From: ADEBISI Foluso A Date: Thu, 12 May 2016 02:40:39 +0100 Subject: [PATCH 1/3] Fixes issue #65 .Net API implementation (with samples). --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index c16dfb4..12d8c95 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ We have libraries for the following languages: * [Python](#py) * [Ruby](#ruby) * [Rust](#rust) + * [.Net](#dotnet) Alternatively, you can use Botan API via [plain HTTP calls](#http). @@ -176,6 +177,45 @@ func main() { } ``` +## .Net example + +``` +Install-Package BotanIO.Net +``` + +```C# +var botan = new BotanIO.Api.Botan(""); + +// TRACKING + + // + // Basic scenario + // + botan.Track("Search", new { some_metric = 100, another_metric = 100 }, "1234567890"); + + // + // Advance scenario + // + + // Date cohorts + botan.Track("Cohorts", DateTime.UtcNow /* could have been 'webhookUpdateObject.date' */, "1234567890"); + + // Single depth, commands order + botan.Track("CommandOrders", new { last_command = current_command }, "1234567890"); + + // Double depth, commands order + botan.Track( + "CommandOrders", + new { before_last_command = new { last_command = current_command } }, + "1234567890" + ); + +// URL SHORTENING + + var shortenedUrl = botan.ShortenUrl("http://botframework.com"); + // Use your shotenedUrl e.g. inject in response to bot user, send as SMS, etc. +``` + ## HTTP API ### Track message The base url is: https://api.botan.io/track From 615dc40e0942e5e3cde02906ee5da6896eea1549 Mon Sep 17 00:00:00 2001 From: adebisi-fa-hp Date: Fri, 13 May 2016 12:04:51 +0100 Subject: [PATCH 2/3] Link to .NET SDK repository. --- .net/README.md | 3 +++ README.md | 1 + 2 files changed, 4 insertions(+) create mode 100644 .net/README.md diff --git a/.net/README.md b/.net/README.md new file mode 100644 index 0000000..48822ac --- /dev/null +++ b/.net/README.md @@ -0,0 +1,3 @@ +## .Net SDK Repository + +[.Net SDK source code is available here](https://github.com/adebisi-fa/botan-io-dotnet/tree/master/src/api). \ No newline at end of file diff --git a/README.md b/README.md index 12d8c95..9ecf638 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ func main() { ``` Install-Package BotanIO.Net ``` +[.Net SDK source code is available here](https://github.com/adebisi-fa/botan-io-dotnet/tree/master/src/api). ```C# var botan = new BotanIO.Api.Botan(""); From 4cbfe58f5a6e08c89174a57fbd32b50f8323e2b1 Mon Sep 17 00:00:00 2001 From: adebisi-fa-hp Date: Fri, 13 May 2016 12:13:56 +0100 Subject: [PATCH 3/3] Fix the .ShortenUrl() error in the .Net example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ecf638..da56570 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ var botan = new BotanIO.Api.Botan(""); // URL SHORTENING - var shortenedUrl = botan.ShortenUrl("http://botframework.com"); + var shortenedUrl = botan.ShortenUrl("http://botframework.com", "1234567890"); // Use your shotenedUrl e.g. inject in response to bot user, send as SMS, etc. ```