I am currently running a script to delete all my contacts in freeAgent and
have hit a slight API issue.
In freeAgent I have a contact which I assigned to a project, when I try to
delete it using the API I get a blank response back from freeAgent which
does not indicate anything, yet the contact still exists.
However if I log into freeAgent and try to delete it, it tells me that it
cannot be deleted as it is associated with a project, this makes perfect
sense to me but should the API not respond with a similar message so we can
My code for reference:
$accessToken = 'MY-TOKEN-GOES-HERE'; $c = curl_init($contact); curl_setopt($c, CURLOPT_HTTPHEADER, array( 'Accept: application/json', 'Content-Type: application/json', 'Authorization: Bearer '.$accessToken )); curl_setopt($c, CURLOPT_USERAGENT, 'SPCS LTD'); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_CUSTOMREQUEST, 'DELETE'); $result = curl_exec($c); echo $result;