Add context to inbound calls
When a call comes in, some applications may want to inject context (eg the caller’s first name, if the number is recognized). In order to support injecting context, the Vocode API allows prompts to be templated. When an inbound call comes in, the template variables can then be filled in at runtime.
At a high level, context injection works like this:
context_endpoint
parameter to your botIn order to have your bot use injected variables, the prompt must include template variables. Let’s set up our prompt to accept a user’s first name and link it to our context endpoint.
Now, let’s set up a simple context endpoint that will return the user’s first name:
Now, when either Kian or Ajay call the bot – the prompt will reflect the name of the person the bot is talking to!
Note: This feature is experimental… improvements and proper authentication coming.