Skip to content

Instantly share code, notes, and snippets.

@aylarov
Last active February 28, 2018 19:46
Show Gist options
  • Save aylarov/6d8d0b093c58cf57408251ed947ede8f to your computer and use it in GitHub Desktop.
Save aylarov/6d8d0b093c58cf57408251ed947ede8f to your computer and use it in GitHub Desktop.
const sessionId = () => Math.floor(100000 * Math.random());
Net.httpRequest("https://api.dialogflow.com/v1/query?v=20170712&contexts=weather&query="
+ encodeURI(userSpeech)
+ "&lang=en&sessionId="
+ sessionId()
+ "&timezone=Europe/Moscow", (e) => {
// here we receive the JSON and continue our scenario execution
},
{ headers: ["Authorization: bearer 1799227ce77f446fa8d64749f70527ca"]});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment