Giter Site home page Giter Site logo

sdk's Introduction

#Botan SDK

Botan is a telegram bot analytics system based on Yandex.Appmetrica. In this document you can find how to setup Yandex.Appmetrica account, as well as examples of Botan SDK usage.

Creating an account

  • Register at http://appmetrica.yandex.com/
  • After registration you will be prompted to create Application. Please use @YourBotName as a name.
  • Save an API key from settings page, you will use it as a token for Botan API calls.
  • Download lib for your language, and use it as described below. Don`t forget to insert your token!

SDK usage

We have libraries for the following languages:

  • JavaScript
  • Python
  • Ruby

More languages (PHP, Java, C#, etc.) are coming soon!

Alternatively, you can use Botan API via HTTP calls (please see below).

Javacript example

Install npm: npm install botanio

var botan = require('botanio')(token);

botan.track(message, 'Start');

Python example

You need to install requests library to use python botan lib. You can do it like this: pip install requests

Code:

import botan
token = 1
uid = 2    
messageDict = {}
print botan.track(token, uid, messageDict, 'Search')

It's necessary to pass uid (user id you get from Telegram) into python lib calls.

Ruby example

uid is a user id you get from Telegram.

require_relative 'botan'
token = 1111
uid = 1
message = { text: 'text' }
puts Botan.track(token, uid, message, 'Search')

HTTP API

The base url is: https://api.botan.io/track

You can put data to Botan using POST method.

The url should look like https://api.botan.io/track?token=API_KEY&uid=UID

Please provide a json document as the post body.

API response is a json document:

  • on success: {"status": "accepted"}
  • on failure: {"status": "failed"} or {"status": "bad request"}

##Contribution We welcome any contributions as pull-requests!

Feel free to write more libraries for the languages we are not supporting yet.

sdk's People

Contributors

hr0nix avatar igusev avatar ollmer avatar yurich avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.