Unable to update fields in API v3 when fields were originally empty

Using the import function of the PHP wrapper for API v3 I'm trying to update custom fields that were empty in the first import. I don't succeed in updating/adding those fields.

I've successfully imported 10 subscribers but did not add values for a couple of custom fields. Updating those subscribers and explicitly providing values for those empty fields fails. With 'fails' I mean the fields do not get updated, they stay empty. The API does not return any error either.

On the other hand, when I manually (through the website) update the subscribers and provide values for the empty field they do get updated successfully through the API in the next imports.

Summarized:
When custom fields are empty in a first import, it's impossible to update those fields later through the API.

Greg Strutton Greg Strutton, 5 years ago

Hi,  Thanks for the post.

You can easily update a subscriber by using the Add Subscriber http://www.campaignmonitor.com/api/subscribers/#adding_a_subscriber
If the email address already exists, it will update the passed fields (including custom fields) for that subscriber.

Another alternative, if you want to locate subscribers with missing information, you can create segments to search and return subscribers that do not have a value set on a particular field, which you can then match and update with your subscriber list.  For example, if you have a text based custom field which holds say "Job Title", you could create a segment named "Empty Job Title" and assign a rule which lists all subscribers where the Job Title is not provided.  For more detailed information on segments, please see: http://help.campaignmonitor.com/topic.aspx?t=90
You also have full control over segments within the API and for more information on this please see: http://www.campaignmonitor.com/api/segments/

I hope that helps answer your query.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098