Delete a Custom Field


I've been upgrading a custom wrapper we use from v2 to v3 and have hit a problem with Deleting a Custom Field from an existing Subscriber list.

I've managed to create a new custom field using the info outlined here
I now need to delete it (for testing purposes) but for some reason the api is always returning 404.

The process I'm using is:

1/ Get a list of custom fields using{listid}/customfields.xml and find the relevant Key.
2/ Call{listid}/customfields/{key}.xml to delete it.

Point 2 is returning Code 404, "We couldn't find the resource you're looking for. Please check the documentation and try again".

I've tried Debugging the whole process.  The URL is correct according to the docs.  I also tried the .json extension but that doesn't seen to make a difference.

I can post the listid and key if required.


Phil Phil, 6 years ago

Hi leem,

Two possibilities come to mind immediately:

1. You need to be able to specify the http verb with your route. When attempting to delete your custom field, are you using a DELETE http verb with your call to the route, as mentioned in the docs? (in all cases the little brown word "DELETE" next to the route is there to define what type of request is needed)
2. Are you certain you're using the correct key? It should include the square brackets in the string - eg "[key]"

Beyond that there could of course be many other reasons it fails. I understand that you've got a custom wrapper that you've worked with historically, but v2 and v3 of the API are different enough that simply porting it across won't be trivial. You might find it easier to use an appropriate wrapper instead.

If you're still having troubles, drop us a line on support at campaignmonitor dot com with a bit of your code (censor the api key, etc) and we'll take a peek for you.


leem, 6 years ago

Hi Rob,

Managed to fix it.  The problem was with the c# WebClient class.  After a bit of investigation the problem seemed to be with url encoding with the [ and ] characters.  Your point of checking that they were included pointed me in the right direction.

Our wrapper contains specific could for our own system as well as CM which is why we had to stick with it and upgrade from v2 to v3.


200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free