Get Campaign logs
curl --request GET \
--url https://api.getmalakai.com/campaigns/outbound/logs/{id} \
--header 'Authorization: <authorization>' \
--header 'x-access-token: <x-access-token>'import requests
url = "https://api.getmalakai.com/campaigns/outbound/logs/{id}"
headers = {
"Authorization": "<authorization>",
"x-access-token": "<x-access-token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'x-access-token': '<x-access-token>'}
};
fetch('https://api.getmalakai.com/campaigns/outbound/logs/{id}', 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.getmalakai.com/campaigns/outbound/logs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-access-token: <x-access-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getmalakai.com/campaigns/outbound/logs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-access-token", "<x-access-token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getmalakai.com/campaigns/outbound/logs/{id}")
.header("Authorization", "<authorization>")
.header("x-access-token", "<x-access-token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmalakai.com/campaigns/outbound/logs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["x-access-token"] = '<x-access-token>'
response = http.request(request)
puts response.read_body{
"responseCode": 2000,
"message": "Campaign logs fetched successfully",
"data": {
"analytics": {
"Total Contacts": 1,
"Completion": 100,
"Answered": 1,
"Not Answered": 0,
"Total Conversations": 33
},
"logs": [
{
"id": "cfebaae0-b30f-4124-a0ef-1a4ff68e1ccc",
"user_id": "**********",
"contact_name": "John Doe",
"contact_number": [
"+1234567890"
],
"contact_email": "hidden@example.com",
"tags": [
"tag1"
],
"created_at": "2024-11-21T10:50:47.409Z",
"updated_at": "2024-11-21T10:50:47.409Z",
"name": "John Doe",
"email": "hidden@example.com",
"status": "completed",
"address": "Hidden Address",
"analysis": "[{\"question\": \"did the human answer ?\", \"answer\": \"no\"}]",
"call_sid": "***********************",
"sentiment": "neutral",
"contact_id": "**********",
"session_id": "**********",
"call_summary": "The user was unable to provide any information related to the original request about speaking with a cybersecurity engineer or specialist. The conversation ended with the AI assistant politely acknowledging the user's situation and wishing them a great day.",
"call_duration": 33,
"goal_achieved": "no",
"recording_url": "https://api.twilio.com/2010-04-01/Accounts/AC********************/Recordings/RE********************",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Hello, this is [Your Company Name] calling to inquire about your cybersecurity personnel. Is there a cybersecurity engineer or specialist available that I could speak with?"
},
{
"role": "user",
"content": "The numbers are hidden. Please don't hang up and hold on a moment."
},
{
"role": "assistant",
"content": "I understand. Thank you for your time, and I hope you have a great day!"
},
{
"role": "user",
"content": "ok"
},
{
"role": "assistant",
"content": "Alright, here it is: \"Goodbye!\""
}
],
"recording_url": "https://malakai-audio-files.s3.us-east-1.amazonaws.com/hidden.mp3"
}
}
]
}
}
Outbound
Get Campaign logs
Retrieve a list of all existing campaigns
GET
campaigns
/
outbound
/
logs
/
{id}
Get Campaign logs
curl --request GET \
--url https://api.getmalakai.com/campaigns/outbound/logs/{id} \
--header 'Authorization: <authorization>' \
--header 'x-access-token: <x-access-token>'import requests
url = "https://api.getmalakai.com/campaigns/outbound/logs/{id}"
headers = {
"Authorization": "<authorization>",
"x-access-token": "<x-access-token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: '<authorization>', 'x-access-token': '<x-access-token>'}
};
fetch('https://api.getmalakai.com/campaigns/outbound/logs/{id}', 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.getmalakai.com/campaigns/outbound/logs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-access-token: <x-access-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getmalakai.com/campaigns/outbound/logs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-access-token", "<x-access-token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getmalakai.com/campaigns/outbound/logs/{id}")
.header("Authorization", "<authorization>")
.header("x-access-token", "<x-access-token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmalakai.com/campaigns/outbound/logs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["x-access-token"] = '<x-access-token>'
response = http.request(request)
puts response.read_body{
"responseCode": 2000,
"message": "Campaign logs fetched successfully",
"data": {
"analytics": {
"Total Contacts": 1,
"Completion": 100,
"Answered": 1,
"Not Answered": 0,
"Total Conversations": 33
},
"logs": [
{
"id": "cfebaae0-b30f-4124-a0ef-1a4ff68e1ccc",
"user_id": "**********",
"contact_name": "John Doe",
"contact_number": [
"+1234567890"
],
"contact_email": "hidden@example.com",
"tags": [
"tag1"
],
"created_at": "2024-11-21T10:50:47.409Z",
"updated_at": "2024-11-21T10:50:47.409Z",
"name": "John Doe",
"email": "hidden@example.com",
"status": "completed",
"address": "Hidden Address",
"analysis": "[{\"question\": \"did the human answer ?\", \"answer\": \"no\"}]",
"call_sid": "***********************",
"sentiment": "neutral",
"contact_id": "**********",
"session_id": "**********",
"call_summary": "The user was unable to provide any information related to the original request about speaking with a cybersecurity engineer or specialist. The conversation ended with the AI assistant politely acknowledging the user's situation and wishing them a great day.",
"call_duration": 33,
"goal_achieved": "no",
"recording_url": "https://api.twilio.com/2010-04-01/Accounts/AC********************/Recordings/RE********************",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Hello, this is [Your Company Name] calling to inquire about your cybersecurity personnel. Is there a cybersecurity engineer or specialist available that I could speak with?"
},
{
"role": "user",
"content": "The numbers are hidden. Please don't hang up and hold on a moment."
},
{
"role": "assistant",
"content": "I understand. Thank you for your time, and I hope you have a great day!"
},
{
"role": "user",
"content": "ok"
},
{
"role": "assistant",
"content": "Alright, here it is: \"Goodbye!\""
}
],
"recording_url": "https://malakai-audio-files.s3.us-east-1.amazonaws.com/hidden.mp3"
}
}
]
}
}
Headers
string
required
Your API key for authentication. Prefix with
Bearer .string
required
Your access token for authentication.
Response
object
The main response object containing analytics and logs.
object
An object containing overall analytics for the campaign logs.
number
Total number of contacts involved in the campaign.
number
Percentage of completion for the campaign.
number
Number of answered calls.
number
Number of calls not answered.
number
Total number of conversations in the campaign.
object[]
Array of log objects for each contact in the campaign.
string
Unique identifier for the log entry.
string
User identifier associated with the log.
string
Name of the contact.
string[]
Array of contact phone numbers.
string
Email address of the contact.
string[]
Array of tags associated with the contact.
string
Timestamp when the log was created (ISO format).
string
Timestamp when the log was last updated (ISO format).
string
Name of the contact (duplicate of contact_name).
string
Email address of the contact (duplicate of contact_email).
string
Status of the campaign log (e.g., completed).
string
Address of the contact.
string
JSON string containing analysis data.
string
Identifier for the call session.
string
Sentiment analysis result for the call.
string
Identifier for the contact.
string
Identifier for the session.
string
Summary of the call conversation.
number
Duration of the call in seconds.
string
Indicates if the campaign goal was achieved (“yes” or “no”).
string
URL to the call recording.
object
Object containing the transcript and recording URL.
object[]
Array of conversation objects with role and content.
string
Role in the conversation (user or assistant).
string
Content of the conversation message.
string
URL to the transcript audio file.
{
"responseCode": 2000,
"message": "Campaign logs fetched successfully",
"data": {
"analytics": {
"Total Contacts": 1,
"Completion": 100,
"Answered": 1,
"Not Answered": 0,
"Total Conversations": 33
},
"logs": [
{
"id": "cfebaae0-b30f-4124-a0ef-1a4ff68e1ccc",
"user_id": "**********",
"contact_name": "John Doe",
"contact_number": [
"+1234567890"
],
"contact_email": "hidden@example.com",
"tags": [
"tag1"
],
"created_at": "2024-11-21T10:50:47.409Z",
"updated_at": "2024-11-21T10:50:47.409Z",
"name": "John Doe",
"email": "hidden@example.com",
"status": "completed",
"address": "Hidden Address",
"analysis": "[{\"question\": \"did the human answer ?\", \"answer\": \"no\"}]",
"call_sid": "***********************",
"sentiment": "neutral",
"contact_id": "**********",
"session_id": "**********",
"call_summary": "The user was unable to provide any information related to the original request about speaking with a cybersecurity engineer or specialist. The conversation ended with the AI assistant politely acknowledging the user's situation and wishing them a great day.",
"call_duration": 33,
"goal_achieved": "no",
"recording_url": "https://api.twilio.com/2010-04-01/Accounts/AC********************/Recordings/RE********************",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Hello, this is [Your Company Name] calling to inquire about your cybersecurity personnel. Is there a cybersecurity engineer or specialist available that I could speak with?"
},
{
"role": "user",
"content": "The numbers are hidden. Please don't hang up and hold on a moment."
},
{
"role": "assistant",
"content": "I understand. Thank you for your time, and I hope you have a great day!"
},
{
"role": "user",
"content": "ok"
},
{
"role": "assistant",
"content": "Alright, here it is: \"Goodbye!\""
}
],
"recording_url": "https://malakai-audio-files.s3.us-east-1.amazonaws.com/hidden.mp3"
}
}
]
}
}
⌘I