Trigger a scenario
curl --request POST \
--url https://api.wavix.com/v1/voice-campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_campaign": {
"callflow_id": 3212,
"caller_id": "13123310912",
"contact": "16729923812",
"callback_url": "https://you-site.com/webhook"
}
}
'import requests
url = "https://api.wavix.com/v1/voice-campaigns"
payload = { "voice_campaign": {
"callflow_id": 3212,
"caller_id": "13123310912",
"contact": "16729923812",
"callback_url": "https://you-site.com/webhook"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voice_campaign: {
callflow_id: 3212,
caller_id: '13123310912',
contact: '16729923812',
callback_url: 'https://you-site.com/webhook'
}
})
};
fetch('https://api.wavix.com/v1/voice-campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wavix.com/v1/voice-campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'voice_campaign' => [
'callflow_id' => 3212,
'caller_id' => '13123310912',
'contact' => '16729923812',
'callback_url' => 'https://you-site.com/webhook'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wavix.com/v1/voice-campaigns"
payload := strings.NewReader("{\n \"voice_campaign\": {\n \"callflow_id\": 3212,\n \"caller_id\": \"13123310912\",\n \"contact\": \"16729923812\",\n \"callback_url\": \"https://you-site.com/webhook\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wavix.com/v1/voice-campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice_campaign\": {\n \"callflow_id\": 3212,\n \"caller_id\": \"13123310912\",\n \"contact\": \"16729923812\",\n \"callback_url\": \"https://you-site.com/webhook\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wavix.com/v1/voice-campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice_campaign\": {\n \"callflow_id\": 3212,\n \"caller_id\": \"13123310912\",\n \"contact\": \"16729923812\",\n \"callback_url\": \"https://you-site.com/webhook\"\n }\n}"
response = http.request(request)
puts response.read_body{
"voice_campaign": {
"id": 2321423,
"status": "status",
"timestamp": "2023-06-15T10:30:00Z",
"caller_id": "org_123",
"contact": "contact"
}
}{
"success": false,
"message": "Missing or invalid parameter <param_name>"
}{
"success": false,
"message": "The service is not provisioned for your account."
}{
"success": false,
"message": "Insufficient funds"
}Voice campaigns
Trigger a scenario
Launches a voice campaign that places an outbound call using a pre-configured scenario. Track progress with the returned voice campaign id.
POST
/
v1
/
voice-campaigns
Trigger a scenario
curl --request POST \
--url https://api.wavix.com/v1/voice-campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"voice_campaign": {
"callflow_id": 3212,
"caller_id": "13123310912",
"contact": "16729923812",
"callback_url": "https://you-site.com/webhook"
}
}
'import requests
url = "https://api.wavix.com/v1/voice-campaigns"
payload = { "voice_campaign": {
"callflow_id": 3212,
"caller_id": "13123310912",
"contact": "16729923812",
"callback_url": "https://you-site.com/webhook"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
voice_campaign: {
callflow_id: 3212,
caller_id: '13123310912',
contact: '16729923812',
callback_url: 'https://you-site.com/webhook'
}
})
};
fetch('https://api.wavix.com/v1/voice-campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wavix.com/v1/voice-campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'voice_campaign' => [
'callflow_id' => 3212,
'caller_id' => '13123310912',
'contact' => '16729923812',
'callback_url' => 'https://you-site.com/webhook'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wavix.com/v1/voice-campaigns"
payload := strings.NewReader("{\n \"voice_campaign\": {\n \"callflow_id\": 3212,\n \"caller_id\": \"13123310912\",\n \"contact\": \"16729923812\",\n \"callback_url\": \"https://you-site.com/webhook\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wavix.com/v1/voice-campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"voice_campaign\": {\n \"callflow_id\": 3212,\n \"caller_id\": \"13123310912\",\n \"contact\": \"16729923812\",\n \"callback_url\": \"https://you-site.com/webhook\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wavix.com/v1/voice-campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice_campaign\": {\n \"callflow_id\": 3212,\n \"caller_id\": \"13123310912\",\n \"contact\": \"16729923812\",\n \"callback_url\": \"https://you-site.com/webhook\"\n }\n}"
response = http.request(request)
puts response.read_body{
"voice_campaign": {
"id": 2321423,
"status": "status",
"timestamp": "2023-06-15T10:30:00Z",
"caller_id": "org_123",
"contact": "contact"
}
}{
"success": false,
"message": "Missing or invalid parameter <param_name>"
}{
"success": false,
"message": "The service is not provisioned for your account."
}{
"success": false,
"message": "Insufficient funds"
}Authorizations
Wavix API key. Pass as Authorization: Bearer <api_key>. Keys support per-resource scopes (none / read / write). See Restricted keys and scopes.
Body
application/json
Attributes for the new voice campaign.
Scenario and contact details for the campaign.
Represents a voice campaign that places an outbound call running a pre-approved call flow.
Show child attributes
Show child attributes
Response
Returns the launched voice campaign.
Show child attributes
Show child attributes
Was this page helpful?
⌘I