Chat Bot Integration (Dialogflow API v 2)

Dialogflow API v2 vs API v1

Dialogflow API v2 replaces API v1 and API v1 will soon be phased out by Dialogflow. API v2 has added some extra steps required to set up. Under API v1 you could add your "Agent" access token to get our system authorization.  Under API v2 you now need to generate a service account with Dialogflow and download a *.json file and send to Upwire for us to store securely under your account. 

Once you have completed steps 1 & 2 below, our support team can help you set up step 3. Contact for assistance.

Step 1 - Create Upwire Account

If you don't already have one, create an Upwire account here and validate your account via the account validation email you will receive.

Step 2 - create Dialogflow Service Account

Follow the steps here to set up a new Service Account and obtain a private key associated with that Service Account by downloading a JSON file. Note: You can only download this JSON file once, so make sure to save the file and keep it somewhere safe. If you lose this key or it becomes compromised, you can use the same process to create another. 

Email the JSON file to making sure you include your Upwire account username (email address) in the email. 

Step 3 - set up voice module in Upwire template

Create a new variable in "assets" tab called: "_upwireCallerId". This will be used as your session ID between the current call and your Dialogflow agent if you do not supply one.

Drag a Bot module on to your canvas. Complete the Bot module settings as follows:

  • Record settings: Adjust the max call record duration and silence duration to suit the conversation type. e.g. If responses from the caller are short then lower the record duration. Set the interpretation language (optional).

  • Request bindings: Add the following bindings:
    • bind static value [your Upwire username] to parameter "username"
    • bind static value [your Upwire passtoken - see note below] to parameter "password"
    • bind static value [JSON filename sent to Upwire in step 2] to parameter "keyname"
    • bind static value [language e.g. "en"] to parameter "lang"
    • bind static value [your PROJECT ID] to parameter "sourceProjectId"
    • bind static value "_upwireCallerId" to parameter "sessionId" (you can make this your own if you manage your own session IDs)

  • Branching configuration (Optional): You can use branching to exit bot conversation loops. If the transcribed speech to text words match a keyword set in your branching e.g. Help, then the call flow will exit the bot loop and follow your branching node, allowing you to transfer the caller to a live agent or drop them in to a more traditional IVR menu. 

Note: Your Upwire passtoken can be found by clicking on the hamburger menu in the top right of the master template or Sandpit screen -> selecting "Show Jobs Api" -> selecting "Append to existing Job" -> selecting "SHOW API"

Kieran is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.