I'm using PHP to subscribe people to a list. I want to set the value of a custom field, too, however, and when I include the "CustomFields" array in the "add" request, it bombs with this error:
Failed to deserialize your request.
Please check the documentation and try again.
Fields in error: subscriber
And here's a dump of the add request:
string(11) "Josh xxxxxxx"
When I don't include the CustomFields array, it works fine and people are added to the list.
A couple things: The docs for adding subscribers (http://www.campaignmonitor.com/api/subscribers/#adding_a_subscriber) Doesn't mention this error, nor does it identify the existence of a "subscriber" field, which is what the error is referencing.
Anyone ever encountered this before and/or have any suggestions?
Hey there joshrenaud, may I recommend that you take a look at our PHP wrapper for the Campaign Monitor API? In particular, the sample we have for adding subscribers. I think you'll find that our API is looking for an array within the CustomFields array.
The 400 error is a generic error response when a subscriber can't be added. If you're successfully adding subscribers when you remove CustomFields, there's very likely something in CustomFields that's baffling our API, so good sleuthing!
Thanks, joshrenaud - let us know how you go :)
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