https://github.com/shivkanthb/botlytics
🤖 Node module for Botlytics API.
https://github.com/shivkanthb/botlytics
analytics api bots node tracking
Last synced: about 1 month ago
JSON representation
🤖 Node module for Botlytics API.
- Host: GitHub
- URL: https://github.com/shivkanthb/botlytics
- Owner: shivkanthb
- Created: 2016-05-06T22:44:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T15:24:51.000Z (about 8 years ago)
- Last Synced: 2025-04-15T01:11:34.774Z (about 1 month ago)
- Topics: analytics, api, bots, node, tracking
- Language: JavaScript
- Homepage: http://www.botlytics.co/
- Size: 7.81 KB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Botlytics
=========Node module for Botlytics API.
Visit the official HTTP docs [here](http://botlytics.api-docs.io/)
## Installation
`npm install botlytics`
## Usage
```
var botlytics = require('botlytics');var bot_token =""; // Include your bot token here.
botlytics.setBotToken(bot_token);
```
This sets the bot token for our function calls.#### Parameters
- `text` (string, required) is the content of the message.
- `conversation_identifier` (string, optional) is a unique string that will organize messages into conversations with your bot and others. Examples of this might be a conversation ID or a group name.
- `sender_identifier` (string, optional) is a unique string that will track who sent which messages. Examples of this might be a user ID or a phone number.
- `platform` (string, optional) is the platform that the message was sent on. Examples include "slack", "messenger", "kik".
- `payload` (string, optional) is the payload for complex messages that include more than just text.
##### Incoming Message
```
botlytics.incoming({text: , conversation_identifier: , ... }, function(err, response, body){} );
```
##### Outgoing Message
```
botlytics.outgoing({text: , conversation_identifier: , ... }, function(err, response, body){} );
```
## Example
```
var botlytics = require('botlytics');botlytics.setBotToken('XXXXXXXXXXXX');
var dict = {
text: "Hello!",
conversation_identifier: "conv_99980",
sender_identifier: "sender_123",
platform: "kik"
};botlytics.incoming(dict, function(err,res, body){
if(err) throw Error(err);
console.log(body);
});
```
This outputs :
```
{
"text": "Hello!",
"kind": "incoming",
"created_at": "2016-05-07T04:42:58.129Z"
}
```
## Tests`npm test`
## Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.