#!/bin/bash
#
SERVER_IP="10.1.4.200"
API_KEY="apikeysequence"
QUEUE_ID="01" #extact name of the queque in the configuration
# Whaiting calls
calls=$(curl --silent --location -g "http://$SERVER_IP/api/v2/queue/$QUEUE_ID/calls" --header "app-key: $API_KEY")
# Debug:
echo "answer API: $calls"
# Waithing calls count
status=$(echo $calls | jq -r '.status')
if [ "$status" == "success" ]; then
call_count=$(echo $calls | jq -r '.data | length')
echo "call number: $call_count"
else
echo "Error API: $(echo $calls | jq -r '.message')"
fi
my erorr is always: {“status”:“error”,“message”:“Invalid Operation”}
Errore API: Invalid Operation
where i’m wrong? the api is correct, the firewall is disabled, it is protected in lan firewall