1.0.4 • Published 8 years ago

apiai-nodejs-co v1.0.4

Weekly downloads
2
License
Apache 2.0
Repository
github
Last release
8 years ago

api-ai-node-js

Fork of Original Node.js SDK for Api.ai, for making api.ai requests

Plugin makes it easy to integrate your Node.js application with api.ai natural language processing service.

Installation

  • Make sure that Node.js installed.
  • Install Node.js library with npm:
npm install apiai-nodejs-co

Usage

  • Create main.js file. Insert into following code.
var apiai = require('apiai-nodejs-co');

var options = {
    hostname: "api.api.ai",
    port: 443,
    path: "/v1/query",
    version: "20150910"
}
var app = apiai("<your client acces token>", "<your client subscribtion key>" options);

var reqOptions = {
	lang: "en",
	timezone: "<eg Africa/Lagos>",
	sessionId: "<sessionId here>"
}
var request = app.textRequest('<Your text query>' reqOptions);

request.on('response', function(response) {
    console.log(response);
});

request.on('error', function(error) {
    console.log(error);
});

request.end()
  • Run following command.
node main.js
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago