{"action":"created","issue":{"url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/9","repository_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow","labels_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/9/comments","events_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/9/events","html_url":"https://github.com/googleapis/nodejs-dialogflow/issues/9","id":278315029,"node_id":"MDU6SXNzdWUyNzgzMTUwMjk=","number":9,"title":"Send parameters to webhook on dialogflow sdk v2","user":{"login":"ilkerguller","id":19151985,"node_id":"MDQ6VXNlcjE5MTUxOTg1","avatar_url":"https://avatars3.githubusercontent.com/u/19151985?v=4","gravatar_id":"","url":"https://api.github.com/users/ilkerguller","html_url":"https://github.com/ilkerguller","followers_url":"https://api.github.com/users/ilkerguller/followers","following_url":"https://api.github.com/users/ilkerguller/following{/other_user}","gists_url":"https://api.github.com/users/ilkerguller/gists{/gist_id}","starred_url":"https://api.github.com/users/ilkerguller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilkerguller/subscriptions","organizations_url":"https://api.github.com/users/ilkerguller/orgs","repos_url":"https://api.github.com/users/ilkerguller/repos","events_url":"https://api.github.com/users/ilkerguller/events{/privacy}","received_events_url":"https://api.github.com/users/ilkerguller/received_events","type":"User","site_admin":false},"labels":[{"id":1062713478,"node_id":"MDU6TGFiZWwxMDYyNzEzNDc4","url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/labels/type:%20question","name":"type: question","color":"c5def5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-12-01T00:12:12Z","updated_at":"2018-12-14T22:30:28Z","closed_at":"2018-12-14T22:30:28Z","author_association":"NONE","body":"I'm trying to send some parameters to dialogflow (api.ai) such as username, email, etc but I couldn't figure it out. The problem is I cannot get/set any specific data (such as username, email, etc.) with Dialogflow v2 Nodejs SDK. I tried to use queryParams.payload (v1: originalRequest) but It didn't work somehow. Also, I tried to trigger custom event with data but I couldn't get any event data on the response. Does someone know how to send some specific data for session talk on dialogFlow?\r\n\r\nEXAMPLE OF PAYLOAD\r\n\r\n```js\r\n  const projectId = 'test-bot-test-1111';\r\n  const sessionId = user.uuid;\r\n  const languageCode = 'en-GB';\r\n\r\n  const sessionClient = new dialogFlow.SessionsClient();\r\n  const sessionPath = sessionClient.sessionPath(projectId, sessionId);\r\n\r\n  const request = {\r\n    session: sessionPath,\r\n    queryInput: {\r\n      text: {\r\n        text: query,\r\n        languageCode\r\n      }\r\n    },\r\n    queryParams: {\r\n      payload: {\r\n        data: {\r\n           username: 'bob',\r\n           email: 'bob@test.com'\r\n        }\r\n      }\r\n    }\r\n  };\r\n\r\n  let resultReq;\r\n\r\n  console.log('request :: ', request, '\\n\\n');\r\n\r\n  try {\r\n    resultReq = await sessionClient.detectIntent(request);\r\n  } catch (err) {\r\n    // eslint-disable-next-line no-console\r\n    return console.error('ERROR:', err);\r\n  }\r\n```\r\n\r\nEXAMPLE OF EVENT\r\n\r\n```js\r\n  const projectId = 'test-bot-test-1111';\r\n  const sessionId = user.uuid;\r\n  const languageCode = 'en-GB';\r\n\r\n  const sessionClient = new dialogFlow.SessionsClient();\r\n  const sessionPath = sessionClient.sessionPath(projectId, sessionId);\r\n\r\nconst request = {\r\n    session: sessionPath,\r\n    queryInput: {\r\n      event: {\r\n        name: 'custom_event',\r\n        languageCode,\r\n        parameters: {\r\n          name: 'sam',\r\n          user_name: 'sam',\r\n          a: 'saaaa'\r\n        }\r\n      }\r\n    },\r\n    queryParams: {\r\n      payload: {\r\n        data: user\r\n      }\r\n    }\r\n  };\r\n\r\n  let resultReq;\r\n\r\n  console.log('request :: ', request, '\\n\\n');\r\n\r\n  try {\r\n    resultReq = await sessionClient.detectIntent(request);\r\n  } catch (err) {\r\n    // eslint-disable-next-line no-console\r\n    return console.error('ERROR:', err);\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/comments/447498308","html_url":"https://github.com/googleapis/nodejs-dialogflow/issues/9#issuecomment-447498308","issue_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/9","id":447498308,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzQ5ODMwOA==","user":{"login":"nnegrey","id":7898071,"node_id":"MDQ6VXNlcjc4OTgwNzE=","avatar_url":"https://avatars2.githubusercontent.com/u/7898071?v=4","gravatar_id":"","url":"https://api.github.com/users/nnegrey","html_url":"https://github.com/nnegrey","followers_url":"https://api.github.com/users/nnegrey/followers","following_url":"https://api.github.com/users/nnegrey/following{/other_user}","gists_url":"https://api.github.com/users/nnegrey/gists{/gist_id}","starred_url":"https://api.github.com/users/nnegrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnegrey/subscriptions","organizations_url":"https://api.github.com/users/nnegrey/orgs","repos_url":"https://api.github.com/users/nnegrey/repos","events_url":"https://api.github.com/users/nnegrey/events{/privacy}","received_events_url":"https://api.github.com/users/nnegrey/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T22:30:28Z","updated_at":"2018-12-14T22:30:28Z","author_association":"CONTRIBUTOR","body":"This appears to have been solved, please feel free to reopen if that is not the case. Thanks\r\n:)"}}
{"actor":{"display_login":"nnegrey"}}