Trying to run a delete function on an address in a subnet. I am using powershell and have also tried postman, I can get address information but not delete an IP in a subnet.
Delete result is : {"code":404,"success":0,"message":"Method Not Allowed"}
Powershell:
PS H:> $IPURL = $phpipamURL +"/api/$phpipamAppID/addresses/search/$IPAddress/"
$IPJson = Invoke-WebRequest -Uri $IPURL -Headers $phpipamsessionHeader -Method GET -ContentType $contentType
$IPData = $IPJson | ConvertFrom-Json
$IPSubnetID = $IPData.data.subnetid
PS H:> $IPSubnetID
12
PS H:> $JSON = @"
{'remove_dns': '1'}
"@
PS H:> $DeleteURL = $phpipamURL +"/api/$phpipamAppID/addresses/$IPAddress/"+"$IPSubnetID"
$Delete = Invoke-WebRequest -Uri $DeleteURL -Headers $phpipamsessionHeader -Method DELETE -Body $JSON -ContentType $contentType
#$Delete = Invoke-WebRequest -Uri $DeleteURL -Headers $phpipamsessionHeader -Method DELETE -ContentType $contentType
$Status = ($Delete | ConvertFrom-Json).message
Invoke-WebRequest : {"code":404,"success":0,"message":"Method Not Allowed"}
Anonymous