Curl seems to be giving me conflicting response when i POST, GET or PATCH.
Using POST/GET i can see that my target IP address (10.130.9.35) exists as below. However, trying to update it using PATCH results in an error.
GET:
-Message:curl -X GET https://xxxxxxxx/phpipam/api/dev/addresses/ –header ‘token: xxxxxxxxxx’ –header “Content-Type: application/json”
-Response: {“id”:”15″,”subnetId”:”13″,”ip”:”10.130.9.35“,”is_gateway”:”0″,”description”:”12345″,”hostname”:null,”mac”:null,”owner”:null,”tag”:”2″,”deviceId”:null,”location”:null,”port”:null,”note”:null,”lastSeen”:”1970-01-01 00:00:01″,”excludePing”:”0″,”PTRignore”:”0″,”PTR”:”0″,”firewallAddressObject”:null,”editDate”:null,”customer_id”:null,”custom_Location (Coordinates)”:null,”custom_Latitude”:”12345″,”custom_Longitude”:”12345″,”custom_CID”:”12345″}
POST:
-Message: curl -s -X POST –data ‘{“subnetId”:”’13′”,”ip”:”‘10.130.9.35‘”,”description”:”‘12345′”,”custom_CID”:”‘12345′”,”custom_Latitude”:”‘12345′”,”custom_Longitude”:”‘12345′” }’ https://xxxxxxxxxx/phpipam/api/dev/addresses –header ‘token: xxxxxxxxx’ –header “Content-Type: application/json”
-Response: {“code”:409,”success”:false,”message”:”IP address already exists“,”time”:0.006}
However, trying to update the address using PATCH gives me an “Address does not exist”
PATCH:
-Message:curl -X PATCH –data ‘{“custom_CID”:”‘12345′”,”description”:”‘12345′”,”custom_Latitude”:”‘12345′”,”custom_Longitude”:”‘12345′”}’ https://xxxxxxx/phpipam/api/dev/addresses/10.130.9.35/ –header ‘token: xxxxxxxxx’ –header “Content-Type: application/json”
-Response: {“code”:404,”success”:false,”message”:”Address does not exist“,”time”:0.004}
What could be the Issue?