title: Dialogflow Fulfillment Webhook - Request Payload is always blank
body: <p>I have tried automated Fulfillment Webhook and Coded in Node in the inline editor, but I can't seem to get the PAYLOAD populated.  I successfully connect to my API, but it is looking for the orderNumber in the PAYLOAD which is empty?  What is needed to get the Payload to contain my parameters?</p>
  
  <p>Intent Image<a href="https://i.stack.imgur.com/qPi77.png" rel="nofollow noreferrer">Intent Pic 1</a></p>
  
  <p>Intent Pic 2<a href="https://i.stack.imgur.com/lOWM6.png" rel="nofollow noreferrer">Intent Pic 2</a></p>
  
  <p>Below info from the Diagnostic Info</p>
  
  <pre><code>{
    "responseId": "7b8c877b-fc06-405a-8428-1959493f870d-a14fa99c",
    "queryResult": {
      "queryText": "10620054",
      "parameters": {
        "orderNumber": "10620054"
      },
      "allRequiredParamsPresent": true,
      "outputContexts": [
        {
          "name": "projects/rrd-order-bot-cxniiq/agent/sessions/199d2c42-4d42-15b6-6329-b116a51991e9/contexts/order",
          "lifespanCount": 5,
          "parameters": {
            "orderNumber": "10620054",
            "orderNumber.original": "10620054"
          }
        },
        {
          "name": "projects/rrd-order-bot-cxniiq/agent/sessions/199d2c42-4d42-15b6-6329-b116a51991e9/contexts/status",
          "lifespanCount": 5,
          "parameters": {
            "orderNumber": "10620054",
            "orderNumber.original": "10620054"
          }
        },
        {
          "name": "projects/rrd-order-bot-cxniiq/agent/sessions/199d2c42-4d42-15b6-6329-b116a51991e9/contexts/status",
          "lifespanCount": 5,
          "parameters": {
            "orderNumber": "10620054",
            "orderNumber.original": "10620054"
          }
        }
      ],
      "intent": {
        "name": "projects/rrd-order-bot-cxniiq/agent/intents/9a5f61e5-e2cc-44c9-8cb3-53a5d43ec0fc",
        "displayName": "Order information"
      },
      "intentDetectionConfidence": 0.01,
      "languageCode": "en"
    },
    "originalDetectIntentRequest": {
      "payload": {}
    },
    "session": "projects/rrd-order-bot-cxniiq/agent/sessions/199d2c42-4d42-15b6-6329-b116a51991e9"
  }
  </code></pre>
  
  <p>Below is the Inline editor code I have tried in addition to the automatic Webhook.</p>
  
  <pre><code>// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs
  // for Dialogflow fulfillment library docs, samples, and to report issues
  'use strict';
  
  const functions = require('firebase-functions');
  const {WebhookClient} = require('dialogflow-fulfillment');
  const {Card, Suggestion} = require('dialogflow-fulfillment');
  //var querystring = require('querystring');
  
  process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
  
  exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) =&gt; {
    const agent = new WebhookClient({ request, response });
    console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
    console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
  
    function welcome(agent) {
      agent.add(`Welcome to my agent!`);
    }
  
    function fallback(agent) {
      agent.add(`I didn't understand`);
      agent.add(`I'm sorry, can you try again?`);
    }
  
    function orderHandler(agent) {
      const order = agent.parameters.orderNumber;
      const https = require('https');
      const querystring = require('querystring');
  
      const parameters = {orderNumber: order};
  
      const post_data = querystring.stringify(parameters);
  
      const options = {
        hostname: 'xxxxxxxxxxxx', (removed for question)
        port: 443,
        path: '/RRD_OrderStatusWeb/v1/getRRDOrderStatus',
        method: 'POST' 
      };
  
  const request = https.request(options, (response)=&gt;{
      let chunks_of_data = [];
  
      response.on('data', (fragments) =&gt; {
          chunks_of_data.push(fragments);
      });
  
      response.on('end', () =&gt; {
          let response_body = Buffer.concat(chunks_of_data);
          console.log(response_body.toString());
      });
  
      response.on('error', (error) =&gt; {
          console.log(error);
      });
  });
  
  request.on('error', (error) =&gt; {
      console.log('Error Code: ' + error.code);
      console.log('Error Message: ' + error.message);
  });
  
  request.write(post_data);
  request.end();    
  
  
      //agent.add('intent called: ' + order);
  }
  
    // Run the proper function handler based on the matched Dialogflow intent name
    let intentMap = new Map();
    intentMap.set('Default Welcome Intent', welcome);
    intentMap.set('Default Fallback Intent', fallback);
    intentMap.set('Order information', orderHandler);
    agent.handleRequest(intentMap);
  });
  </code></pre>