Delete all recordings associated with a caller

If your communications processes involve capturing and managing call recordings, the recording management section of the babelforce manager interface gives you powerful filtering and flag/tag functionality. But due to the sensitivity of recordings and their implications for data protection, you also need to be able to act quickly to comply with customer requests regarding audio files. 

A common requirement is the ability to automatically and instantly delete any call recordings which are associated with a certain caller. You could use the manager app's interface to do it, but that can be laborious. 

Instead, leverage the power of our standard APIs: find and remove recordings by just referencing the number(s) of the customer who has requested their deletion. For those of you familiar with the command line, here is a small BASH script example showing a way to do this:


set -e


IDS=$(curl -sX GET "${1}&max=500" \
    -H "X-Auth-Access-Id: ${ACCESS_ID}" \
    -H "X-Auth-Access-Token: ${ACCESS_TOKEN}" | jq -r '.items[].id')

COUNT=$(curl -sX GET "${1}&max=500" \
    -H "X-Auth-Access-Id: ${ACCESS_ID}" \
    -H "X-Auth-Access-Token: ${ACCESS_TOKEN}" | jq '.items | length')

echo "There are ${COUNT} recordings associated with the number ${1}"
read -p "Are you sure you want to delete these recordings? (y/n): " -n 1 -r

if [[ $REPLY =~ ^[Yy]$ ]]
    for ID in $IDS; do
        echo "Deleting recording ${ID}..."
        echo "----------------------------"
        curl -sX DELETE "${ID}" \
            -H "Content-Type: application/json" \
            -H "X-Auth-Access-Id: ${ACCESS_ID}" \
            -H "X-Auth-Access-Token: ${ACCESS_TOKEN}" \
            -d "{\"id\": \"${ID}\"}" | jq '. | {"success": .success, "message": .message}'

After saving it as an executable file, you would then run it like this:

$ ./ 491704184334

And this is what it looks like running:


Have more questions? Submit a request