Get Inbound 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": "Inbound campaign logs fetched successfully",
"data": {
"analytics": {
"Total Contacts": 2,
"Total Conversations": 113
},
"logs": [
{
"from": "DUMMY_FROM",
"number": "DUMMY_NUMBER",
"status": "completed",
"call_sid": "DUMMY_CALL_SID",
"sentiment": "neutral",
"inbound_id": "DUMMY_INBOUND_ID",
"session_id": "DUMMY_SESSION_ID",
"call_summary": "The user asked about the services the company provides. The assistant acknowledged that they do not have information about the specific services, but offered to transfer the call to the customer service department to assist the user with their inquiry.",
"call_duration": 27.71903395652771,
"goal_achieved": "yes",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Thank you for calling. How can I assist you today?"
},
{
"role": "user",
"content": " Hey. What services you can provide me?"
},
{
"role": "assistant",
"content": "I'm afraid I don't have information about the specific services we offer. However, I can transfer your call to our customer service department who would be happy to assist you with your inquiry. REDIRECT_customer_service"
}
],
"recording_url": "https://dummy-audio-files.com/recording1.mp3"
}
},
{
"from": "+1234567890",
"number": "+10987654321",
"status": "completed",
"call_sid": "DUMMY_CALL_SID_2",
"sentiment": "positive",
"inbound_id": "DUMMY_INBOUND_ID_2",
"session_id": "DUMMY_SESSION_ID_2",
"call_summary": "The user initially had some technical issues with the call, but was able to clearly communicate their request to purchase a house. The assistant recognized this request and transferred the call to the sales department as per the instructions.",
"call_duration": 86.25287747383118,
"goal_achieved": "yes",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Thank you for calling. How can I assist you today?"
},
{
"role": "user",
"content": " Hello? Hello?"
},
{
"role": "assistant",
"content": "I'm sorry, I didn't hear anything from you. Could you please restate your request so I can try to assist you?"
},
{
"role": "user",
"content": " What services are you providing?"
},
{
"role": "assistant",
"content": "We offer a variety of services to our customers. How may I best assist you today? If you have a specific inquiry, I'd be happy to try to help or direct you to the appropriate department."
},
{
"role": "user",
"content": " I want to buy a house. I want to buy a house."
},
{
"role": "assistant",
"content": "Okay, let me transfer you to our sales department who can assist you with purchasing a house. One moment please. REDIRECT_Sales"
}
],
"recording_url": "https://dummy-audio-files.com/recording2.mp3"
}
}
]
}
}
Inbound
Get Inbound Campaign logs
Retrieve a list of all existing campaigns
GET
campaigns
/
outbound
/
logs
/
{id}
Get Inbound 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": "Inbound campaign logs fetched successfully",
"data": {
"analytics": {
"Total Contacts": 2,
"Total Conversations": 113
},
"logs": [
{
"from": "DUMMY_FROM",
"number": "DUMMY_NUMBER",
"status": "completed",
"call_sid": "DUMMY_CALL_SID",
"sentiment": "neutral",
"inbound_id": "DUMMY_INBOUND_ID",
"session_id": "DUMMY_SESSION_ID",
"call_summary": "The user asked about the services the company provides. The assistant acknowledged that they do not have information about the specific services, but offered to transfer the call to the customer service department to assist the user with their inquiry.",
"call_duration": 27.71903395652771,
"goal_achieved": "yes",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Thank you for calling. How can I assist you today?"
},
{
"role": "user",
"content": " Hey. What services you can provide me?"
},
{
"role": "assistant",
"content": "I'm afraid I don't have information about the specific services we offer. However, I can transfer your call to our customer service department who would be happy to assist you with your inquiry. REDIRECT_customer_service"
}
],
"recording_url": "https://dummy-audio-files.com/recording1.mp3"
}
},
{
"from": "+1234567890",
"number": "+10987654321",
"status": "completed",
"call_sid": "DUMMY_CALL_SID_2",
"sentiment": "positive",
"inbound_id": "DUMMY_INBOUND_ID_2",
"session_id": "DUMMY_SESSION_ID_2",
"call_summary": "The user initially had some technical issues with the call, but was able to clearly communicate their request to purchase a house. The assistant recognized this request and transferred the call to the sales department as per the instructions.",
"call_duration": 86.25287747383118,
"goal_achieved": "yes",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Thank you for calling. How can I assist you today?"
},
{
"role": "user",
"content": " Hello? Hello?"
},
{
"role": "assistant",
"content": "I'm sorry, I didn't hear anything from you. Could you please restate your request so I can try to assist you?"
},
{
"role": "user",
"content": " What services are you providing?"
},
{
"role": "assistant",
"content": "We offer a variety of services to our customers. How may I best assist you today? If you have a specific inquiry, I'd be happy to try to help or direct you to the appropriate department."
},
{
"role": "user",
"content": " I want to buy a house. I want to buy a house."
},
{
"role": "assistant",
"content": "Okay, let me transfer you to our sales department who can assist you with purchasing a house. One moment please. REDIRECT_Sales"
}
],
"recording_url": "https://dummy-audio-files.com/recording2.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
Total number of conversations in the campaign.
object[]
Array of log objects for each contact in the campaign.
string
The sender’s identifier or phone number.
string
The recipient’s phone number.
string
Status of the campaign log (e.g., completed).
string
Identifier for the call session.
string
Sentiment analysis result for the call.
string
Identifier for the inbound campaign.
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”).
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": "Inbound campaign logs fetched successfully",
"data": {
"analytics": {
"Total Contacts": 2,
"Total Conversations": 113
},
"logs": [
{
"from": "DUMMY_FROM",
"number": "DUMMY_NUMBER",
"status": "completed",
"call_sid": "DUMMY_CALL_SID",
"sentiment": "neutral",
"inbound_id": "DUMMY_INBOUND_ID",
"session_id": "DUMMY_SESSION_ID",
"call_summary": "The user asked about the services the company provides. The assistant acknowledged that they do not have information about the specific services, but offered to transfer the call to the customer service department to assist the user with their inquiry.",
"call_duration": 27.71903395652771,
"goal_achieved": "yes",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Thank you for calling. How can I assist you today?"
},
{
"role": "user",
"content": " Hey. What services you can provide me?"
},
{
"role": "assistant",
"content": "I'm afraid I don't have information about the specific services we offer. However, I can transfer your call to our customer service department who would be happy to assist you with your inquiry. REDIRECT_customer_service"
}
],
"recording_url": "https://dummy-audio-files.com/recording1.mp3"
}
},
{
"from": "+1234567890",
"number": "+10987654321",
"status": "completed",
"call_sid": "DUMMY_CALL_SID_2",
"sentiment": "positive",
"inbound_id": "DUMMY_INBOUND_ID_2",
"session_id": "DUMMY_SESSION_ID_2",
"call_summary": "The user initially had some technical issues with the call, but was able to clearly communicate their request to purchase a house. The assistant recognized this request and transferred the call to the sales department as per the instructions.",
"call_duration": 86.25287747383118,
"goal_achieved": "yes",
"transcript": {
"conversation": [
{
"role": "user",
"content": "---"
},
{
"role": "assistant",
"content": "Thank you for calling. How can I assist you today?"
},
{
"role": "user",
"content": " Hello? Hello?"
},
{
"role": "assistant",
"content": "I'm sorry, I didn't hear anything from you. Could you please restate your request so I can try to assist you?"
},
{
"role": "user",
"content": " What services are you providing?"
},
{
"role": "assistant",
"content": "We offer a variety of services to our customers. How may I best assist you today? If you have a specific inquiry, I'd be happy to try to help or direct you to the appropriate department."
},
{
"role": "user",
"content": " I want to buy a house. I want to buy a house."
},
{
"role": "assistant",
"content": "Okay, let me transfer you to our sales department who can assist you with purchasing a house. One moment please. REDIRECT_Sales"
}
],
"recording_url": "https://dummy-audio-files.com/recording2.mp3"
}
}
]
}
}
⌘I