Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled rejection Error: Now 'sessionId' is required parameter. #5

Open
sheksushant opened this issue Aug 2, 2017 · 0 comments
Open

Comments

@sheksushant
Copy link

Full Error :
`Like following example:

var app = ...
request = app.textRequest("Hello", {sessionId: "UNIQUE_SESSION_ID"})
...

at TextRequest.QueryRequest (/Users/sushantshekhar/Work/bot_api.ai/node_modules/api.ai/apiai/module/query_request.js:40:15)
at new TextRequest (/Users/sushantshekhar/Work/bot_api.ai/node_modules/api.ai/apiai/module/text_request.js:17:24)
at Application.textRequest (/Users/sushantshekhar/Work/bot_api.ai/node_modules/api.ai/apiai/module/apiai.js:168:12)
at /Users/sushantshekhar/Work/bot_api.ai/node_modules/api.ai/lib/textRequest.js:21:59
at Promise._execute (/Users/sushantshekhar/Work/bot_api.ai/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/sushantshekhar/Work/bot_api.ai/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/sushantshekhar/Work/bot_api.ai/node_modules/bluebird/js/release/promise.js:79:10)
at Application.text (/Users/sushantshekhar/Work/bot_api.ai/node_modules/api.ai/lib/textRequest.js:17:48)
at Object.<anonymous> (/Users/sushantshekhar/Work/bot_api.ai/fun.js:9:5)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)`

Full Code:
`const apiai = require("api.ai");

const nlp = new apiai({
token: "token_was_here",
session: "some_key"
});

nlp.text("Hello World!")
.then(function (response) {
console.log(response.result);
// Do what you wish with response
})
.error(function (error) {
console.log(error);
// Handle error
});`

Error Comes when i try to use Promise Code.The Callback Code works Fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant