Open rajnish-kumar-76 opened 6 years ago
How about add an apiaiRequest.end();
in the end of your code?
This doesn't help. Same response. Output from node is :- options object being sent is: {"sessionId":"879uy73883"} Error received from apiai: {"code":"ECONNRESET"}
Same error here.
EDIT: For me request.end()
really work as well.
HI, I have tried same text request but I always got "ECONNRESET" response from apiai. sample nodejs code as below. In the code I have hashed client access token used retrieved from apiai console.
`'use strict'
const apiai = require('apiai'); const apiaiClient = apiai("08*628**781***6e");
var options = { sessionId: '879uy73883' };
console.log("options object being sent is: %s", JSON.stringify(options)); var apiaiRequest = apiaiClient.textRequest('Hello', options); apiaiRequest.on('response', function(response) { console.log("Response received from apiai: %s", JSON.stringify(response)); }); apiaiRequest.on('error', function(error) { console.log("Error received from apiai: %s", JSON.stringify(error)); });`
Regards, -Rajnish