Get a voice call
curl --request GET \
--url https://api.pamhq.com/v1/calls/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pamhq.com/v1/calls/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pamhq.com/v1/calls/{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.pamhq.com/v1/calls/{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: Bearer <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.pamhq.com/v1/calls/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <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.pamhq.com/v1/calls/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pamhq.com/v1/calls/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fromNumber": "<string>",
"toNumber": "<string>",
"dynamicVariables": {},
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"endReason": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>"
},
"agentVersion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123
},
"provider": "<string>",
"providerCallId": "<string>",
"recordingUrl": "<string>",
"transcriptUrl": "<string>",
"durationMs": 123,
"costCents": 123,
"analysis": {
"id": "<string>",
"status": "<string>",
"result": null,
"durationMs": 123,
"createdAt": "2023-11-07T05:31:56Z"
},
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"direction": "<string>",
"sequenceNumber": 123,
"content": "<string>",
"toolCallId": "<string>",
"toolName": "<string>",
"toolVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolArguments": {},
"toolResult": null,
"error": null,
"createdAt": "2023-11-07T05:31:56Z",
"delivery": {
"provider": "<string>",
"deliveryStatus": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"segments": 123,
"encoding": "<string>"
}
}
],
"transcript": [
{
"content": "<string>"
}
]
},
"meta": {
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"requestId": "<string>"
}
}Calls
Get a voice call
Returns the current status for one voice call conversation. Use this endpoint to reconcile state after missed, delayed, or retried webhooks.
GET
/
calls
/
{id}
Get a voice call
curl --request GET \
--url https://api.pamhq.com/v1/calls/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pamhq.com/v1/calls/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pamhq.com/v1/calls/{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.pamhq.com/v1/calls/{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: Bearer <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.pamhq.com/v1/calls/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <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.pamhq.com/v1/calls/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pamhq.com/v1/calls/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fromNumber": "<string>",
"toNumber": "<string>",
"dynamicVariables": {},
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"endReason": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metadata": {},
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>"
},
"agentVersion": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123
},
"provider": "<string>",
"providerCallId": "<string>",
"recordingUrl": "<string>",
"transcriptUrl": "<string>",
"durationMs": 123,
"costCents": 123,
"analysis": {
"id": "<string>",
"status": "<string>",
"result": null,
"durationMs": 123,
"createdAt": "2023-11-07T05:31:56Z"
},
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"direction": "<string>",
"sequenceNumber": 123,
"content": "<string>",
"toolCallId": "<string>",
"toolName": "<string>",
"toolVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolArguments": {},
"toolResult": null,
"error": null,
"createdAt": "2023-11-07T05:31:56Z",
"delivery": {
"provider": "<string>",
"deliveryStatus": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"segments": 123,
"encoding": "<string>"
}
}
],
"transcript": [
{
"content": "<string>"
}
]
},
"meta": {
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {
"requestId": "<string>"
}
}⌘I