/*!
 * apiai
 * Copyright(c) 2015 http://api.ai/
 * Apache 2.0 Licensed
 */

'use strict';

// var apiai = require("../module/apiai");
var apiai = require("apiai");

var app = apiai("ACCESS_TOKEN");

var entities = [
                    {
                        name: "dwarfs",
                        entries: [
                                    {
                                        value: "Ori",
                                        synonyms: [
                                                    "ori",
                                                    "Nori"
                                                    ]
                                    },
                                    {
                                        value: "bifur",
                                        synonyms: [
                                                    "Bofur",
                                                    "Bombur"
                                                    ]
                                    }
                                ]
                    }
                ];

var options = {
    entities: entities,
    sessionId: '<UNIQE SESSION ID>'
};

var request = app.textRequest('Hello ori', options);

request.on('response', function(response) {

    console.log(JSON.stringify(response, null, 4));
});

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

request.end();

@@ -180,20 +180,180 @@
 ai(%22
-ACCESS_TOKEN
+wnSEoGyt8FGC6wpwEs5Mnb3xqeuKLWbtr1tNtEEiyTjf0cm/rIrjAff3JzZkMDY8Di87XAMMZlbGKHym/DvJxBMbTgfMx6Kvg9itSXDrmMhz4J1VUu5nA5y3xB4n1IcRHf4F3OLqe21tMeRuLs167QdB04t89/1O/w1cDnyilFU=
 %22);%0A
@@ -1318,26 +1318,20 @@
 d: '
-%3CUNIQE SESSION ID%3E
+ %091503638187
 '%0A%7D;

Update text_request_with_entities.js