Node JS Dialogflow error :INVALID_ARGUMENT: Input text not set.?


I encountered the following error while sending POST request to the Node JS code. There was a similar but unanswered 2 years old question in stackoverflow. So I decided to ask.

My code:

const dialogflow=require('dialogflow');
const config=require('../config/keys');

const sessionClient = new dialogflow.SessionsClient();
const sessionPath = sessionClient.sessionPath(config.googleProjectID,config.dialogFlowSessionID)

module.exports = app => {

    app.get('/', (req, res) => {
    })'/api/df_text_query', async (req, res) => {
        const request = {
            session: sessionPath,
            queryInput: {
                text: {
                    text: req.body.text,
                    languageCode: config.dialogFlowSessionLanguageCode,

        let responses = await sessionClient
    });'/api/df_event_query', (req, res) => {
        res.send({'do':'event query'})


Error i received:

(node:11868) UnhandledPromiseRejectionWarning: Error: 3 INVALID_ARGUMENT: Input text not set.

POST request :



Found the answer

I had missed the header. It was solved after adding the POST header.

Answered By – Chamika Prabath

Answer Checked By – Marilyn (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.