# API base URL
API_URL="https://g...content-available-to-author-only...b.dev/api/v1/songs/id"
# Loop over the range of IDs from 20 to 5000
for id in {20..5000}
do
# Perform DELETE request and capture the full response and status code
response=$(curl -s -w "HTTP_CODE:%{http_code}" -X DELETE "$API_URL/$id")
# Extract the status code by splitting the response
http_code=$(echo "$response" | sed -n 's/.*HTTP_CODE://p')
body=$(echo "$response" | sed 's/HTTP_CODE:.*//')
# Check if the request was successful (HTTP status 200)
if [ "$http_code" -eq 200 ]; then
echo "Successfully deleted song with ID $id"
else
echo "Failed to delete song with ID $id, HTTP status code: $http_code"
echo "Response body: $body"
fi
done