Cancel a queued call
curl --request DELETE \
--url https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://client-backend.oktivo.com/api/v1/crm/calls/queue/{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://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"queueId": "<string>",
"contactUID": "<string>",
"state": "scheduled",
"type": "scheduled",
"reason": "<string>",
"phone": "<string>",
"name": "<string>",
"agentId": "<string>",
"agentName": "<string>",
"campaignUID": "<string>",
"kind": "<string>",
"scheduledFor": "2023-11-07T05:31:56Z",
"notBefore": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"attempts": 123,
"outcome": "<string>",
"lastError": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"meta": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true,
"limit": 123,
"nextCursor": "<string>"
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}Calls
Cancel a queued call
DELETE
/
api
/
v1
/
crm
/
calls
/
queue
/
{id}
Cancel a queued call
curl --request DELETE \
--url https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://client-backend.oktivo.com/api/v1/crm/calls/queue/{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://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}"
req, _ := http.NewRequest("DELETE", 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.delete("https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-backend.oktivo.com/api/v1/crm/calls/queue/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"queueId": "<string>",
"contactUID": "<string>",
"state": "scheduled",
"type": "scheduled",
"reason": "<string>",
"phone": "<string>",
"name": "<string>",
"agentId": "<string>",
"agentName": "<string>",
"campaignUID": "<string>",
"kind": "<string>",
"scheduledFor": "2023-11-07T05:31:56Z",
"notBefore": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"attempts": 123,
"outcome": "<string>",
"lastError": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"meta": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true,
"limit": 123,
"nextCursor": "<string>"
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}{
"success": false,
"message": "Validation failed",
"errors": [
{
"field": "phone",
"message": "phone is required"
}
],
"code": "VALIDATION_ERROR",
"requestId": "3f1c2c0e-6a41-4e0b-9f0e-1f2d6f1b8a77",
"errorInfo": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "phone",
"message": "phone is required"
}
]
}
}Headers
Response
Success. The body has success: true, the route's legacy fields, and the additive requestId, timestamp and meta.
Additive envelope fields present on every migrated v1 success body. All fields the route returned before are still returned unchanged.