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 c16dfb4..da56570 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,46 @@ func main() { } ``` +## .Net example + +``` +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(""); + +// 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", "1234567890"); + // 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