Vonage AI Studio
  • Welcome to AI Studio!
  • ✨Platform Updates
  • AI Studio
    • Create a new agent
    • NLU AI Engine - Traditional vs Hybrid
    • Agent Building Features
    • Agent Templates
      • Take Message
      • Updating Details
      • Survey
      • FAQ
      • Package Tracking
      • Caller Identification
      • Customer Service
      • Hotels
      • Appointment Management
    • Tester
    • Editor Mode & Publish
    • Reports
    • Users
    • Knowledge AI
  • Properties
    • Entities
      • System Entities List
      • Best Practices
    • Intents
      • How do we analyze user input?
      • Generate Training Data
      • System Intents
      • Intent Annotation
    • Parameters
    • Contacts
    • Tags
    • Recordings
  • Voice
    • Get started
      • Create your first conversational flow!
      • Triggering Outbound Call API
      • Sending an Outbound Call Request via Postman
      • Integration via SIP for Telephony Agents
    • Nodes
      • Start node
      • Conversation
        • Classification
          • Intent Ambiguity
        • Collect Input
          • Entity Ambiguation
        • Speak
        • Conditions
        • Listen
        • Q&A Node
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
        • NCCO Node
      • Actions
        • Send Email
        • Call Routing
        • End Call
        • Start Recording
        • Stop Recording
        • Send SMS
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Migrating from the GenAI node to Knowledge AI
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • WhatsApp
    • Get started
      • Create your first conversational flow!
      • Triggering an outbound WhatsApp virtual agent
    • Nodes
      • Start node
      • Conversation
        • Collect Input
          • Entity Ambiguation
        • Classification
          • Intent Ambiguity
        • Send Message
        • Conditions
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
      • Actions
        • Send Email
        • End Conversation
        • Send SMS
        • Live Agent Routing
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Endless FAQs on WhatsApp With Generative AI and AI Studio
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • SMS
    • Get started
      • Create your first conversational flow!
      • Triggering an outbound SMS Virtual Agent
    • Nodes
      • Start node
      • Conversation
        • Classification
          • Intent Ambiguity
        • Conditions
        • Send Message
        • Collect Input
          • Entity Ambiguation
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
      • Actions
        • Send Email
        • End Conversation
        • Send SMS
        • Live Agent Routing
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Use Case Example: Gym Business
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • HTTP
    • Get started
      • Create your first conversational flow!
    • Nodes
      • Start node
      • Conversation
        • Classification
          • Intent Ambiguity
        • Collect Input
          • Entity Ambiguation
        • Send Message
        • Conditions
      • Advanced
        • Reset Counter
        • Counter
        • Set Parameter
        • Custom Code
      • Action
        • Send Email
        • Send SMS
        • Live Agent Routing
          • Websockets connections for Live agent Routing
      • Integrations
        • Webhook
        • Legacy SalesForce Authentication Node
          • SalesForce Authentication
            • How to create a SalesForce Connected App
        • SalesForce Actions
        • Generative AI
          • Setting up Generative AI Node Integration
          • Use case Example : Online Shopping
      • Flow Control
        • Context Switch
        • Flows
    • Events
  • API Integration
    • Authentication
    • Insights
  • There's more
    • FAQs
    • Languages Available
Powered by GitBook
On this page
  • Create a new session
  • Use Init to define the state of the Conversation
  • Init Session
  • Step in Session
  • Step in Session
  • HTTP Agent Best Practices
  • Save the Initial User Input
  • Use the initial message to determine the flow
  • Monitoring & Reporting

Was this helpful?

  1. HTTP

Get started

PreviousEventsNextCreate your first conversational flow!

Last updated 1 year ago

Was this helpful?

In order to create an HTTP agent, after you clicked on "" select the HTTP option. This is a text-based agent you can integrate into any application and initialize via HTTP request.

These agents have no phone number but will be accessible via HTTP.

The nodes available will be slightly different than in the voice-based agent. Some capabilities are not supported in HTTP-based agents such as the "Listen" node.

Create a new session

Sessions are interactions between user and agent. One session has a time limit of 24 hours after which the session with the agent has to be reinitiated.

For the launch of the HTTP agent to work, make sure you have published your agent.

Follow these text-based agents to embed your virtual agent in any platform.

Use Init to define the state of the Conversation

Init Session

POST https://studio-api-eu.ai.vonage.com/http/init

Headers

Name
Type
Description

X-Vgai-Key*

string

Account API Key per user.

You can find the X-Vgai-Key on the top right of your canvas. Click on the "user" icon, and then "Generate API Key".

Request Body

Name
Type
Description

agent_id*

string

The ID of your published agent.

You will find this on the top left right below the name of your agent.

{
    "session_id": "88d66bd13-6d68-4cf0-adbb-dcbab67076fa",
    "session_start_time": "2022-05-03T07:56:26.958685",
    "session_expiration_time": "2022-05-03T15:56:26.958Z",
    "session_token": "eyJhbGciOiJllzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoiODhkNWJkMTMtNmQ2OC00Y2YwLWFkYmItZGNiYWI2NzA3NmZhIiwiaWF0IjoxNjUxNTY0NTg2LCJleHAiOjE2NTE1OTMzODZ9.Lva2vqBfdYKVjpo283c7Ogsa_Fjrq4UUdccoi7p9OJQ"
}

The endpoint of your query depends on the region you selected for your agent. If you selected US as the region for your agent, please use this endpoint:-

Step in Session

Once you have the Session ID you can start the actual conversation between agent and user.

Every step will execute all nodes until the session status turns to AWAITING_INPUT and will return a flow response containing all of the executed nodes with their status, errors, and messages.

Step in Session

POST https://studio-api-eu.ai.vonage.com/http/{SESSION_ID}/step

Headers

Name
Type
Description

Authorization*

string

Bearer {{session_token}} (which you received in the Init Request)

Request Body

Name
Type
Description

input*

string

user input

parameters

You can add parameters to your query, e.g.

[{"name":"userName", "value":"Tom"}]

{
    "session_id": "e4093097-bcea-4bc3-95a0-e1533c433553",
    "session_status": "ENDED",
    "messages": [
        {
            "text": "initial message: example_text"
        }
    ]
}

If you selected US as the region for your agent, please use this endpoint:-

You can receive multiple different "session_status" values in the response

AWAITING_INPUT - agent is waiting for user response

ENDED - conversation flow has ended and reached the last node in the conversation. This can be either because you added an "end call" node or this node is not connected to the following one.

HTTP Agent Best Practices

Save the Initial User Input

The initial user input will be automatically captured as the value of the INITIAL_MESSAGE system parameter and saved throughout the session of the conversation.

Use the initial message to determine the flow

This is mostly relevant for inbound customer care agents.

Use the INITIAL_MESSAGE parameter value to dictate the start of the conversation by creating custom conditions based on the customer’s input.

In the use case below, we have two intents - Office Location and Forgot Password. If the initial message of the user is not just "Hi there, I have a question" but "I need help resetting my password", the agent can use and attempt to classify that input immediately, without waiting for the agent to prompt the user.

Add the Classification node with your intents right after the START node. This way the agent will check if the user's initial message matches an intent and can direct the conversation accordingly.

If no match is found, then the user's input will go to the Classification node's Missed tab and the agent will prompt the user normally.

Monitoring & Reporting

to learn how to build your first virtual agent.

Same as for regular telephony agents, you are able to see the conversation of an HTTP agent in the .

Click here
https://studio-api-us.ai.vonage.com/http/init
https://studio-api-us.ai.vonage.com/http/{SESSION__ID}/step
reports
Create Agent