Launching outbound call scenarios through API

2020-04-13 10:31:04
30493
0

To run a scenario through the API, you need to perform four simple steps: 

  1.  Get an API token
  2. Buy a phone number or verify your own 
  3. Enter a scenario into the Voximplant Kit editor 
  4. Run the scenario

Let’s break down these steps one by one. 

In order to use the API you will need to generate an API token in your personal account. 

Go to Integration, then enter the API Tokens area and click on Add API tokens. Enter the name of the API token in the dropdown window and press Save.

An API token will appear in this section. You can see it or copy it by pressing the respective icon to the left of the token. 



You can make API requests using these authorization parameters:  

  • domain – your account name
  • access_token – API token

After this, you need to buy or add a Voximplant Kit telephone number. This can be done in the Number section.

Then go to Create a Scenario. Enter Scenarios in the top navigation bar and look for the Outbound tab. Click on New Scenario, select a template or a pre-made scenario. 

After you have created a scenario, verified your telephone and received an API token you can run your scenario. 

 

Example of a PHP code

<?php

// Your Voximplant Kit account name
define('KIT_DOMAIN', "YOUR DOMAIN NAME HERE");

// API Token
define('KIT_ACCESS_TOKEN', "YOUR API TOKEN HERE");

// ID of your CallerID number ID
define('KIT_CALLERID_PHONE_ID', "CALLERID PHONE ID HERE");

// Voximplant Kit scenario id
define('KIT_SCENARIO_ID', "SCENARIO ID HERE");

// Voximplant Kit API url
define('KIT_API_URL', "https://kitapi-eu.voximplant.com/api/v3");

// Client data for using in scenario
$client_data = [
    'phone' => 'CLIENT PHONE NUMBER HERE',
    'client_name' => 'CLIENT NAME HERE'
];

// API Request parameters
$run_scenario_data = [
    'domain' => KIT_DOMAIN,
    'access_token' => KIT_ACCESS_TOKEN,
    'scenario_id' => KIT_SCENARIO_ID,
    'phone_number_id' => KIT_CALLERID_PHONE_ID,
    'phone' => $client_data['phone'],
    'variables' => json_encode([
        'client_name' => $client_data['client_name']
    ])
];

// HTTP Request to run the scenario
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, KIT_API_URL . "scenario/runScenario");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $run_scenario_data);
$returned = curl_exec($ch);
curl_close ($ch);
Sign Up for a free Voximplant developer account or talk to our experts

Add your comment

Name*
Email*
Message

Your comment has been added and will be published after moderation.

Recommended posts

Voximplant Kit vs Talkdesk: Comparing contact centers for the small and medium enterprise

Voximplant Kit vs Talkdesk: Comparing contact centers for the small and medium enterprise

Any contact center manager considering a new cloud communications solution needs to do their “due diligence” before choosing a provider, including those in small to medium enterprises. The stakes are high for SMEs because your needs are unique and there are significant differences in the available providers. Your decision not only affects your organization’s budget, but also its business processes, customer experiences, and agent work environment.

Don’t Build VoIP Servers. Come to the CPaaS Side

Don’t Build VoIP Servers. Come to the CPaaS Side

Voximplant serverless architecture provides a simpler alternative to deploying traditional VoIP servers in a datacenter. Voximplant APIs offer developers scale and on-demand communications services. Learn how easily you can create VoIP services in the form of Voximplant-based apps.

Personalized Service 101: What it is and How to Deliver it

Personalized Service 101: What it is and How to Deliver it

For many consumers, personalized customer service is key to good customer experiences (CX). According to a 2020 survey by Gladly, close to two-thirds of respondents said that “lack of personalization makes [them] feel like a ticket number.” Businesses wishing to meet and exceed customer expectations need to make personalized service a top priority. But personalization goes beyond making movie recommendations or using a customer’s name in an email subject line. When it comes to personalized service, it’s paramount that you deliver relevant, valuable, and speedy support to promote positive customer experiences. In this article, we’ll break down what personalized service means, why it’s so important to CX, and how you can deliver personalization service to your customers.