Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .net/README.md
Original file line number Diff line number Diff line change
@@ -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).
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -176,6 +177,46 @@ func main() {
}
```

## <a name="dotnet"></a>.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("<botan-io-token-goes-here>");

// 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.
```

## <a name="http"></a>HTTP API
### <a name="http_track"></a>Track message
The base url is: https://api.botan.io/track
Expand Down